1 --- a/boost/date_time/time_facet.hpp
2 +++ b/boost/date_time/time_facet.hpp
4 time_dur_arg.get_rep().as_special());
7 - string_type format(m_time_duration_format);
8 + string_type local_format(m_time_duration_format);
9 if (time_dur_arg.is_negative()) {
10 // replace %- with minus sign. Should we use the numpunct facet?
11 - boost::algorithm::replace_all(format,
12 + boost::algorithm::replace_all(local_format,
13 duration_sign_negative_only,
15 // remove all the %+ in the string with '-'
16 - boost::algorithm::replace_all(format,
17 + boost::algorithm::replace_all(local_format,
21 else { //duration is positive
22 // remove all the %- combos from the string
23 - boost::algorithm::erase_all(format, duration_sign_negative_only);
24 + boost::algorithm::erase_all(local_format, duration_sign_negative_only);
25 // remove all the %+ in the string with '+'
26 - boost::algorithm::replace_all(format,
27 + boost::algorithm::replace_all(local_format,
32 // %T and %R have to be replaced here since they are not standard
33 - boost::algorithm::replace_all(format,
34 + boost::algorithm::replace_all(local_format,
35 boost::as_literal(formats_type::full_24_hour_time_format),
36 boost::as_literal(formats_type::full_24_hour_time_expanded_format));
37 - boost::algorithm::replace_all(format,
38 + boost::algorithm::replace_all(local_format,
39 boost::as_literal(formats_type::short_24_hour_time_format),
40 boost::as_literal(formats_type::short_24_hour_time_expanded_format));
45 string_type hours_str;
46 - if (format.find(unrestricted_hours_format) != string_type::npos) {
47 + if (local_format.find(unrestricted_hours_format) != string_type::npos) {
48 hours_str = hours_as_string(time_dur_arg);
49 - boost::algorithm::replace_all(format, unrestricted_hours_format, hours_str);
50 + boost::algorithm::replace_all(local_format, unrestricted_hours_format, hours_str);
52 // We still have to process restricted hours format specifier. In order to
53 // support parseability of durations in ISO format (%H%M%S), we'll have to
54 // restrict the stringified hours length to 2 characters.
55 - if (format.find(hours_format) != string_type::npos) {
56 + if (local_format.find(hours_format) != string_type::npos) {
57 if (hours_str.empty())
58 hours_str = hours_as_string(time_dur_arg);
59 BOOST_ASSERT(hours_str.length() <= 2);
60 - boost::algorithm::replace_all(format, hours_format, hours_str);
61 + boost::algorithm::replace_all(local_format, hours_format, hours_str);
65 - if (format.find(seconds_with_fractional_seconds_format) != string_type::npos) {
66 + if (local_format.find(seconds_with_fractional_seconds_format) != string_type::npos) {
67 // replace %s with %S.nnn
69 fractional_seconds_as_string(time_dur_arg, false);
71 string_type replace_string(seconds_format);
72 replace_string += sep;
73 replace_string += frac_str;
74 - boost::algorithm::replace_all(format,
75 + boost::algorithm::replace_all(local_format,
76 seconds_with_fractional_seconds_format,
79 - if (format.find(fractional_seconds_format) != string_type::npos) {
80 + if (local_format.find(fractional_seconds_format) != string_type::npos) {
81 // replace %f with nnnnnnn
82 if (!frac_str.size()) {
83 frac_str = fractional_seconds_as_string(time_dur_arg, false);
85 - boost::algorithm::replace_all(format,
86 + boost::algorithm::replace_all(local_format,
87 fractional_seconds_format,
91 - if (format.find(fractional_seconds_or_none_format) != string_type::npos) {
92 + if (local_format.find(fractional_seconds_or_none_format) != string_type::npos) {
93 // replace %F with nnnnnnn or nothing if fs == 0
95 fractional_seconds_as_string(time_dur_arg, true);
97 string_type replace_string;
98 replace_string += sep;
99 replace_string += frac_str;
100 - boost::algorithm::replace_all(format,
101 + boost::algorithm::replace_all(local_format,
102 fractional_seconds_or_none_format,
106 - boost::algorithm::erase_all(format,
107 + boost::algorithm::erase_all(local_format,
108 fractional_seconds_or_none_format);
112 return this->do_put_tm(next_arg, ios_arg, fill_arg,
113 - to_tm(time_dur_arg), format);
114 + to_tm(time_dur_arg), local_format);
117 OutItrT put(OutItrT next, std::ios_base& ios_arg,