|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77137 - trunk/libs/chrono/doc
From: vicente.botet_at_[hidden]
Date: 2012-02-28 13:51:19
Author: viboes
Date: 2012-02-28 13:51:18 EST (Tue, 28 Feb 2012)
New Revision: 77137
URL: http://svn.boost.org/trac/boost/changeset/77137
Log:
Chrono: Update doc io v2
Text files modified:
trunk/libs/chrono/doc/chrono.qbk | 2033 ++++++++++++++++++++++++++++++++-------
1 files changed, 1669 insertions(+), 364 deletions(-)
Modified: trunk/libs/chrono/doc/chrono.qbk
==============================================================================
--- trunk/libs/chrono/doc/chrono.qbk (original)
+++ trunk/libs/chrono/doc/chrono.qbk 2012-02-28 13:51:18 EST (Tue, 28 Feb 2012)
@@ -54,11 +54,12 @@
[def __precondition [*PreConditions:]]
[def __requires [*Requires:]]
[def __params [*Parameters:]]
-[template param[p] [*[p]:]]
+[template param [p] [*[p]:]]
[template mu[]'''μ'''] [/ µ Greek small letter mu]
[template plusminus[]'''±'''] [/ ? plus or minus sign]
+[def __mus [mu]s]
[/===============================================]
[def __common_type `common_type`]
@@ -265,6 +266,8 @@
[def __prefix [link chrono.reference.io.duration_style_hpp.duration_style `prefix`]]
[def __symbol [link chrono.reference.io.duration_style_hpp.duration_style `symbol`]]
+[def __symbol_format [link chrono.reference.io.duration_io_hpp.manipulators.symbol_format `symbol_format`]]
+[def __name_format [link chrono.reference.io.duration_io_hpp.manipulators.name_format `name_format`]]
[def __duration_fmt [link chrono.reference.io.duration_io_hpp.manipulators.duration_fmt `duration_fmt`]]
[def __duration_fmt__c1 [link chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.c1 `duration_fmt`]]
[def __duration_fmt__op_duration_style [link chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_duration_style `operator duration_style_type`]]
@@ -279,32 +282,72 @@
[def __duration_style_io_saver__d [link chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.d `~duration_style_io_saver`]]
[def __duration_style_io_saver__restore [link chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.restore `restore`]]
+[def __get_duration_style [link chrono.reference.io.ios_state_hpp.sag.get_duration_style `get_duration_style`]]
+[def __set_duration_style [link chrono.reference.io.ios_state_hpp.sag.set_duration_style `set_duration_style`]]
+[def __get_timezone [link chrono.reference.io.ios_state_hpp.sag.get_timezone `get_timezone`]]
+[def __set_timezone [link chrono.reference.io.ios_state_hpp.sag.set_timezone `set_timezone`]]
+[def __get_time_fmt [link chrono.reference.io.ios_state_hpp.sag.get_time_fmt `get_time_fmt`]]
+[def __set_time_fmt [link chrono.reference.io.ios_state_hpp.sag.set_time_fmt `set_time_fmt`]]
+
[def __duration__op_in [link chrono.reference.io.duration_io_hpp.streams.duration__op_in `operator >>`]]
[def __duration__op_out [link chrono.reference.io.duration_io_hpp.streams.duration__op_out `operator <<`]]
+[def __duration_get [link chrono.reference.io.duration_get_hpp.duration_get `duration_get`]]
+[def __duration_get_c [link chrono.reference.io.duration_get_hpp.duration_get.c `duration_get`]]
+[def __duration_get_d [link chrono.reference.io.duration_get_hpp.duration_get.d `~duration_get`]]
+[def __duration_get_get [link chrono.reference.io.duration_get_hpp.duration_get.get `get`]]
+[def __duration_get_get2 [link chrono.reference.io.duration_get_hpp.duration_get.get2 `get`]]
+[def __duration_get_get_unit [link chrono.reference.io.duration_get_hpp.duration_get.get_unit `get_unit`]]
+[def __duration_get_get_value [link chrono.reference.io.duration_get_hpp.duration_get.get_value `get_value`]]
+
+[def __duration_put [link chrono.reference.io.duration_put_hpp.duration_put `duration_put`]]
+[def __duration_put_c [link chrono.reference.io.duration_put_hpp.duration_put.c `duration_put`]]
+[def __duration_put_d [link chrono.reference.io.duration_put_hpp.duration_put.d `~duration_put`]]
+[def __duration_put_put [link chrono.reference.io.duration_put_hpp.duration_put.put `put`]]
+[def __duration_put_put2 [link chrono.reference.io.duration_put_hpp.duration_put.put2 `put`]]
+[def __duration_put_put_unit [link chrono.reference.io.duration_put_hpp.duration_put.put_unit `put_unit`]]
+[def __duration_put_put_value [link chrono.reference.io.duration_put_hpp.duration_put.put_value `put_value`]]
+
+[def __duration_units [link chrono.reference.io.duration_units_hpp.duration_units `duration_units`]]
+[def __duration_units_c [link chrono.reference.io.duration_units_hpp.duration_units.c `duration_units`]]
+[def __duration_units_d [link chrono.reference.io.duration_units_hpp.duration_units.d `~duration_units`]]
+[def __duration_units_get_n_d_valid_units_start [link chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_start `get_n_d_valid_units_start`]]
+[def __duration_units_get_n_d_valid_units_end [link chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_end `get_n_d_valid_units_end`]]
+[def __duration_units_get_n_d_unit [link chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_unit `get_n_d_unit`]]
+[def __duration_units_do_get_n_d_unit [link chrono.reference.io.duration_units_hpp.duration_units.do_get_n_d_unit `do_get_n_d_unit`]]
+[def __duration_units_match_n_d_valid_unit [link chrono.reference.io.duration_units_hpp.duration_units.match_n_d_valid_unit `match_n_d_valid_unit`]]
+[def __duration_units_get_valid_units_start [link chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_start `get_valid_units_start`]]
+[def __duration_units_get_valid_units_end [link chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_end `get_valid_units_end`]]
+[def __duration_units_get_unit [link chrono.reference.io.duration_units_hpp.duration_units.get_unit `get_unit`]]
+[def __duration_units_do_get_unit [link chrono.reference.io.duration_units_hpp.duration_units.do_get_unit `do_get_unit`]]
+[def __duration_units_match_valid_unit [link chrono.reference.io.duration_units_hpp.duration_units.match_valid_unit `match_valid_unit`]]
+[def __duration_units_get_pattern [link chrono.reference.io.duration_units_hpp.duration_units.get_pattern `get_pattern`]]
+[def __duration_units_is_named_unit [link chrono.reference.io.duration_units_hpp.duration_units.is_named_unit `is_named_unit`]]
+[def __duration_units_do_is_named_unit [link chrono.reference.io.duration_units_hpp.duration_units.do_is_named_unit `do_is_named_unit`]]
+
[/==================]
[def __timezone_ns [link chrono.reference.io.timezone_hpp.timezone `timezone`]]
[def __timezone [link chrono.reference.io.timezone_hpp.timezone `timezone_type`]]
-[def __udt [link chrono.reference.io.timezone_hpp.timezone `udt`]]
+[def __utc [link chrono.reference.io.timezone_hpp.timezone `utc`]]
[def __local [link chrono.reference.io.timezone_hpp.timezone `local`]]
[def __time_fmt1 [link chrono.reference.io.time_point_io_hpp.manip.time_fmt1 `time_fmt`]]
[def __time_fmt2 [link chrono.reference.io.time_point_io_hpp.manip.time_fmt2 `time_fmt`]]
-[def __timezone_io_saver [link chrono.reference.io.time_point_io_hpp.ioss.timezone_io_saver `timezone_io_saver`]]
-[def __timezone_io_saver__c1 [link chrono.reference.io.time_point_io_hpp.ioss.timezone_io_saver.c1 `timezone_io_saver`]]
-[def __timezone_io_saver__c2 [link chrono.reference.io.time_point_io_hpp.ioss.timezone_io_saver.c2 `timezone_io_saver`]]
-[def __timezone_io_saver__d [link chrono.reference.io.time_point_io_hpp.ioss.timezone_io_saver.d `~timezone_io_saver`]]
-[def __timezone_io_saver__restore [link chrono.reference.io.time_point_io_hpp.ioss.timezone_io_saver.restore `restore`]]
-
-[def __time_fmt_io_saver [link chrono.reference.io.time_point_io_hpp.ioss.time_fmt_io_saver `time_fmt_io_saver`]]
-[def __time_fmt_io_saver__c1 [link chrono.reference.io.time_point_io_hpp.ioss.time_fmt_io_saver.c1 `time_fmt_io_saver`]]
-[def __time_fmt_io_saver__c2 [link chrono.reference.io.time_point_io_hpp.ioss.time_fmt_io_saver.c2 `time_fmt_io_saver`]]
-[def __time_fmt_io_saver__d [link chrono.reference.io.time_point_io_hpp.ioss.time_fmt_io_saver.d `~time_fmt_io_saver`]]
-[def __time_fmt_io_saver__restore [link chrono.reference.io.time_point_io_hpp.ioss.time_fmt_io_saver.restore `restore`]]
+[def __timezone_io_saver [link chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver `timezone_io_saver`]]
+[def __timezone_io_saver__c1 [link chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c1 `timezone_io_saver`]]
+[def __timezone_io_saver__c2 [link chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c2 `timezone_io_saver`]]
+[def __timezone_io_saver__d [link chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.d `~timezone_io_saver`]]
+[def __timezone_io_saver__restore [link chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.restore `restore`]]
+
+[def __time_fmt_io_saver [link chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver `time_fmt_io_saver`]]
+[def __time_fmt_io_saver__c1 [link chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c1 `time_fmt_io_saver`]]
+[def __time_fmt_io_saver__c2 [link chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c2 `time_fmt_io_saver`]]
+[def __time_fmt_io_saver__d [link chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.d `~time_fmt_io_saver`]]
+[def __time_fmt_io_saver__restore [link chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.restore `restore`]]
[/==================]
@@ -318,9 +361,10 @@
[def __SimpleStopwatch [link chrono.reference.stopwatches.simple_stopwatch_req `SimpleStopwatch`]]
[def __simple_stopwatch_concept [link chrono.reference.stopwatches.simple_stopwatch_req `SimpleStopwatch`]]
[def __simple_stopwatch [link chrono.reference.stopwatches.simple_stopwatch_hpp.simple_stopwatch `simple_stopwatch`]]
-[def __simple_stopclock [link chrono.reference.stopwatches.simple_stopwatch_hpp.simple_stopwatch `simple_clock`]]
[def __stopwatch [link chrono.reference.stopwatches.simple_stopwatch_hpp.simple_stopwatch `simple_stopwatch`]]
+[def __simple_stopclock [link chrono.reference.stopwatches.simple_stopwatch_hpp.simple_stopclock `simple_stopclock`]]
+[def __basic_stopclock [link chrono.reference.stopwatches.simple_stopwatch_hpp.basic_stopclock `basic_stopclock`]]
[def __BasicStopwatch [link chrono.reference.stopwatches.stopwatch_req `BasicStopwatch`]]
[def __basic_stopwatch_concept [link chrono.reference.stopwatches.stopwatch_req `BasicStopwatch`]]
@@ -480,10 +524,16 @@
It provides I/O for __duration and __time_point. This I/O makes use of these types much more convenient. In following the "you only pay for what you use" philosophy, this extra functionality is located in a header separate from <boost/chrono/chrono.hpp>, namely <boost/chrono/chrono_io.hpp>.
It builds on `<boost/ratio/ratio_io.hpp>` to provide readable and flexible formatting and parsing for types in `<boost/chrono.hpp>`.
-This textural representation uses [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes SI prefixes] whenever possible. This makes it easy for `boost::milliseconds` to be represented by the text "milliseconds", or a hypothetical meter class to print out "millimeter".
-The __duration unit names can be customized through a new facet: __duration_punct.
-
-`system_clock::time_point` I/O is proposed in terms of UTC timepoints, strongly guided by ISO 9899:1999, Programming languages - C, ISO 9945:2003, Information Technology - Portable Operating System Interface (POSIX) and ISO 8601:2004, Data elements and interchange formats - Information interchange - Representation of dates and times.
+This textural representation uses [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes SI prefixes] whenever possible.
+This makes it easy for `boost::milliseconds` to be represented by the text "milliseconds", or a hypothetical meter
+class to print out "millimeter".
+The __duration and the __time_point i/o can be customized through the new facets: __duration_units and __time_point_units.
+The user can specialize these facets so that the the chrono i/o could be localizable.
+However Boost.Chrono doesn't provides a complete locale solution.
+
+`system_clock::time_point` I/O is proposed in terms of UTC timepoints, strongly guided by
+ISO 9899:1999, Programming languages - C, ISO 9945:2003, Information Technology - Portable Operating System Interface (POSIX) and
+ISO 8601:2004, Data elements and interchange formats - Information interchange - Representation of dates and times.
[heading Rounding utilities]
@@ -493,29 +543,26 @@
On top of the core facilities, __Boost_Chrono provides:
-* Stopwatches: Some facility to measure elapsed time with the ability to start, stop, suspend, or resume measurement.
- * __SimpleStopwatch concept.
- * __BasicStopwatch concept.
- * __SuspendableStopwatch concept.
- * __simple_stopwatch, model of __SimpleStopwatch capturing elapsed __Clock times.
- * __laps_stopwatch, model of __BasicStopwatch allowing in addition to start and stop the capture of elapsed __Clock times.
- * __suspendable_stopwatch, model of __SuspendableStopwatch allowing in addition to suspend and resume the capture of elapsed __Clock times.
-
-__laps_stopwatch and __suspendable_stopwatch have LapsCollector template parameter that allows to store information of the samples defined by a cycle start-stop.
-
-* Stopclocks: a complete time reporting package that can be invoked in a single line of code.
- * __stopwatch_reporter`<__Stopwatch,__Formatter>`, convenient reporting to an output stream (including wide char streams) of the elapsed time of models of __Stopwatch results.
- * Some basic __Formatters.
- * `__simple_stopclock<__Clock>` shortcut of `__stopwatch_reporter<__simple_stopwatch<__Clock>>`
- * `__basic_stopclock<__Clock>` shortcut of `__stopwatch_reporter<__laps_stopwatch<__Clock>>`
- * `__suspendable_stopclock<__Clock>` shortcut of `__stopwatch_reporter<__suspendable_stopwatch<__Clock>>`
+Stopwatches: Some facility to measure elapsed time with the ability to start, stop, suspend, or resume measurement.
+* __SimpleStopwatch, __BasicStopwatch, __SuspendableStopwatch concepts.
+* __simple_stopwatch, model of __SimpleStopwatch capturing elapsed __Clock times.
+* __laps_stopwatch, model of __BasicStopwatch allowing in addition to start and stop the capture of elapsed __Clock times.
+* __suspendable_stopwatch, model of __SuspendableStopwatch allowing in addition to suspend and resume the capture of elapsed __Clock times.
+* __laps_stopwatch and __suspendable_stopwatch have __LapsCollector template parameter that allows to store information of the samples defined by a cycle start-stop.
+
+Stopclocks: a complete time reporting package that can be invoked in a single line of code.
+
+* __stopwatch_reporter`<__Stopwatch,__Formatter>`, convenient reporting to an output stream (including wide char streams) of the elapsed time of models of __Stopwatch results.
+* Some basic __Formatters.
+* `__simple_stopclock<__Clock>` shortcut of `__stopwatch_reporter<__simple_stopwatch<__Clock>>`
+* `__basic_stopclock<__Clock>` shortcut of `__stopwatch_reporter<__laps_stopwatch<__Clock>>`
+* `__suspendable_stopclock<__Clock>` shortcut of `__stopwatch_reporter<__suspendable_stopwatch<__Clock>>`
[heading Caveat Emptor]
The underlying clocks provided by operating systems are subject to many seemingly arbitrary policies and implementation irregularities. That's a polite way of saying they tend to be flakey, and each operating system or even each clock has its own cruel and unusual forms of flakiness. Don't bet the farm on their accuracy, unless you have become deeply familiar with exactly what the specific operating system is guaranteeing, which is often very little.
-
[endsect]
[endsect]
@@ -1267,7 +1314,7 @@
ClockTick(3) + nanoseconds(10) = 56 [1/5000000000]seconds
Set cout to use short names:
- milliseconds(3) + microseconds(10) = 3010 [mu]s
+ milliseconds(3) + microseconds(10) = 3010 __mus
hours(3) + minutes(10) = 190 m
ClockTick(3) + nanoseconds(10) = 56 [1/5000000000]s
@@ -1279,10 +1326,10 @@
As can be seen, each duration type can be streamed without having to manually stream the compile-time units after the run-time value. And when the compile-time unit is known to be a "common unit", English names are used. For "uncommon units" a unit name is composed from the reduced numerator and denominator of the associated __ratio. Whatever stream/locale settings are set for `duration::rep` are used for the value. Additionally, when the value is 1, singular forms for the units are used.
-Sometimes it is desired to shorten these names by using the SI symbols instead of SI prefixes. This can be accomplished with the use of the __duration_symbol manipulator [footnote __duration_short in V1]:
+Sometimes it is desired to shorten these names by using the SI symbols instead of SI prefixes. This can be accomplished with the use of the __symbol_format manipulator [footnote __duration_short in V1]:
cout << "\nSet cout to use short names:\n";
- cout << boost::chrono::duration_prefix;
+ cout << boost::chrono::symbol_format;
cout << "milliseconds(3) + microseconds(10) = "
<< boost::chrono::milliseconds(3) + boost::chrono::microseconds(10) << '\n';
@@ -1297,7 +1344,7 @@
The output could be
Set cout to use short names:
- milliseconds(3) + microseconds(10) = 3010 [mu]s
+ milliseconds(3) + microseconds(10) = 3010 __mus
hours(3) + minutes(10) = 190 m
ClockTick(3) + nanoseconds(10) = 56 [1/5000000000]s
@@ -4199,12 +4246,47 @@
// i/o state savers
struct __duration_style_io_saver;
-
+ template<typename CharT = char, typename Traits = std::char_traits<CharT> >
+ struct __timezone_io_saver;
+ template<typename CharT = char, typename Traits = std::char_traits<CharT> >
+ struct __time_fmt_io_saver;
}
}
[section:sag Setter and getters]
+[section:get_duration_style Non Member Function `get_duration_style(std::ios_base &)`]
+
+ duration_style::type get_duration_style(std::ios_base & ios);
+
+__returns The stream's __duration_style attribute associated to `ios`.
+
+[endsect]
+
+[section:set_duration_style Non Member Function `set_duration_style(std::ios_base &,duration_style::type)`]
+
+ void set_duration_style(std::ios_base& ios, duration_style::type style);
+
+__effects Set the stream's __duration_style attribute associated to `ios` so the `style` parameter.
+
+[endsect]
+
+[section:get_timezone Non Member Function `get_timezone(std::ios_base&)`]
+
+ timezone::type get_timezone(std::ios_base & ios);
+
+__returns The stream's __timezone attribute associated to `ios`.
+
+[endsect]
+
+[section:set_timezone Non Member Function `set_timezone(std::ios_base&,duration_style::type)`]
+
+ void set_timezone(std::ios_base& ios, timezone::type tz);
+
+__effects Set the stream's __timezone attribute associated to `ios` so the `style` parameter.
+
+[endsect]
+
[endsect]
[section:ioss I/O State Savers]
[section:duration_style_io_saver Template Class `duration_style_io_saver`]
@@ -4213,8 +4295,8 @@
struct duration_style_io_saver
{
- typedef std::ios_base state_type;
- typedef __duration_style aspect_type;
+ typedef std::ios_base state_type; // the state type is ios_base
+ typedef __duration_style aspect_type; // the aspect type is the __duration_style
explicit __duration_style_io_saver__c1(state_type &s);
__duration_style_io_saver__c2(state_type &s, aspect_type new_value);
@@ -4222,7 +4304,6 @@
void __duration_style_io_saver__restore();
};
-
The `state_type` is a version of the IOStreams base class `std::ios_base`.
[section:c1 Constructor `duration_style_io_saver(state_type&)`]
@@ -4270,6 +4351,124 @@
[endsect]
+[section:timezone_io_saver Template Class `timezone_io_saver<>`]
+
+
+ template<typename CharT = char, typename Traits = std::char_traits<CharT> >
+ struct __timezone_io_saver
+ {
+ typedef std::basic_ios<CharT, Traits> state_type;
+ typedef __timezone aspect_type;
+
+ explicit __timezone_io_saver__c1(state_type &s);
+ __timezone_io_saver__c2(state_type &s, aspect_type new_value);
+ __timezone_io_saver__d();
+ void timezone_io_saver__restore();
+ };
+
+
+The `state_type` is a version of the IOStreams base class template `std::basic_ios<CharT, Traits>`, where `CharT` is a character type and `Traits` is a character traits class. The user would usually place an actual input, output, or combined stream object for the state-type parameter, and not a base class object.
+
+[section:c1 Constructor `timezone_io_saver(state_type&)`]
+
+The first constructor takes a stream object and saves a reference to the stream and the current value of a particular stream attribute.
+
+ explicit timezone_io_saver(state_type &s);
+
+__effects Constructs a __timezone_io_saver by storing `s`.
+
+[endsect]
+
+[section:c2 Constructor `timezone_io_saver(state_type, aspect_type)`]
+
+The second constructor works like the first, and uses its second argument to change the stream's attribute to the new aspect_type value given.
+
+ explicit timezone_io_saver(state_type &s, aspect_type new_value);
+
+__effects Constructs a __timezone_io_saver by storing `s`.
+
+
+[endsect]
+
+[section:d Destructor `~timezone_io_saver()`]
+
+The destructor restores the stream's attribute to the saved value.
+
+ ~timezone_io_saver();
+
+__effects As if __timezone_io_saver__restore().
+
+[endsect]
+[section:restore Member Function `restore()`]
+
+The restoration can be activated early (and often) with the restore member function.
+
+ void restore();
+
+__effects Restores the stream's __timezone attribute to the saved value.
+
+[endsect]
+
+
+[endsect]
+
+[section:time_fmt_io_saver Template Class `time_fmt_io_saver<>`]
+
+ template<typename CharT = char, typename Traits = std::char_traits<CharT> >
+ struct __time_fmt_io_saver
+ {
+ typedef std::basic_ios<CharT, Traits> state_type;
+
+ explicit __time_fmt_io_saver__c1(state_type &s);
+ __time_fmt_io_saver__c2(state_type &s, basic_string<CharT> const& new_value);
+ __time_fmt_io_saver__d();
+ void __time_fmt_io_saver__restore();
+ };
+
+
+The `state_type` is a version of the IOStreams base class template `std::basic_ios<CharT, Traits>`, where `CharT` is a character type and `Traits` is a character traits class. The user would usually place an actual input, output, or combined stream object for the state-type parameter, and not a base class object.
+
+[section:c1 Constructor `time_fmt_io_saver(state_type&)`]
+
+The first constructor takes a stream object and saves a reference to the stream and the current value of a particular stream attribute.
+
+ explicit time_fmt_io_saver(state_type &s);
+
+__effects Constructs a __time_fmt_io_saver by storing `s`.
+
+[endsect]
+
+[section:c2 Constructor `time_fmt_io_saver(state_type, aspect_type)`]
+
+The second constructor works like the first, and uses its second argument to change the stream's attribute to the new aspect_type value given.
+
+ explicit time_fmt_io_saver(state_type &s, aspect_type new_value);
+
+__effects Constructs a __time_fmt_io_saver by storing `s`.
+
+
+[endsect]
+
+[section:d Destructor `~time_fmt_io_saver()`]
+
+The destructor restores the stream's attribute to the saved value.
+
+ ~time_fmt_io_saver();
+
+__effects As if __time_fmt_io_saver__restore().
+
+[endsect]
+[section:restore Member Function `restore()`]
+
+The restoration can be activated early (and often) with the restore member function.
+
+ void restore();
+
+__effects Restores the stream's time format attribute to the saved value.
+
+[endsect]
+
+[endsect]
[endsect]
[endsect] [/section:ios_state_hpp Header `<boost/chrono/io/ios_sate.hpp>`]
@@ -4282,7 +4481,7 @@
namespace chrono {
template <class CharT, class InputIterator = std::istreambuf_iterator<CharT> >
- class duration_get;
+ class __duration_get;
}
}
@@ -4297,10 +4496,10 @@
typedef std::basic_string<CharT> string_type; // Type of character string passed to member functions.
typedef InputIterator iter_type; // Type of iterator used to scan the character buffer.
- explicit duration_get(size_t refs = 0);
+ explicit __duration_get_c(size_t refs = 0);
template <typename Rep, typename Period>
- iter_type get(
+ iter_type __duration_get_get(
iter_type s,
iter_type end,
std::ios_base& ios,
@@ -4311,7 +4510,7 @@
) const;
template <typename Rep, typename Period>
- iter_type get(
+ iter_type __duration_get_get2(
iter_type s,
iter_type end,
std::ios_base& ios,
@@ -4320,7 +4519,7 @@
) const;
template <typename Rep>
- iter_type get_value(
+ iter_type __duration_get_get_value(
iter_type s,
iter_type end,
std::ios_base& ios,
@@ -4328,7 +4527,7 @@
Rep& r
) const;
- iter_type get_unit(
+ iter_type __duration_get_get_unit(
iter_type i,
iter_type e,
std::ios_base& is,
@@ -4338,17 +4537,9 @@
static std::locale::id id; // Unique identifier for this type of facet.
- ~duration_get()
+ __duration_get_d()
{
}
-
- protected:
-
- virtual iter_type do_get_n_d_prefix_unit(duration_units<CharT> const &facet, iter_type i, iter_type e,
- std::ios_base&, std::ios_base::iostate& err) const;
-
- virtual iter_type do_get_prefix_unit(duration_units<CharT> const &facet, iter_type i, iter_type e,
- std::ios_base&, std::ios_base::iostate& err, detail::rt_ratio &rt) const;
};
@@ -4391,7 +4582,7 @@
[endsect]
[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
-[section:g1 Template Member Function `get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&,const char_type*, const char_type*) const`]
+[section:get Template Member Function `get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&,const char_type*, const char_type*) const`]
template <typename Rep, typename Period>
iter_type get(iter_type s, iter_type end, std::ios_base& ios, std::ios_base::iostate& err,
@@ -4466,7 +4657,7 @@
[endsect]
[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
-[section:g2 Template Member Function `get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&) const`]
+[section:get2 Template Member Function `get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&) const`]
template <typename Rep, typename Period>
iter_type get(
@@ -4552,10 +4743,7 @@
__returns `i`, an iterator pointing just beyond the last character that can be determined to be part of a valid duration unit.
[endsect]
-
-
-
-
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
[section:do_get_n_d_prefix_unit Protected Member Function `do_get_n_d_prefix_unit(duration_units<CharT> const&,iter_type,iter_type,std::ios_base&,std::ios_base::iostate&) const`]
virtual iter_type do_get_n_d_prefix_unit(
@@ -4586,7 +4774,7 @@
__returns `s`, an iterator pointing just beyond the last character that can be determined to be part of a valid name.
[endsect]
-
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
[section:do_get_prefix_unit Protected Member Function `do_get_prefix_unit(duration_units<CharT> const&,iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,detail::rt_ratio&) const`]
virtual iter_type do_get_prefix_unit(
@@ -4618,6 +4806,7 @@
__returns `s`, an iterator pointing just beyond the last character that can be determined to be part of a valid name.
[endsect]
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
[endsect]
@@ -4630,253 +4819,1493 @@
namespace boost {
namespace chrono {
-
+ template <class CharT, class OutputIterator = std::ostreambuf_iterator<CharT> >
+ class __duration_put;
+
}
}
+
+[section:duration_put Template Class `duration_put`]
+
+ template <class CharT, class OutputIterator = std::ostreambuf_iterator<CharT> >
+ class duration_put: public std::locale::facet
+ {
+ public:
+ typedef CharT char_type; // Type of character the facet is instantiated on.
+ typedef std::basic_string<CharT> string_type; // Type of character string passed to member functions.
+ typedef OutputIterator iter_type; // Type of iterator used to write in the character buffer.
-[endsect] [/section:duration_put_hpp]
-
-[/==================================================================]
-[section:duration_units_hpp Header `<boost/chrono/io/duration_units.hpp>`]
-[/==================================================================]
+ explicit __duration_put_c(size_t refs = 0);
+
+ template <typename Rep, typename Period>
+ iter_type __duration_put_put(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d, const CharT* pattern,
+ const CharT* pat_end) const;
+
+ template <typename Rep, typename Period>
+ iter_type __duration_put_put2(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
- namespace boost {
- namespace chrono {
+ template <typename Rep, typename Period>
+ iter_type __duration_put_put_value(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
+ template <typename Rep, typename Period>
+ iter_type __duration_put_put_unit(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
- }
- }
-[endsect] [/section:duration_units_hpp]
+ static std::locale::id id; // Unique identifier for this type of facet.
-[/==================================================================]
-[section:duration_io_hpp Header `<boost/chrono/io/duration_io.hpp>`]
-[/==================================================================]
+ __duration_put_d();
+ };
- namespace boost {
- namespace chrono {
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
+[section:c Constructor `duration_put(size_t)`]
- // manipulators
+ explicit duration_put(size_t refs);
- std::ios_base& __symbol_format(ios_base& ios);
- std::ios_base& __name_format(ios_base& ios);
- class __duration_fmt;
- template<class CharT, class Traits>
- std::basic_ostream<CharT, Traits>&
- __duration_fmt__op_out(std::basic_ostream<CharT, Traits>& os, duration_fmt d);
+Constructs a __duration_put facet.
- template<class CharT, class Traits>
- std::basic_istream<CharT, Traits>&
- __duration_fmt__op_in(std::basic_istream<CharT, Traits>& is, duration_fmt d);
+__params
+* [param refs] references
- // duration I/O
+__effects Constructs a __duration_put facet.
+If the `refs` argument is `0` then destruction of the object is
+delegated to the locale, or locales, containing it. This allows
+the user to ignore lifetime management issues. On the other had,
+if `refs` is `1` then the object must be explicitly deleted;
+`locale` will not do so. In this case, the object can be
+maintained across the lifetime of multiple locales.
- template <class CharT, class Traits, class Rep, class Period>
- std::basic_ostream<CharT, Traits>&
- __duration__op_out(std::basic_ostream<CharT, Traits>& os, const __duration<Rep, Period>& d);
+[endsect]
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
+[section:d Destructor `~duration_put()`]
- template <class CharT, class Traits, class Rep, class Period>
- std::basic_istream<CharT, Traits>&
- __duration__op_in(std::basic_istream<CharT, Traits>& is, __duration<Rep, Period>& d)
+ ~duration_put();
- }
- }
+Destructs a __duration_put facet.
+[endsect]
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
+[section:put Member Function `put(iter_type,std::ios_base&,char_type,duration<Rep,Period> const&, const CharT*,const CharT*)`]
-[section:manipulators I/O Manipulators]
+ template <typename Rep, typename Period>
+ iter_type put(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d, const CharT* pattern,
+ const CharT* pat_end) const;
-There is a parameterized manimulator that takes the duration_style as parameter.
-The symbol or name format can be easily chosen by streaming a `symbol_format` or `name_format` manipulators respectively.
+__params
-[section:duration_fmt Template Class `duration_fmt`]
+* [param s] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param d] the duration
+* [param pattern] begin of the formatting pattern
+* [param pat_end] end of the formatting pattern
- class duration_fmt
- {
- public:
+__effects Steps through the sequence from `pattern` to `pat_end`,
+identifying characters that are part of a pattern sequence. Each character
+that is not part of a pattern sequence is written to `s` immediately, and
+each pattern sequence, as it is identified, results in a call to `put_value` or `put_unit`;
+thus, pattern elements and other characters are interleaved in the output
+in the order in which they appear in the pattern. Pattern sequences are
+identified by converting each character `c` to a `char` value as if by
+`ct.narrow(c,0)`, where `ct` is a reference to `ctype<charT>` obtained from
+`ios.getloc()`. The first character of each sequence is equal to `'%'`,
+followed by a pattern specifier character specifier, which can be `'v'` for
+the duration value or `'u'` for the duration unit. .
+For each valid pattern sequence identified, calls
+`put_value(s, ios, d)` or `put_unit(s, ios, d)`.
- explicit __duration_fmt__c1(__duration_style style) BOOST_CHRONO_NOEXCEPT;
+__returns An iterator pointing immediately after the last character produced.
- #ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
- explicit
- __duration_fmt__op_duration_style() const BOOST_CHRONO_NOEXCEPT;
- #endif
- __duration_style __duration_fmt__get_duration_style() const BOOST_CHRONO_NOEXCEPT;
- };
- template<class CharT, class Traits>
- std::basic_ostream<CharT, Traits>&
- __duration_fmt__op_out(std::basic_ostream<CharT, Traits>& os, duration_fmt d);
+[endsect]
+[section:put2 Member Function `put(iter_type,std::ios_base&,char_type fill, duration<Rep, Period> const&)`]
- template<class CharT, class Traits>
- std::basic_istream<CharT, Traits>&
- __duration_fmt__op_in(std::basic_istream<CharT, Traits>& is, duration_fmt d);
+ template <typename Rep, typename Period>
+ iter_type put(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
+__params
-[section:c1 Constructor `duration_fmt(duration_style_type)`]
+* [param s] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param d] the duration
- explicit duration_fmt(duration_style_type f) noexcept;
+Retrieves Stores the duration pattern from the __duration_unit facet in let say `str`. Last as if
-__effects Constructs a __duration_fmt by storing `f`.
+ return put(s, ios, d, str.data(), str.data() + str.size());
-__postcondition `static_cast<duration_style>(*this) == f`.
+__returns An iterator pointing immediately after the last character produced.
[endsect]
-[section:op_duration_style Member Function `operator duration_style()`]
+[section:put_value Member Function `put_value(iter_type, std::ios_base&, char_type, duration<Rep,Period> const&)`]
- explicit operator duration_style() const noexcept;
+ template <typename Rep, typename Period>
+ iter_type put_value(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
+
+__params
+
+* [param s] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param d] the duration
+
+__effects As if std::use_facet<std::num_put<CharT, iter_type> >(ios.getloc()).put(s, ios, ' ', static_cast<long int> (d.count())).
+
+__returns An iterator pointing immediately after the last character produced.
+
+[endsect]
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
+[section:put_unit Member Function `put_unit(iter_type,std::ios_base&,char_type,duration<Rep, Period> const&)`]
+
+ template <typename Rep, typename Period>
+ iter_type put_unit(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
+
+__params
+
+* [param s] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param fill] the fill character
+* [param d] the duration
+
+__effects Let `facet` be the `duration_units<CharT>` facet associated to `ios`. If the associated unit is named, as if
+
+ string_type str = facet.get_unit(get_duration_style(ios), d);
+ s=std::copy(str.begin(), str.end(), s);
+
+Otherwise, format the unit as `"[Period::num/Period::den]"` followed by the unit associated to [N/D] obtained using `facet.get_n_d_unit(get_duration_style(ios), d)`.
+
+__returns s, iterator pointing immediately after the last character produced.
+
+[endsect]
+[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
+[endsect]
+
+[endsect] [/section:duration_put_hpp]
+
+[/==================================================================]
+[section:duration_units_hpp Header `<boost/chrono/io/duration_units.hpp>`]
+[/==================================================================]
+
+ namespace boost {
+ namespace chrono {
+ class rt_ratio;
+ template <typename CharT = char>
+ class duration_units;
+
+ }
+ }
+
+
+[section:rt_ratio Class `rt_ratio`]
+
+ class rt_ratio
+ {
+ public:
+ template <typename Period>
+ rt_ratio(Period const&) :
+ num(Period::type::num), den(Period::type::den)
+ {
+ }
+
+ rt_ratio(intmax_t n = 0, intmax_t d = 1) :
+ num(n), den(d)
+ {
+ }
+
+ intmax_t num;
+ intmax_t den;
+ };
+
+[endsect]
+[section:duration_units Template Class `duration_units`]
+
+ template <typename CharT = char>
+ class duration_units: public std::locale::facet
+ {
+ public:
+ typedef CharT char_type; // Type of character the facet is instantiated on.
+ typedef std::basic_string<CharT> string_type; // Type of character string passed to member functions.
+ static std::locale::id id; // Unique identifier for this type of facet.
+
+ explicit __duration_units_c(size_t refs = 0);
+ virtual const string_type* __duration_units_get_n_d_valid_units_start() const =0;
+ virtual const string_type* __duration_units_get_n_d_valid_units_end() const=0;
+ virtual const string_type* __duration_units_get_valid_units_start() const=0;
+ virtual const string_type* __duration_units_get_valid_units_end() const=0;
+ virtual bool __duration_units_match_n_d_valid_unit(const string_type* k) const = 0;
+ virtual bool __duration_units_match_valid_unit(const string_type* k, rt_ratio& rt) const = 0;
+ virtual string_type __duration_units_get_pattern() const=0;
+ template <typename Rep, typename Period>
+ string_type __duration_units_get_unit(duration_style::type style, duration<Rep, Period> const& d) const;
+ template <typename Rep, typename Period>
+ string_type __duration_units_get_n_d_unit(duration_style::type style, duration<Rep, Period> const& d) const;
+ template <typename Period>
+ bool __duration_units_is_named_unit() const;
+
+ protected:
+ virtual __duration_units_d();
+ virtual string_type __duration_units_do_get_n_d_unit(duration_style::type style, rt_ratio rt, intmax_t v) const = 0;
+ virtual string_type __duration_units_do_get_unit(duration_style::type style,rt_ratio rt, intmax_t v) const = 0;
+ virtual bool __duration_units_do_is_named_unit(rt_ratio rt) const =0;
+ };
+
+__duration_units facet gives useful information about the duration units,
+as the number of plural forms, the plural form associated to a duration,
+the text associated to a plural form and a duration's period,
+
+[section:c Constructor `duration_units()`]
+
+ explicit duration_units(size_t refs = 0);
+
+Construct a __duration_units facet.
+
+__params
+
+* [param refs] references
+
+__effects Construct a __duration_units facet.
+If the `refs` argument is `0` then destruction of the object is
+delegated to the locale, or locales, containing it. This allows
+the user to ignore lifetime management issues. On the other had,
+if `refs` is `1` then the object must be explicitly deleted;
+the locale will not do so. In this case, the object can be
+maintained across the lifetime of multiple locales.
+
+[endsect]
+[section:d Destructor `~duration_units()`]
+
+ virtual ~duration_units();
+
+__effects Destroys the facet.
+
+[endsect]
+[section:get_n_d_valid_units_start Member Function `get_n_d_valid_units_start()`]
+
+ virtual const string_type* get_n_d_valid_units_start() const =0;
+
+__returns pointer to the start of valid [N/D] units.
+
+
+[endsect]
+[section:get_n_d_valid_units_end Member Function `get_n_d_valid_units_end()`]
+
+ virtual const string_type* get_n_d_valid_units_end() const=0;
+
+__returns pointer to the end of valid [N/D] units.
+
+[endsect]
+[section:get_valid_units_start Member Function `get_valid_units_start()`]
+
+ virtual const string_type* get_valid_units_start() const=0;
+
+__returns pointer to the start of valid units, symbol or prefix with its different plural forms.
+
+[endsect]
+[section:get_valid_units_end Member Function `get_valid_units_end()`]
+
+ virtual const string_type* get_valid_units_end() const=0;
+
+__returns pointer to the end of valid units.
+
+[endsect]
+[section:match_n_d_valid_unit Member Function `match_n_d_valid_unit(const string_type*)`]
+
+ virtual bool match_n_d_valid_unit(const string_type* k) const = 0;
+
+__params
+
+* [param k] the found pointer to the [N/D] unit.
+
+__returns `true` if `k` matches a valid unit.
+
+[endsect]
+[section:match_valid_unit Member Function `match_valid_unit(const string_type*,rt_ratio&)`]
+
+ virtual bool match_valid_unit(const string_type* k, rt_ratio& rt) const = 0;
+
+__params
+
+* [param k] the found pointer to the unit.
+
+__effects `rt` is set to the valid Period when the `k` matches a valid unit.
+__returns `true` if `k` matches a valid unit.
+
+[endsect]
+[section:get_pattern Member Function `get_pattern()`]
+
+ virtual string_type get_pattern() const=0;
+
+__returns the pattern to be used by default.
+
+[endsect]
+[section:get_unit Template Member Function `get_unit(duration_style::type,duration<Rep,Period> const&)`]
+
+ template <typename Rep, typename Period>
+ string_type get_unit(duration_style::type style, duration<Rep, Period> const& d) const;
+
+
+__returns `get_unit(style, d.count(), rt_ratio(Period()))`, the unit associated to this duration.
+
+[endsect]
+
+[section:get_n_d_unit Template Member Function `get_n_d_unit(duration_style::type,duration<Rep,Period> const&)`]
+
+ template <typename Rep, typename Period>
+ string_type get_n_d_unit(duration_style::type style, duration<Rep, Period> const& d) const;
+
+__returns get_n_d_unit(style, d.count(), rt_ratio(Period())), i.e. the [N/D] suffix unit associated to this duration.
+
+[endsect]
+
+[section:is_named_unit Template Member Function `is_named_unit()`]
+
+ template <typename Period>
+ bool is_named_unit() const;
+
+__returns `do_is_named_unit(rt_ratio(Period()))`, true if the unit associated to the given Period is named, false otherwise.
+
+[endsect]
+
+[section:do_get_n_d_unit Protected Member Function `do_get_n_d_unit(duration_style::type,rt_ratio,intmax_t)`]
+
+ virtual string_type do_get_n_d_unit(duration_style::type style, rt_ratio rt, intmax_t v) const = 0;
+
+__returns the [N/D] suffix unit associated to this duration.
+
+[endsect]
+
+[section:do_get_unit Protected Member Function `do_get_unit(duration_style::type,rt_ratio,intmax_t)`]
+
+ virtual string_type do_get_unit(duration_style::type style,rt_ratio rt, intmax_t v) const = 0;
+
+__returns the unit associated to this duration.
+
+[endsect]
+
+[section:do_is_named_unit Protected Member Function `do_is_named_unit(rt_ratio)`]
+
+ virtual bool do_is_named_unit(rt_ratio rt) const =0;
+
+__returns true if the unit associated to the given Period is named, false otherwise.
+
+[endsect]
+
+[endsect] [/section:duration_units]
+
+[section:duration_units_default Template Class `duration_units_default`]
+
+ template <typename CharT = char>
+ class duration_units_default: public duration_units<CharT>
+ {
+ protected:
+ static const std::size_t pfs_ = 2; // The defaul English facet has two plural forms.
+
+ public:
+ typedef CharT char_type;
+ typedef std::basic_string<CharT> string_type;
+
+ explicit duration_units_default(size_t refs = 0);
+ ~duration_units_default();
+
+ bool match_n_d_valid_unit(const string_type* k) const;
+ bool match_valid_unit(const string_type* k, rt_ratio& rt) const;
+ const string_type* get_n_d_valid_units_start()const;
+ const string_type* get_n_d_valid_units_end()const;
+ string_type* get_valid_units_start() const;
+ string_type* get_valid_units_end() const;
+ string_type get_pattern() const;
+ protected:
+ bool do_is_named_unit(rt_ratio rt) const;
+ string_type do_get_n_d_unit(duration_style::type style, rt_ratio, intmax_t v) const;
+ string_type do_get_unit(duration_style::type style, rt_ratio rt, intmax_t v) const;
+
+ virtual std::size_t do_get_plural_forms() const;
+ virtual std::size_t do_get_plural_form(int_least64_t value) const;
+
+ virtual string_type do_get_unit(duration_style_type style, ratio<1> u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, ratio<60> u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, ratio<3600> u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, atto u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, femto u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, pico u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, nano u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, micro u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, milli u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, centi u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, deci u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, deca u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, hecto u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, kilo u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, mega u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, giga u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, tera u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, peta u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, exa u, std::size_t pf) const;
+
+ virtual string_type do_get_ratio_prefix(duration_style_type style, atto u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, femto u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, pico u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, nano u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, micro u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, milli u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, centi u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, deci u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, deca u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, hecto u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, kilo u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, mega u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, giga u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, tera u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, peta u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, exa u) const;
+ };
+
+This class is used to define the strings for the default English.
+This facet names the units associated to the following periods:
+
+* __atto,
+* __femto,
+* __pico,
+* __nano,
+* __micro,
+* __milli,
+* __centi,
+* __deci,
+* ratio<1>,
+* __deca,
+* __hecto,
+* __kilo,
+* __mega,
+* __giga,
+* __tera,
+* __peta,
+* __exa,
+* ratio<60> and
+* ratio<3600>.
+
+
+[section:c Constructor `duration_units_default()`]
+
+ explicit duration_units_default(size_t refs = 0);
+
+Construct a duration_units_default facet.
+
+__params
+
+* [param refs] references
+
+__effects Construct a duration_units_default facet.
+If the `refs` argument is `0` then destruction of the object is
+delegated to the locale, or locales, containing it. This allows
+the user to ignore lifetime management issues. On the other had,
+if `refs` is `1` then the object must be explicitly deleted;
+the locale will not do so. In this case, the object can be
+maintained across the lifetime of multiple locales.
+
+[endsect]
+[section:d Destructor `~duration_units_default()`]
+
+ virtual ~duration_units_default();
+
+__effects Destroys the facet.
+
+[endsect]
+[section:get_n_d_valid_units_start Member Function `get_n_d_valid_units_start()`]
+
+ virtual const string_type* get_n_d_valid_units_start() const;
+
+__returns pointer to the start of valid [N/D] units.
+
+
+[endsect]
+[section:get_n_d_valid_units_end Member Function `get_n_d_valid_units_end()`]
+
+ virtual const string_type* get_n_d_valid_units_end() const;
+
+__returns pointer to the end of valid [N/D] units.
+
+[endsect]
+[section:get_valid_units_start Member Function `get_valid_units_start()`]
+
+ virtual const string_type* get_valid_units_start() const;
+
+__returns pointer to the start of valid units, symbol or prefix with its different plural forms.
+
+[endsect]
+[section:get_valid_units_end Member Function `get_valid_units_end()`]
+
+ virtual const string_type* get_valid_units_end() const;
+
+__returns pointer to the end of valid units.
+
+[endsect]
+[section:match_n_d_valid_unit Member Function `match_n_d_valid_unit(const string_type*)`]
+
+ virtual bool match_n_d_valid_unit(const string_type* k) const;
+
+__params
+
+* [param k] the found pointer to the [N/D] unit.
+
+__returns `true` if `k` matches a valid unit.
+
+[endsect]
+[section:match_valid_unit Member Function `match_valid_unit(const string_type*,rt_ratio&)`]
+
+ virtual bool match_valid_unit(const string_type* k, rt_ratio& rt) const;
+
+__params
+
+* [param k] the found pointer to the unit.
+
+__effects `rt` is set to the valid Period when the `k` matches a valid unit.
+__returns `true` if `k` matches a valid unit.
+
+[endsect]
+[section:get_pattern Member Function `get_pattern()`]
+
+ virtual string_type get_pattern() const;
+
+__returns the pattern to be used by default.
+
+[endsect]
+
+[section:do_get_n_d_unit Protected Member Function `do_get_n_d_unit(duration_style::type,rt_ratio,intmax_t)`]
+
+ virtual string_type do_get_n_d_unit(duration_style::type style, rt_ratio rt, intmax_t v) const;
+
+__returns the [N/D] suffix unit associated to this duration.
+
+[endsect]
+
+[section:do_get_unit Protected Member Function `do_get_unit(duration_style::type,rt_ratio,intmax_t)`]
+
+ virtual string_type do_get_unit(duration_style::type style,rt_ratio rt, intmax_t v) const;
+
+__returns the unit associated to this duration.
+
+[endsect]
+
+[section:do_is_named_unit Protected Member Function `do_is_named_unit(rt_ratio)`]
+
+ virtual bool do_is_named_unit(rt_ratio rt) const;
+
+__returns true if the unit associated to the given Period is named, false otherwise.
+
+[endsect]
+
+[section:do_get_plural_forms Protected Member Function `do_get_plural_forms()`]
+
+ virtual std::size_t do_get_plural_forms() const;
+
+__returns the number of associated plural forms this facet manages.
+
+[endsect]
+
+[section:do_get_plural_form Protected Member Function `do_get_plural_form(int_least64_t)`]
+
+ virtual std::size_t do_get_plural_form(int_least64_t value) const;
+
+Gets the associated plural form.
+
+__params
+
+[param value] the duration representation
+
+__returns the plural form associated to the `value` parameter. In English there are 2 plural forms
+
+* 0 singular (-1 or 1)
+* 1 plural for all others
+
+[endsect]
+
+[section:do_get_unit_seconds Protected Member Function `do_get_unit(duration_style_type,ratio<1>,std::size_t)`]
+
+ virtual string_type do_get_unit(duration_style_type style, ratio<1> u, std::size_t pf) const;
+
+__params
+
+* [param style] the duration style.
+* [param period] the period associated to the duration hours.
+* [param pf] the requested plural form.
+
+__returns if style is symbol returns "s", otherwise if pf is 0 return "second", if pf is 1 "seconds"
+
+[endsect]
+
+[section:do_get_unit_minutes Protected Member Function `do_get_unit(duration_style_type style,ratio<60>,std::size_t)`]
+
+ virtual string_type do_get_unit(duration_style_type style, ratio<60> u, std::size_t pf) const;
+
+__params
+
+* [param style] the duration style.
+* [param period] the period associated to the duration hours.
+* [param pf] the requested plural form.
+
+__returns if style is symbol returns "min", otherwise if pf is 0 return "minute", if pf is 1 "minutes"
+
+[endsect]
+
+[section:do_get_unit_hours Protected Member Function `do_get_unit(duration_style_type,ratio<3600>,std::size_t)`]
+
+ virtual string_type do_get_unit(duration_style_type style, ratio<3600> u, std::size_t pf) const;
+
+__params
+
+* [param style] the duration style.
+* [param period] the period associated to the duration hours.
+* [param pf] the requested plural form.
+
+__returns if style is symbol returns "h", otherwise if pf is 0 return "hour", if pf is 1 "hours"
+
+[endsect]
+
+[section:do_get_unit_xxx Protected Member Function `do_get_unit(duration_style_type,Period,std::size_t)`]
+
+ virtual string_type do_get_unit(duration_style_type style, atto u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, femto u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, pico u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, nano u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, micro u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, milli u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, centi u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, deci u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, deca u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, hecto u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, kilo u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, mega u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, giga u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, tera u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, peta u, std::size_t pf) const;
+ virtual string_type do_get_unit(duration_style_type style, exa u, std::size_t pf) const;
+
+__params
+
+* [param style] the duration style.
+* [param u] the period tag atto.
+* [param pf] the requested plural form.
+
+__returns the concatenation of the prefix associated to period `u` + the one associated to seconds.
+
+[endsect]
+
+[section:do_get_ratio_prefix_xxx Protected Member Function `do_get_ratio_prefix(duration_style_type, Period)`]
+
+ virtual string_type do_get_ratio_prefix(duration_style_type style, atto u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, femto u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, pico u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, nano u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, micro u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, milli u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, centi u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, deci u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, deca u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, hecto u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, kilo u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, mega u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, giga u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, tera u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, peta u) const;
+ virtual string_type do_get_ratio_prefix(duration_style_type style, exa u) const;
+
+__params
+
+* [param style] the duration style.
+* [param u] the period tag atto.
+
+__returns depending on the value of `style` return the ratio_string symbol or prefix.
+
+[endsect]
+
+
+[endsect] [/section:duration_units_default]
+
+[endsect] [/section:duration_units_hpp]
+
+[/==================================================================]
+[section:duration_io_hpp Header `<boost/chrono/io/duration_io.hpp>`]
+[/==================================================================]
+
+ namespace boost {
+ namespace chrono {
+
+ // manipulators
+
+ std::ios_base& __symbol_format(ios_base& ios);
+ std::ios_base& __name_format(ios_base& ios);
+ class __duration_fmt;
+ template<class CharT, class Traits>
+ std::basic_ostream<CharT, Traits>&
+ __duration_fmt__op_out(std::basic_ostream<CharT, Traits>& os, duration_fmt d);
+
+ template<class CharT, class Traits>
+ std::basic_istream<CharT, Traits>&
+ __duration_fmt__op_in(std::basic_istream<CharT, Traits>& is, duration_fmt d);
+
+
+ // duration I/O
+
+ template <class CharT, class Traits, class Rep, class Period>
+ std::basic_ostream<CharT, Traits>&
+ __duration__op_out(std::basic_ostream<CharT, Traits>& os, const __duration<Rep, Period>& d);
+
+ template <class CharT, class Traits, class Rep, class Period>
+ std::basic_istream<CharT, Traits>&
+ __duration__op_in(std::basic_istream<CharT, Traits>& is, __duration<Rep, Period>& d)
+
+ }
+ }
+
+
+[section:manipulators I/O Manipulators]
+
+There is a parameterized manimulator that takes the duration_style as parameter.
+The symbol or name format can be easily chosen by streaming a `symbol_format` or `name_format` manipulators respectively.
+
+[section:duration_fmt Template Class `duration_fmt`]
+
+ class duration_fmt
+ {
+ public:
+
+ explicit __duration_fmt__c1(__duration_style style) noexcept;
+
+ #ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+ explicit
+ __duration_fmt__op_duration_style() const noexcept;
+ #endif
+ __duration_style __duration_fmt__get_duration_style() const noexcept;
+ };
+
+ template<class CharT, class Traits>
+ std::basic_ostream<CharT, Traits>&
+ __duration_fmt__op_out(std::basic_ostream<CharT, Traits>& os, duration_fmt d);
+
+ template<class CharT, class Traits>
+ std::basic_istream<CharT, Traits>&
+ __duration_fmt__op_in(std::basic_istream<CharT, Traits>& is, duration_fmt d);
+
+
+[section:c1 Constructor `duration_fmt(duration_style_type)`]
+
+ explicit duration_fmt(duration_style_type f) noexcept;
+
+__effects Constructs a __duration_fmt by storing `f`.
+
+__postcondition `static_cast<duration_style>(*this) == f`.
+
+[endsect]
+[section:op_duration_style Member Function `operator duration_style()`]
+
+ explicit operator duration_style() const noexcept;
duration_style_type get_duration_style() const noexcept;
-__returns: The stored __duration_fmt `f`.
+__returns: The stored __duration_fmt `f`.
+
+[endsect]
+[section:op_out Member Function `operator <<(basic_ostream<>&, duration_fmt)`]
+
+ template<class CharT, class Traits>
+ basic_ostream<CharT, Traits>&
+ operator<<(basic_ostream<CharT, Traits>& s, duration_fmt d);
+
+__effects: `__set_duration_style(s, static_cast<__duration_style>(d))))`.
+
+__returns: `s`.
+
+[endsect]
+[section:op_in Member Function `operator >>(basic_istream<>&, duration_fmt)`]
+
+ template<class CharT, class Traits>
+ basic_istream<CharT, Traits>&
+ operator>>(basic_istream<CharT, Traits>& s, duration_fmt d);
+
+__effects: `__set_duration_style(s, static_cast<__duration_style>(d))))`.
+
+__returns: `s`.
+
+[endsect]
+[endsect]
+
+[section:symbol_format Non Member Function `symbol_format(ios_base&)`]
+
+ std::ios_base& __symbol_format(ios_base& ios);
+
+__effects: `__set_duration_style(s, __duration_style::symbol)`.
+
+__returns `ios`
+
+[endsect]
+[section:name_format Non Member Function `name_format(ios_base&)`]
+
+ std::ios_base& __name_format(ios_base& ios);
+
+__effects: `__set_duration_style(s, __duration_style::prefix)`.
+
+__returns `ios`
+
+
+[endsect]
+[endsect]
+
+
+[section:streams I/O Streams Operations]
+
+[section:duration__op_out Member Function `operator <<(basic_ostream<>&, const duration<>& d)`]
+
+Any __duration can be streamed out to a `basic_ostream`.
+The run-time value of the __duration is formatted according to the rules and current format settings for __duration`::rep` and the __duration_units facet.
+
+
+ template <class CharT, class Traits, class Rep, class Period>
+ std::basic_ostream<CharT, Traits>&
+ operator<<(std::basic_ostream<CharT, Traits>& os, const duration<Rep, Period>& d);
+
+__effects Behaves as a formatted output function.
+After constructing a sentry object, if the sentry converts to true,
+calls to `facet.__duration_put_put(os,os,os.fill(),d)` where `facet` is the `__duration_put<CharT>`
+facet associated to `os` or a new created instance of the default `__duration_put<CharT>` facet.
+
+__returns `os`.
+
+[endsect]
+[section:duration__op_in Member Function `operator <<(basic_istream<>&, const duration<>& d)`]
+
+ template <class CharT, class Traits, class Rep, class Period>
+ std::basic_istream<CharT, Traits>&
+ operator>>(std::basic_istream<CharT, Traits>& is, duration<Rep, Period>& d)
+
+__effects Behaves as a formatted input function. After constructing a `sentry` object, if the `sentry`
+converts to `true`, calls to `facet.__duration_get_get(is,std::istreambuf_iterator<CharT, Traits>(), is, err, d)` where `facet` is the `__duration_get<CharT>`
+facet associated to `is` or a new created instance of the default `__duration_get<CharT>` facet.
+
+If any step fails, calls `os.setstate(std::ios_base::failbit | std::ios_base::badbit)`.
+
+__returns `is`
+[endsect]
+
+[endsect]
+
+
+[endsect] [/section:duration_io_hpp Header `<boost/chrono/io/duration_io.hpp>`]
+
+[/==================================================================]
+[section:time_point_get_hpp Header `<boost/chrono/io/time_point_get.hpp>`]
+[/==================================================================]
+
+ namespace boost {
+ namespace chrono {
+ template <class CharT, class InputIterator = std::istreambuf_iterator<CharT> >
+ class time_point_get;
+ }
+ }
+
+[section:time_point_get Template Class `time_point_get`]
+
+ template <class CharT, class InputIterator = std::istreambuf_iterator<CharT> >
+ class time_point_get: public std::locale::facet
+ {
+ public:
+ typedef CharT char_type; // Type of character the facet is instantiated on.
+ typedef InputIterator iter_type; // Type of iterator used to scan the character buffer.
+
+ explicit __time_point_get_c(size_t refs = 0);
+
+ template <class Clock, class Duration>
+ iter_type __time_point_get_get(iter_type i, iter_type e, std::ios_base& is, std::ios_base::iostate& err,
+ time_point<Clock, Duration> &tp, const char_type *pattern, const char_type *pat_end) const;
+
+ template <class Clock, class Duration>
+ iter_type __time_point_get_get2(iter_type i, iter_type e, std::ios_base& is, std::ios_base::iostate& err,
+ time_point<Clock, Duration> &tp) const;
+
+ template <typename Rep, typename Period>
+ iter_type __time_point_get_get_duration(iter_type i, iter_type e, std::ios_base& is, std::ios_base::iostate& err,
+ duration<Rep, Period>& d) const;
+
+ template <class Clock>
+ iter_type __time_point_get_get_epoch(iter_type i, iter_type e, std::ios_base& is, std::ios_base::iostate& err) const;
+
+ static std::locale::id id; // Unique identifier for this type of facet.
+
+ __time_point_get_d();
+ };
+
+
+`time_point_get` is used to parse a character sequence, extracting
+the duration and the epoch into a class `time_point`.
+
+The pattern can contain the format specifiers `%d` and `%e` in any order.
+
+User confirmation is required for reliable parsing of
+user-entered durations, but machine-generated formats can be parsed
+reliably. This allows parsers to be aggressive about interpreting user
+variations on standard formats.
+
+If the end iterator is reached during parsing the member function sets `std::ios_base::eofbit` in `err`.
+
+[section:c Constructor `time_point_get(size_t)`]
+
+ explicit time_point_get(size_t refs);
+
+Constructs a __time_point_get facet.
+
+__params
+
+* [param refs] references
+
+__effects Constructs a __duration_put facet.
+If the `refs` argument is `0` then destruction of the object is
+delegated to the locale, or locales, containing it. This allows
+the user to ignore lifetime management issues. On the other had,
+if `refs` is `1` then the object must be explicitly deleted;
+`locale` will not do so. In this case, the object can be
+maintained across the lifetime of multiple locales.
+
+[endsect]
+
+[section:d Destructor `~time_point_get()`]
+
+ ~time_point_get();
+
+__effects Destroy the facet.
+
+[endsect]
+[section:get Template Member Function `get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,time_point<Clock, Duration>&,const CharT*,const CharT*)`]
+
+ template <class Clock, class Duration>
+ iter_type get(iter_type s, iter_type end, std::ios_base& ios, std::ios_base::iostate& err,
+ time_point<Clock, Duration> &tp, const char_type *pattern, const char_type *pat_end) const;
+
+__params
+
+* [param s] start input stream iterator
+* [param end] end input stream iterator
+* [param ios] a reference to a `ios_base`
+* [param err] the `ios_base::iostate`
+* [param tp] the __time_point
+* [param pattern] begin of the formatting pattern
+* [param pat_end] end of the formatting pattern
+
+__requires `[pattern,pat_end)` must be a valid range.
+
+__effects: The function starts by evaluating `err = std::ios_base::goodbit`.
+It then enters a loop, reading zero or more characters from `s` at
+each iteration. Unless otherwise specified below, the loop
+terminates when the first of the following conditions holds:
+
+* The expression `pattern == pat_end` evaluates to `true`.
+* The expression `err == std::ios_base::goodbit` evaluates to `false`.
+* The expression `s == end` evaluates to `true`, in which case the
+function evaluates `err = std::ios_base::eofbit | std::ios_base::failbit`.
+* The next element of pattern is equal to `'%'`, followed by a conversion
+specifier character, the functions `get_duration` or `get_epoch` are called depending on
+whether the format is `'d'` or `'e'`.
+If the number of elements in the range `[pattern,pat_end)` is not
+sufficient to unambiguously determine whether the conversion
+specification is complete and valid, the function evaluates
+`err |= std::ios_base::failbit`. Otherwise, the function evaluates
+`s = do_get(s, end, ios, err, d)`. If `err == std::ios_base::goodbit` holds after
+the evaluation of the expression, the function increments pattern to
+point just past the end of the conversion specification and continues
+looping.
+* The expression `isspace(*pattern, ios.getloc())` evaluates to `true`, in
+which case the function first increments `pattern` until
+`pattern == pat_end || !isspace(*pattern, ios.getloc())` evaluates to `true`,
+then advances `s` until `s == end || !isspace(*s, ios.getloc())` is `true`,
+and finally resumes looping.
+* The next character read from `s` matches the element pointed to by
+pattern in a case-insensitive comparison, in which case the function
+evaluates `++pattern`, `++s` and continues looping. Otherwise, the function
+evaluates `err = std::ios_base::failbit`.
+
+__returns An iterator pointing just beyond the last character that can be determined to be part of a valid time_point.
+
+
+[endsect]
+[section:get2 Template Member Function `get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,time_point<Clock,Duration>&)`]
+
+ template <class Clock, class Duration>
+ iter_type get(iter_type s, iter_type end, std::ios_base& ios, std::ios_base::iostate& err,
+ time_point<Clock, Duration> &tp) const;
+
+__params
+
+* [param s] start input stream iterator
+* [param end] end input stream iterator
+* [param ios] a reference to a `ios_base`
+* [param err] the `ios_base::iostate`
+* [param tp] the __time_point
+
+__effects Stores the duration pattern from the `duration_unit` facet in let say `str`. Last as if
+
+ return get(s, end, ios, err, ios, d, str.data(), str.data() + str.size());
+
+__returns An iterator pointing just beyond the last character that can be determined to be part of a valid name.
+
+[endsect]
+[section:get_duration Template Member Function `get_duration(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&)`]
+
+ template <typename Rep, typename Period>
+ iter_type get_duration(iter_type s, iter_type end, std::ios_base& ios, std::ios_base::iostate& err,
+ duration<Rep, Period>& d) const;
+
+__effects As if
+
+ return facet.get(s, end, ios, err, d);
+
+where `facet` is either the `duration_get` facet associated to the `ios` or an instance of the default `duration_get` facet.
+
+__returns An iterator pointing just beyond the last character that can be determined to be part of a valid duration.
+
+[endsect]
+[section:get_epoch Template Member Function `get_epoch(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&)`]
+
+ template <class Clock>
+ iter_type get_epoch(iter_type s, iter_type end, std::ios_base& ios, std::ios_base::iostate& err) const;
+
+__effects Let `facet` be the __time_point_units facet associated to `ios` or a new instance of the default __time_point_units_default facet.
+Let `epoch` be the epoch string associated to the `Clock` using this facet.
+Scans `s` to match `epoch` or `end` is reached.
+
+If not match before the `end` is reached `std::ios_base::failbit` is set in `err`.
+If `end` is reached `std::ios_base::failbit` is set in `err`.
+
+__returns An iterator pointing just beyond the last character that can be determined to be part of a epoch.
+
+[endsect]
+
+[endsect] [/section:time_point_get]
+
+
+[endsect] [/section:time_point_get_hpp]
+
+[/==================================================================]
+[section:time_point_put_hpp Header `<boost/chrono/io/time_point_put.hpp>`]
+[/==================================================================]
+
+ namespace boost {
+ namespace chrono {
+ template <class CharT, class OutputIterator = std::ostreambuf_iterator<CharT> >
+ class time_point_put;
+ }
+ }
+
+
+[section:time_point_put Template Class `time_point_put`]
+
+
+The __time_point_put facet provides facilities for formatted output of __time_point values.
+The member function of __time_point_put take a __time_point and format it into character string representation.
+
+tparam ChatT a character type
+tparam OutputIterator a model of `OutputIterator`
+
+
+ template <class CharT, class OutputIterator = std::ostreambuf_iterator<CharT> >
+ class time_point_put: public std::locale::facet
+ {
+ public:
+ typedef CharT char_type; // Type of character the facet is instantiated on.
+ typedef std::basic_string<CharT> string_type; // Type of character string passed to member functions.
+ typedef OutputIterator iter_type; // Type of iterator used to write in the character buffer.
+
+ explicit time_point_put(size_t refs = 0);
+ ~time_point_put();
+
+ template <class Clock, class Duration>
+ iter_type put(iter_type i, std::ios_base& ios, char_type fill, time_point<Clock, Duration> const& tp, const CharT* pattern,
+ const CharT* pat_end) const;
+ template <class Clock, class Duration>
+ iter_type put(iter_type i, std::ios_base& ios, char_type fill, time_point<Clock, Duration> const& tp) const;
+ template <typename Rep, typename Period>
+ iter_type put_duration(iter_type i, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
+ template <typename Clock>
+ iter_type put_epoch(iter_type i, std::ios_base& os) const;
+
+ static std::locale::id id; // Unique identifier for this type of facet.
+
+
+ };
+
+
+[section:c Constructor `time_point_get(size_t)`]
+
+ explicit time_point_put(size_t refs = 0);
+
+
+Construct a time_point_put facet.
+
+__effects Construct a time_point_put facet.
+If the `refs` argument is `0` then destruction of the object is
+delegated to the locale, or locales, containing it. This allows
+the user to ignore lifetime management issues. On the other had,
+if `refs` is `1` then the object must be explicitly deleted;
+the locale will not do so. In this case, the object can be
+maintained across the lifetime of multiple locales.
+
+__params
+
+* [param refs] references
+
+[endsect]
+
+[section:put1 Member Function `put()`]
+
+ template <class Clock, class Duration>
+ iter_type put(iter_type i, std::ios_base& ios, char_type fill, time_point<Clock, Duration> const& tp, const CharT* pattern,
+ const CharT* pat_end) const;
+
+
+__params
+
+* [param i] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param fill] the character used as filler
+* [param tp] the __time_point
+* [param pattern] begin of the formatting pattern
+* [param pat_end] end of the formatting pattern
+
+__effects Steps through the sequence from `pattern` to `pat_end`,
+identifying characters that are part of a pattern sequence. Each character
+that is not part of a pattern sequence is written to `s` immediately, and
+each pattern sequence, as it is identified, results in a call to
+__put_duration or __put_epoch;
+thus, pattern elements and other characters are interleaved in the output
+in the order in which they appear in the pattern. Pattern sequences are
+identified by converting each character `c` to a `char` value as if by
+`ct.narrow(c,0)`, where `ct` is a reference to `ctype<charT>` obtained from
+`ios.getloc()`. The first character of each sequence is equal to `'%'`,
+followed by a pattern specifier character spec, which can be `'d'` for
+the duration value or `'e'` for the epoch.
+For each valid pattern sequence identified, calls
+`put_duration(s, ios, fill, tp.time_since_epoch())` or `put_epoch(s, ios)`.
+
+__returns An iterator pointing immediately after the last character produced.
+
+[endsect]
+
+[section:put2 Member Function `put()`]
+
+ template <class Clock, class Duration>
+ iter_type put(iter_type i, std::ios_base& ios, char_type fill, time_point<Clock, Duration> const& tp) const;
+
+__params
+
+* [param i] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param fill] the character used as filler
+* [param tp] the __time_point
+* [param tern] begin of the formatting pattern
+* [param pat_end] end of the formatting pattern
+
+__effects Stores the time_point pattern from the __time_point_unit facet in let say `str`. Last as if
+
+ return put(s, ios, fill, tp, str.data(), str.data() + str.size());
+
+__returns An iterator pointing immediately after the last character produced.
+
+[endsect]
+
+[section:put_duration Member Function `put_duration()`]
+
+ template <typename Rep, typename Period>
+ iter_type put_duration(iter_type i, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const;
+
+__params
+
+* [param i] an output stream iterator
+* [param ios] a reference to a ios_base
+* [param fill] the character used as filler
+* [param d] the __duration
+
+__effects As if `facet.put(s, ios, fill, d)` where facet is the `__duration_put<CharT>` facet associated
+to the `ios` or a new instance of `__duration_put<CharT>`.
+
+__returns An iterator pointing immediately after the last character produced.
+
+[endsect]
+
+[section:put_epoch Member Function `put_epoch()`]
+
+ template <typename Clock>
+ iter_type put_epoch(iter_type i, std::ios_base& os) const;
+
+__params
+
+* [param i] an output stream iterator
+* [param ios] a reference to a ios_base
+
+__effects As if
+
+ string_type str = facet.template get_epoch<Clock>();
+ s=std::copy(str.begin(), str.end(), s);
+
+
+where facet is the `__time_point_units<CharT>` facet associated
+to the `ios` or a new instance of `__time_point_units_default<CharT>`.
+
+__returns s, iterator pointing immediately after the last character produced.
+
+[endsect]
+
+[endsect]
+
+[endsect] [/section:time_point_put_hpp]
+
+[/==================================================================]
+[section:time_point_units_hpp Header `<boost/chrono/io/time_point_units.hpp>`]
+[/==================================================================]
+
+ namespace boost {
+ namespace chrono {
+ template <typename CharT=char>
+ class time_point_units;
+ template <typename CharT=char>
+ class time_point_units_default,
+ }
+ }
-[endsect]
-[section:op_out Member Function `operator <<(basic_ostream<>&, duration_fmt)`]
+[section:time_point_units Template Class `time_point_units`]
- template<class CharT, class Traits>
- basic_ostream<CharT, Traits>&
- operator<<(basic_ostream<CharT, Traits>& s, duration_fmt d);
-__effects: `set_duration_style(s, static_cast<duration_style>(d))))`.
+__time_point_units facet gives useful information about the time_point pattern,
+the text associated to a time_point's epoch,
-__returns: `s`.
+ template <typename CharT=char>
+ class time_point_units: public std::locale::facet
+ {
+ public:
+ typedef CharT char_type; // Type of character the facet is instantiated on.
+ typedef std::basic_string<char_type> string_type; // Type of character string used by member functions.
+ static std::locale::id id; // Unique identifier for this type of facet.
-[endsect]
-[section:op_in Member Function `operator >>(basic_istream<>&, duration_fmt)`]
+ explicit time_point_units(size_t refs = 0);
- template<class CharT, class Traits>
- basic_istream<CharT, Traits>&
- operator>>(basic_istream<CharT, Traits>& s, duration_fmt d);
+ virtual string_type get_pattern() const =0;
+ template <typename Clock>
+ string_type get_epoch() const;
-__effects: `set_duration_style(s, static_cast<duration_style>(d))))`.
+ protected:
+ virtual ~time_point_units();
+ virtual string_type do_get_epoch(system_clock) const=0;
+ virtual string_type do_get_epoch(steady_clock) const=0;
+
+ #if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
+ virtual string_type do_get_epoch(process_real_cpu_clock) const=0;
+ virtual string_type do_get_epoch(process_user_cpu_clock) const=0;
+ virtual string_type do_get_epoch(process_system_cpu_clock) const=0;
+ virtual string_type do_get_epoch(process_cpu_clock) const=0;
+ #endif
+ #if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+ virtual string_type do_get_epoch(thread_clock) const=0;
+ #endif
-__returns: `s`.
+ };
+
+
+[section:c Constructor `time_point_units()`]
-[endsect]
-[endsect]
+ explicit time_point_units(size_t refs = 0);
-[section:symbol_format Non Member Function `symbol_format(ios_base&`]
+Construct a __time_point_units facet.
- std::ios_base& __symbol_format(ios_base& ios);
+__params
-__effects: `set_duration_style(s, duration_style::symbol)`.
+* [param refs] references
-__returns `ios`
+__effects Construct a __time_point_units facet.
+If the `refs` argument is `0` then destruction of the object is
+delegated to the locale, or locales, containing it. This allows
+the user to ignore lifetime management issues. On the other had,
+if `refsv is `1` then the object must be explicitly deleted;
+the locale will not do so. In this case, the object can be
+maintained across the lifetime of multiple locales.
[endsect]
-[section:name_format Non Member Function `name_format(ios_base&`]
+
+[section:get_pattern Member Function `get_pattern()`]
- std::ios_base& __name_format(ios_base& ios);
+ virtual string_type get_pattern() const =0;
-__effects: `set_duration_style(s, duration_style::prefix)`.
+__returns the pattern to be used by default.
-__returns `ios`
+[endsect]
+
+[section:get_epoch Member Function `get_epoch()`]
+ template <typename Clock>
+ string_type get_epoch() const;
+
+__returns the epoch associated to the clock `Clock` calling `__do_get_epoch(Clock())`
[endsect]
-[endsect]
+
+[section:d Destructor `time_point_units()`]
+ virtual ~time_point_units();
-[section:streams I/O Streams Operations]
+Destroy the facet.
-[section:duration__op_out Member Function `operator <<(basic_ostream<>&, const duration<>& d)`]
+[endsect]
-Any __duration can be streamed out to a `basic_ostream`. The run-time value of the __duration is formatted according to the rules and current format settings for __duration`::rep`. This is followed by a single space and then the compile-time unit name of the __duration. This unit name is built on the string returned from `ratio_string<>` and the data used to construct the __duration_punct which was inserted into the stream's locale. If a __duration_punct has not been inserted into the stream's locale, a default constructed __duration_punct will be added to the stream's locale.
+[section:do_get_epoch_system_clock Member Function `do_get_epoch(system_clock)`]
+ virtual string_type do_get_epoch(system_clock) const=0;
- template <class CharT, class Traits, class Rep, class Period>
- std::basic_ostream<CharT, Traits>&
- operator<<(std::basic_ostream<CharT, Traits>& os, const duration<Rep, Period>& d);
+__params
-__effects Behaves as a formatted output function. After constructing a sentry object, if the sentry converts to true, sets a local variable `style` of type __duration_style to __prefix which serves as a default formatting style. If the stream's locale has a __duration_punct facet, then sets `style` to the value of the __duration_style stored within that facet.
+* [param c] a dummy instance of __system_clock.
-Next the translated unit is obtained using the __duration_unit_string function
+__returns The epoch string associated to the __system_clock.
-Finally, as if:
+[endsect]
- os << d.count() << ' ' << duration_unit_string<CharT>(f.is_prefix(), d);
+[section:do_get_epoch_steady_clock Member Function `do_get_epoch(steady_clock)`]
-__returns `os`.
+ virtual string_type do_get_epoch(steady_clock) const=0;
-[endsect]
-[section:duration__op_in Member Function `operator <<(basic_istream<>&, const duration<>& d)`]
+__params
- template <class CharT, class Traits, class Rep, class Period>
- std::basic_istream<CharT, Traits>&
- operator>>(std::basic_istream<CharT, Traits>& is, duration<Rep, Period>& d)
+* [param c] a dummy instance of __steady_clock.
-__effects Behaves as a formatted input function. After constructing a sentry object, if the sentry converts to true,
-computes an intermediate representation based on `Rep` according to the following rules:
+__returns The epoch string associated to the __steady_clock.
-* If `Rep` is a floating point type, the intermediate representation is `long double`.
-* Else if `Rep` is a signed integral type, the intermediate representation is `long long`.
-* Else if `Rep` is an unsigned integral type, the intermediate representation is unsigned long long.
-* Else intermediate representation is `Rep`.
+[endsect]
-Next a local variable `ir` of type intermediate representation is default constructed and extracted from the stream as if by:
+[section:do_get_epoch_process_real_cpu_clock Member Function `do_get_epoch(process_real_cpu_clock)`]
- IR ir;
- is >> ir;
+ #if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
+ virtual string_type do_get_epoch(process_real_cpu_clock) const=0;
+ #endif
+
+__params
-If the extraction is successful, then an attempt is made to consume a space character. If this fails, `is.setstate(ios::failbit)` is called.
+* [param c] a dummy instance of __process_real_cpu_clock.
-Otherwise if the next character is `'['`, an attempt is made to consume a pattern of the form `"[N/D]s"`, `"[N/D]second"` or `"[N/D]seconds"` (whichever is longest) where `N` and `D` have type `unsigned long long`. If successful, local variables record the values of `N` and `D`, otherwise `is.setstate(ios::failbit)` is called.
+__returns The epoch string associated to the __process_real_cpu_clock.
+
+[endsect]
-Otherwise the next character is not `'['`. An attempt is made to parse the longest string possible matching one of the `ratio_string` SI prefixes or symbols. If successful, local variables record the `unsigned long long` numerator and denominator associated with the parsed string. If unsuccessful, `is.setstate(ios::failbit)` is called.
+[section:do_get_epoch_process_user_cpu_clock Member Function `do_get_epoch(process_user_cpu_clock)`]
-If a unit specifier has successfully been parsed, assume it has been stored as local `unsigned long long` variables `num` and `den`. And in this case compute `(num/den)/(Period::num/Period::den)` reduced to lowest terms. If this ratio can not be stored without overflow, call `is.setstate(ios::failbit)`. Otherwise store the result of this division in `num` and `den`.
+ #if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
+ virtual string_type do_get_epoch(process_user_cpu_clock) const=0;
+ #endif
+
+__params
-If the division did not result in overflow, then compute `r * num / den` in such a way as to avoid intermediate overflow. If `r` has integral type and this computation would not be exact, `is.setstate(ios::failbit)` is called. If the result of the computation would overflow `Rep`, `is.setstate(ios::failbit)` is called. Otherwise the result of `r * num / den` is used to construct a `duration<Rep, Period>` which is assigned to `d`.
+* [param c] a dummy instance of __process_real_cpu_clock.
-If at any time end-of-stream is detected, the algorithm calls `is.setstate(ios::eofbit)`.
+__returns The epoch string associated to the process_user_cpu_clock.
-__returns `is`
[endsect]
-[endsect]
+[section:do_get_epoch_process_system_cpu_clock Member Function `do_get_epoch(process_system_cpu_clock)`]
+ #if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
+ virtual string_type do_get_epoch(process_system_cpu_clock) const=0;
+ #endif
+
+__params
-[endsect] [/section:duration_io_hpp Header `<boost/chrono/io/duration_io.hpp>`]
+* [param c] a dummy instance of __process_system_cpu_clock.
-[/==================================================================]
-[section:time_point_get_hpp Header `<boost/chrono/io/time_point_get.hpp>`]
-[/==================================================================]
+__returns The epoch string associated to the process_user_cpu_clock.
- namespace boost {
- namespace chrono {
+[endsect]
+[section:do_get_epoch_process_process_cpu_clock Member Function `do_get_epoch(process_cpu_clock)`]
- }
- }
+ #if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
+ virtual string_type do_get_epoch(process_cpu_clock) const=0;
+ #endif
+
+__params
+* [param c] a dummy instance of __process_cpu_clock.
-[endsect] [/section:time_point_get_hpp]
+__returns The epoch string associated to the process_cpu_clock.
-[/==================================================================]
-[section:time_point_put_hpp Header `<boost/chrono/io/time_point_put.hpp>`]
-[/==================================================================]
+[endsect]
- namespace boost {
- namespace chrono {
+[section:do_get_epoch_process_thread_clock Member Function `do_get_epoch(thread_clock)`]
+ #if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+ virtual string_type do_get_epoch(thread_clock) const=0;
+ #endif
+
+__params
- }
- }
+* [param c] a dummy instance of __thread_clock.
+__returns The epoch string associated to the __thread_clock.
-[endsect] [/section:time_point_put_hpp]
+[endsect]
-[/==================================================================]
-[section:time_point_units_hpp Header `<boost/chrono/io/time_point_units.hpp>`]
-[/==================================================================]
- namespace boost {
- namespace chrono {
+[endsect]
+[section:time_point_units_default Template Class `time_point_units_default`]
+ // This class is used to define the strings for the default English
+ template <typename CharT=char>
+ class time_point_units_default: public time_point_units<CharT>
+ {
+ public:
+ typedef CharT char_type; // Type of character the facet is instantiated on.
+ typedef std::basic_string<char_type> string_type; // Type of character string used by member functions.
- }
- }
+ explicit time_point_units_default(size_t refs = 0);
+ ~time_point_units_default();
+ /**
+ * __returns the default pattern "%d%e".
+ */
+ string_type get_pattern() const;
+
+ protected:
+ /**
+ * [param c a dummy instance of __system_clock.
+ * __returns The epoch string returned by `clock_string<system_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(system_clock ) const;
+ /**
+ * [param c a dummy instance of __steady_clock.
+ * __returns The epoch string returned by `clock_string<steady_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(steady_clock ) const;
+ #if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
+ /**
+ * [param c a dummy instance of __process_real_cpu_clock.
+ * __returns The epoch string returned by `clock_string<process_real_cpu_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(process_real_cpu_clock ) const;
+ /**
+ * [param c a dummy instance of __process_user_cpu_clock.
+ * __returns The epoch string returned by `clock_string<process_user_cpu_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(process_user_cpu_clock ) const;
+ /**
+ * [param c a dummy instance of __process_system_cpu_clock.
+ * __returns The epoch string returned by `clock_string<process_system_cpu_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(process_system_cpu_clock ) const;
+ /**
+ * [param c a dummy instance of __process_cpu_clock.
+ * __returns The epoch string returned by `clock_string<process_cpu_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(process_cpu_clock ) const;
+
+ #endif
+ #if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+ /**
+ * [param c a dummy instance of __thread_clock.
+ * __returns The epoch string returned by `clock_string<thread_clock,CharT>::since()`.
+ */
+ string_type do_get_epoch(thread_clock ) const;
+ #endif
+
+ };
+[endsect]
[endsect] [/section:time_point_units_hpp]
@@ -4956,7 +6385,7 @@
__returns: An unspecified object that when streamed to a `basic_ostream<CharT, Traits>` or `basic_istream<CharT, Traits>` `s` will have the effects of:
- set_timezone(s, tz);
+ __set_timezone(s, tz);
[endsect]
@@ -4969,129 +6398,8 @@
__returns: An unspecified object that when streamed to a `basic_ostream<CharT, Traits>` or `basic_istream<CharT, Traits>` `s` will have the effects of:
- set_timezone(s, tz);
- set_time_fmt<CharT>(s, f);
-
-[endsect]
-[endsect]
-
-[section:ioss I/O State Savers]
-[section:timezone_io_saver Template Class `timezone_io_saver<>`]
-
-
- template<typename CharT = char, typename Traits = std::char_traits<CharT> >
- struct __timezone_io_saver
- {
- typedef std::basic_ios<CharT, Traits> state_type;
- typedef __timezone aspect_type;
-
- explicit __timezone_io_saver__c1(state_type &s);
- __timezone_io_saver__c2(state_type &s, aspect_type new_value);
- __timezone_io_saver__d();
- void timezone_io_saver__restore();
- };
-
-
-The `state_type` is a version of the IOStreams base class template `std::basic_ios<CharT, Traits>`, where `CharT` is a character type and `Traits` is a character traits class. The user would usually place an actual input, output, or combined stream object for the state-type parameter, and not a base class object.
-
-[section:c1 Constructor `timezone_io_saver(state_type&)`]
-
-The first constructor takes a stream object and saves a reference to the stream and the current value of a particular stream attribute.
-
- explicit timezone_io_saver(state_type &s);
-
-__effects Constructs a __timezone_io_saver by storing `s`.
-
-[endsect]
-
-[section:c2 Constructor `timezone_io_saver(state_type, aspect_type)`]
-
-The second constructor works like the first, and uses its second argument to change the stream's attribute to the new aspect_type value given.
-
- explicit timezone_io_saver(state_type &s, aspect_type new_value);
-
-__effects Constructs a __timezone_io_saver by storing `s`.
-
-
-[endsect]
-
-[section:d Destructor `~timezone_io_saver()`]
-
-The destructor restores the stream's attribute to the saved value.
-
- ~timezone_io_saver();
-
-__effects As if __timezone_io_saver__restore().
-
-[endsect]
-[section:restore Member Function `restore()`]
-
-The restoration can be activated early (and often) with the restore member function.
-
- void restore();
-
-__effects Restores the stream's __timezone attribute to the saved value.
-
-[endsect]
-
-
-[endsect]
-
-[section:time_fmt_io_saver Template Class `time_fmt_io_saver<>`]
-
- template<typename CharT = char, typename Traits = std::char_traits<CharT> >
- struct __time_fmt_io_saver
- {
- typedef std::basic_ios<CharT, Traits> state_type;
-
- explicit __time_fmt_io_saver__c1(state_type &s);
- __time_fmt_io_saver__c2(state_type &s, basic_string<CharT> const& new_value);
- __time_fmt_io_saver__d();
- void __time_fmt_io_saver__restore();
- };
-
-
-The `state_type` is a version of the IOStreams base class template `std::basic_ios<CharT, Traits>`, where `CharT` is a character type and `Traits` is a character traits class. The user would usually place an actual input, output, or combined stream object for the state-type parameter, and not a base class object.
-
-[section:c1 Constructor `time_fmt_io_saver(state_type&)`]
-
-The first constructor takes a stream object and saves a reference to the stream and the current value of a particular stream attribute.
-
- explicit time_fmt_io_saver(state_type &s);
-
-__effects Constructs a __time_fmt_io_saver by storing `s`.
-
-[endsect]
-
-[section:c2 Constructor `time_fmt_io_saver(state_type, aspect_type)`]
-
-The second constructor works like the first, and uses its second argument to change the stream's attribute to the new aspect_type value given.
-
- explicit time_fmt_io_saver(state_type &s, aspect_type new_value);
-
-__effects Constructs a __time_fmt_io_saver by storing `s`.
-
-
-[endsect]
-
-[section:d Destructor `~time_fmt_io_saver()`]
-
-The destructor restores the stream's attribute to the saved value.
-
- ~time_fmt_io_saver();
-
-__effects As if __time_fmt_io_saver__restore().
-
-[endsect]
-[section:restore Member Function `restore()`]
-
-The restoration can be activated early (and often) with the restore member function.
-
- void restore();
-
-__effects Restores the stream's time format attribute to the saved value.
-
-[endsect]
+ __set_timezone(s, tz);
+ __set_time_fmt<CharT>(s, f);
[endsect]
[endsect]
@@ -5137,19 +6445,18 @@
[endsect]
[section:op_in Non Member Function `operator>>()`]
- template <class CharT, class Traits, class __Clock, class __Duration>
+ template <class CharT, class Traits, class __Duration>
std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is,
- time_point<__Clock, __Duration>& tp);
+ time_point<system_clock, __Duration>& tp);
__effects Behaves as a formatted input function. After constructing a sentry object, if the sentry converts to true,
obtains a `std::time_get` facet from `is`, and obtains a formatting string in the same manner as described for
insertion operator. Extract a `tm` using the supplied formatting string, or if empty, defaulted as described for the
-insertion operator. Note that extraction does not use the __timezone data stored in the time_punct facet for the
+insertion operator. Note that extraction does not use the __timezone data stored in the `is` for the
defaulted string as the __timezone information is stored in the stream.
-Given any __time_punct imbued on a `basic_iostream`, or if the `basic_iostream` does not have an imbued __time_punct,
-any `time_point<system_clock, __Duration>` inserted, and then extracted should result in an equal
+Any `time_point<system_clock, __Duration>` inserted, and then extracted should result in an equal
`time_point<system_clock, __Duration>`, excepting any precision that did not get inserted.
__example
@@ -5179,27 +6486,16 @@
operator<<(std::basic_ostream<CharT, Traits>& os,
const time_point<__Clock, __Duration>& tp);
-__effects Formats a `tp` to the stream `os`.
-
-A __time_point is formatted by outputting its internal __duration. Next follows the possible translation of string that
-describes the `__time_point::clock` epoch.
-
-This string will vary for each distinct clock, and for each implementation
-of the supplied clocks as described in __clock_string.
-The translation is done by the time_point_units facet allowing to adapt the English string to different locales.
-
-The resulting string must be readable by the extraction operator and result in an equal value and should make the form
-interpretable by a human reader.
+__effects Behaves as a formatted output function. After constructing a `sentry` object, if the `sentry`
+converts to `true`, calls to `facet.put(os,os,os.fill(),tp)` where `facet` is the `time_point_put<CharT>`
+facet associated to `os` or a new created instance of the default `time_point_put<CharT>` facet.
-Resuming as if
-
- return os << tp.__time_since_epoch() << __epoch_translate(__clock_string<__Clock, CharT>::__since());
+__returns `os`.
__example
22644271279698 nanoseconds since boot
-__returns `os`.
[endsect]
[section:op_in Non Member Function `operator>>()`]
@@ -5209,11 +6505,11 @@
operator>>(std::basic_istream<CharT, Traits>& is,
time_point<__Clock, __Duration>& tp);
-__effects Extracts `tp` from the stream `is`.
-
-First a duration is extracted.
+Extracts `tp` from the stream `is`.
-Then if if no error occurred the string __epoch_translate(__clock_string<__Clock>::since()) must match the extracted input.
+__effects Behaves as a formatted input function. After constructing a `sentry` object, if the `sentry`
+converts to `true`, calls to `facet.get(is,std::istreambuf_iterator<CharT, Traits>(), is, err, tp)` where `facet` is the `time_point_get<CharT>`
+facet associated to `is` or a new created instance of the default `time_point_get<CharT>` facet.
If any step fails, calls `os.setstate(std::ios_base::failbit | std::ios_base::badbit)`.
@@ -5230,7 +6526,7 @@
-
+[/
[/==================================================================]
[section:duration_unit_string_hpp Header `<boost/chrono/io/duration_unit_string.hpp>`]
[/==================================================================]
@@ -5360,7 +6656,7 @@
[endsect]
[endsect] [/section:translate_hpp Header `<boost/chrono/io/translate.hpp>`]
-
+]
[endsect] [/section:io Chrono I/O]
@@ -6293,10 +7589,9 @@
* [@http://svn.boost.org/trac/boost/ticket/5980 #5980] Take care of the Howard Hinnant [@http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html proposal] which has the advantage to provide I/O for system clocks using the Gregorian Calendar.
* [@http://svn.boost.org/trac/boost/ticket/5981 #5981] Added i/o state savers.
-
[*Deprecated:]
-* The chrono i/o version included in Boost.Chrono 1.2.0 has been completmly refactored in version 2.0.0
+* The chrono i/o version included in Boost.Chrono 1.2.x has been completmly refactored in version 2.0.0
* chrono I/O: The manipulators __duration_short, __duration_long are depreceated. You should use the parameterized form __duration_fmt or the renamed manipulators __duration_symbol and __duration_prefix instead.
* chrono I/O: The duraction_punc<> facet is depreceated. You should use the __get_duration_style free function to get the informations and use the duration_units facet for localization purposes.
@@ -6304,16 +7599,26 @@
[*Fixes:]
+* [@http://svn.boost.org/trac/boost/ticket/6241 #6241] boost::chrono compilation problems without std::wstring support.
+
+[/* [@http://svn.boost.org/trac/boost/ticket/6094 #6094] 1 secondALPHA should be an invalid input for a duration.]
+
+[endsect] [/section [*Version 2.0.0] ]
+
+[section [*Version 1.2.1, February 1, 2012 - 1.49] ]
+
+[*Fixes:]
+
* [@http://svn.boost.org/trac/boost/ticket/6092 #6092] Input from non integral durations makes the compiler fail.
* [@http://svn.boost.org/trac/boost/ticket/6093 #6093] [1/3]second fails as valid duration input.
* [@http://svn.boost.org/trac/boost/ticket/6113 #6113] duplicate symbol when BOOST_CHRONO_HEADER_ONLY is defined.
+* [@http://svn.boost.org/trac/boost/ticket/6243 #6243] Sandia-pgi-11.9: more than one instance of overloaded function "min" matches.
+* [@http://svn.boost.org/trac/boost/ticket/6257 #6257] process_cpu_clock::now() on linux gives time_points 1/1000 times.
-[/* [@http://svn.boost.org/trac/boost/ticket/6094 #6094] 1 secondALPHA should be an invalid input for a duration.]
+[endsect] [/section [*Version 1.2.1] ]
-[endsect] [/section [*Version 2.0.0] ]
[section [*Version 1.2.0, October 17, 2011] ]
-
[*New Features:]
* [@http://svn.boost.org/trac/boost/ticket/5979 #5979] Added chrono rounding utilities as defined By Howard Hinnant [@http://home.roadrunner.com/~hinnant/duration_io/chrono_util.html here].
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk