|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62667 - in branches/release/libs: date_time/test/posix_time date_time/xmldoc test/build
From: andrey.semashev_at_[hidden]
Date: 2010-06-09 12:33:37
Author: andysem
Date: 2010-06-09 12:33:36 EDT (Wed, 09 Jun 2010)
New Revision: 62667
URL: http://svn.boost.org/trac/boost/changeset/62667
Log:
Merged changes from trunk (rev. 62450). Fixes #3876.
Text files modified:
branches/release/libs/date_time/test/posix_time/testtime_facet.cpp | 19 ++++++
branches/release/libs/date_time/xmldoc/changes.xml | 118 +++++++++++++++++++++++---------------
branches/release/libs/date_time/xmldoc/format_flags.xml | 122 ++++++++++++++++++++++-----------------
branches/release/libs/test/build/Jamfile.v2 | 4
4 files changed, 160 insertions(+), 103 deletions(-)
Modified: branches/release/libs/date_time/test/posix_time/testtime_facet.cpp
==============================================================================
--- branches/release/libs/date_time/test/posix_time/testtime_facet.cpp (original)
+++ branches/release/libs/date_time/test/posix_time/testtime_facet.cpp 2010-06-09 12:33:36 EDT (Wed, 09 Jun 2010)
@@ -108,6 +108,25 @@
ss << long_td;
check("Long time durations", ss.str() == std::string("300:02:01"));
ss.str("");
+
+ // Short-hand format specifiers
+ f->format("%T");
+ f->time_duration_format("%T");
+ ss << t;
+ check("Short-hand '%T' in time format", ss.str() == std::string("18:01:56"));
+ ss.str("");
+ ss << td;
+ check("Short-hand '%T' in time_duration format", ss.str() == std::string("03:02:01"));
+ ss.str("");
+
+ f->format("%R");
+ f->time_duration_format("%R");
+ ss << t;
+ check("Short-hand '%R' in time format", ss.str() == std::string("18:01"));
+ ss.str("");
+ ss << td;
+ check("Short-hand '%R' in time_duration format", ss.str() == std::string("03:02"));
+ ss.str("");
}
{ // negative time_duration tests
std::string result;
Modified: branches/release/libs/date_time/xmldoc/changes.xml
==============================================================================
--- branches/release/libs/date_time/xmldoc/changes.xml (original)
+++ branches/release/libs/date_time/xmldoc/changes.xml 2010-06-09 12:33:36 EDT (Wed, 09 Jun 2010)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
+<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"../../../tools/boostbook/dtd/boostbook.dtd">
<!-- Copyright (c) 2001-2006 CrystalClear Software, Inc.
- Subject to the Boost Software License, Version 1.0.
+ Subject to the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
-->
@@ -12,6 +12,30 @@
<!-- if each new change tgroup has a "Bug Fix" as the first "Type", the columns will line up nicely -->
+ <bridgehead renderas="sect3">Changes from Boost 1.41 to 1.44 (date_time 1.08 to 1.09)</bridgehead>
+ <informaltable frame="all">
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+
+ <row>
+ <entry>Bug fix</entry>
+ <entry>
+ The "%T" and "%R" format specifiers are now processed by the library rather than underlying standard facet.
+ This fixes the cases when the placeholders are not supported by the facet
+ (<ulink url="https://svn.boost.org/trac/boost/ticket/3876">#3876</ulink>).
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </informaltable>
+
<bridgehead renderas="sect3">Changes from Boost 1.40 to 1.41 (date_time 1.07 to 1.08)</bridgehead>
<informaltable frame="all">
<tgroup cols="2">
@@ -214,12 +238,12 @@
<row>
<entry>Feature</entry>
<entry>
- Updated the data in the date_time_zonespec.csv file to reflect new US/Canada
+ Updated the data in the date_time_zonespec.csv file to reflect new US/Canada
daylight savings time rules for 2007. If you upgrade to the new file, be aware
that the library will only give correct answers for current/future date
- conversions. So if you are converting dates from earlier years the answers
- will reflect current time zone rules not past rules. The library doesn't support
- historic timezone rules presently.
+ conversions. So if you are converting dates from earlier years the answers
+ will reflect current time zone rules not past rules. The library doesn't support
+ historic timezone rules presently.
</entry>
</row>
<row>
@@ -263,15 +287,15 @@
</row>
<row>
<entry>Bug Fix</entry>
- <entry>Fix regression errors that showed up under FreeBSD with GCC and the
- LANG environment set to russian -- changed parser to use classic
+ <entry>Fix regression errors that showed up under FreeBSD with GCC and the
+ LANG environment set to russian -- changed parser to use classic
locale instead of blank locale.
</entry>
</row>
<row>
<entry>Bug Fix</entry>
- <entry>Changes for tracker issue 1178092 -- change in convert_to_lower to make
+ <entry>Changes for tracker issue 1178092 -- change in convert_to_lower to make
local a const static and speed up parsing.
</entry>
</row>
@@ -284,9 +308,9 @@
<row>
<entry>Feature</entry>
- <entry>Reduce the usage of basic_stringstream as much a possible to work around
- a bug in the VC8 standard library. See
- <ulink url="http://lists.boost.org/Archives/boost/2006/02/101122.php">mailing list archive</ulink>
+ <entry>Reduce the usage of basic_stringstream as much a possible to work around
+ a bug in the VC8 standard library. See
+ <ulink url="http://lists.boost.org/Archives/boost/2006/02/101122.php">mailing list archive</ulink>
for more information.
</entry>
</row>
@@ -355,7 +379,7 @@
</row>
<row>
<entry>Feature</entry>
- <entry>Input and output facets have been re-written to support format-based
+ <entry>Input and output facets have been re-written to support format-based
redefinition of formats (see <link linkend="date_time.date_time_io">Date Time IO</link> for complete details).
</entry>
</row>
@@ -382,16 +406,16 @@
<row>
<entry>Feature</entry>
<entry>Date-time now uses reentrant POSIX functions on those platforms that
- support them when BOOST_HAS_THREADS is defined.
+ support them when BOOST_HAS_THREADS is defined.
</entry>
</row>
<row>
<entry>Bug Fix</entry>
- <entry>Fixed a bug in serialization code where special values
+ <entry>Fixed a bug in serialization code where special values
(not-a-date-time, infinities, etc) for
- ptime, time_duration would not read back correctly from an archive.
+ ptime, time_duration would not read back correctly from an archive.
The output serialization code wrote subfields such
- as time_duration.seconds() which are invalid for special values and
+ as time_duration.seconds() which are invalid for special values and
thus undefined values. Thus when read back the values could cause
strange behavior including execeptions on construction.
</entry>
@@ -449,16 +473,16 @@
<tbody>
<row>
<entry>Bug Fix</entry>
- <entry>Snap to end of month behavior corrected for year_functor. Previously, starting
- from 2000-Feb-28 (leap year and not end of month) and iterating through the next
- leap year would result in 2004-Feb-29 instead of 2004-Feb-28. This behavior has
- been corrected to produce the correct result of 2004-Feb-28. Thanks to Bart Garst
+ <entry>Snap to end of month behavior corrected for year_functor. Previously, starting
+ from 2000-Feb-28 (leap year and not end of month) and iterating through the next
+ leap year would result in 2004-Feb-29 instead of 2004-Feb-28. This behavior has
+ been corrected to produce the correct result of 2004-Feb-28. Thanks to Bart Garst
for this change.
</entry>
</row>
<row>
<entry>Feature</entry>
- <entry>Free function for creating a ptime object from a FILETIME struct. This function
+ <entry>Free function for creating a ptime object from a FILETIME struct. This function
is only available on platforms that define BOOST_HAS_FTIME.
</entry>
</row>
@@ -470,24 +494,24 @@
</row>
<row>
<entry>Feature</entry>
- <entry>Use of the boost::serialization library is now available with most of the
- date_time classes. Classes capable of serialization are: date_generator classes,
+ <entry>Use of the boost::serialization library is now available with most of the
+ date_time classes. Classes capable of serialization are: date_generator classes,
date, days, date_period, greg_month, greg_weekday, greg_day, ptime, time_duration,
and time_period. Thanks to Bart Garst for this change.
</entry>
</row>
<row>
<entry>Feature</entry>
- <entry>Functions added to convert date and time classes to wstring. The library now
- provides to_*_wstring as well as to_*_string functions for: simple, iso,
- iso_extended, and sql for dates and compilers that support wstrings. Thanks to
+ <entry>Functions added to convert date and time classes to wstring. The library now
+ provides to_*_wstring as well as to_*_string functions for: simple, iso,
+ iso_extended, and sql for dates and compilers that support wstrings. Thanks to
Bart Garst for this change.
</entry>
</row>
<row>
<entry>Feature</entry>
- <entry>Period classes now handle zero length and NULL periods correctly. A NULL period
- is a period with a negative length. Thanks to Frank Wolf and Bart Garst for this
+ <entry>Period classes now handle zero length and NULL periods correctly. A NULL period
+ is a period with a negative length. Thanks to Frank Wolf and Bart Garst for this
change.
</entry>
</row>
@@ -505,7 +529,7 @@
</row>
<row>
<entry>Feature</entry>
- <entry>New names added for some date classes. Original names are still valid but may
+ <entry>New names added for some date classes. Original names are still valid but may
some day be deprecated. Changes are:
<simplelist type='horiz' columns='3'>
<member>date_duration</member>
@@ -541,13 +565,13 @@
</row>
<row>
<entry>Feature</entry>
- <entry>New experimental duration types added for months, years, and weeks. These classes
+ <entry>New experimental duration types added for months, years, and weeks. These classes
also provide mathematical operators for use with date and time classes. Be aware
- that adding of months or years a time or date past the 28th of a month may show
- non-normal mathematical properties. This is a result of 'end-of-month'
- snapping used in the calculation. The last example below illustrates the
- issue.
-
+ that adding of months or years a time or date past the 28th of a month may show
+ non-normal mathematical properties. This is a result of 'end-of-month'
+ snapping used in the calculation. The last example below illustrates the
+ issue.
+
<screen>months m(12);
years y(1);
m == y; // true
@@ -559,7 +583,7 @@
date d(2004,Jan,30);
d += months(1); //2004-Feb-29
d -= months(1); //2004-Jan-29</screen>
- Input streaming is not yet implemented for these types.
+ Input streaming is not yet implemented for these types.
Thanks to Bart Garst for this change.
</entry>
</row>
@@ -570,8 +594,8 @@
</row>
<row>
<entry>Feature</entry>
- <entry>Added constructors for date and ptime that allow for default construction (both)
- and special values construction (ptime, both now support this). Default
+ <entry>Added constructors for date and ptime that allow for default construction (both)
+ and special values construction (ptime, both now support this). Default
constructors initialize the objects to not_a_date_time (NADT).
<screen>ptime p_nadt(not_a_date_time);
ptime p_posinf(pos_infin);
@@ -605,21 +629,21 @@
<entry> Fixed bug in duration_from_string() where a string formatted with
less than full amount of fractional digits created an incorrect
time_duration. With microsecond resolution for time durations
- the string "1:01:01.010" created a time duration of
+ the string "1:01:01.010" created a time duration of
01:01:01.000010 instead of 01:01:01.010000
</entry>
</row>
<row>
<entry>Bug Fix</entry>
- <entry>Fixed the special value constructor for gregorian::date and posix_time::ptime
- when constructing with min_date_time or max_date_time. The wrong value was
+ <entry>Fixed the special value constructor for gregorian::date and posix_time::ptime
+ when constructing with min_date_time or max_date_time. The wrong value was
constructed for these.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
-
+
<bridgehead renderas="sect3">Changes from Boost 1.30 to 1.31 (date_time 1.01 to 1.02)</bridgehead>
<informaltable frame="all">
<tgroup cols="2">
@@ -672,8 +696,8 @@
</row>
<row>
<entry>Feature</entry>
- <entry>Added a function to time_duration to get the total number of seconds in a
- duration truncating any fractional seconds. In addition, other resolutions
+ <entry>Added a function to time_duration to get the total number of seconds in a
+ duration truncating any fractional seconds. In addition, other resolutions
were added to allow for easy conversions. For example
<screen>seconds(1).total_milliseconds() == 1000
seconds(1).total_microseconds() == 1000000
@@ -708,10 +732,10 @@
</tbody>
</tgroup>
</informaltable>
-
+
<bridgehead renderas="sect3">Changes from Boost 1.29 to 1.30 (date_time 1.00 to 1.01)</bridgehead>
<para>
- Notice: The interface to the partial_date class (see <link linkend="date_time.gregorian.date_algorithms">date_algorithms</link>) was changed. The order of construction parameters was changed which will cause some code to fail execution. This change was made to facilitate more generic local time adjustment code. Thus instead of specifying partial_date pd(Dec,25) the code needs to be changed to partial_date pd(25, Dec);
+ Notice: The interface to the partial_date class (see <link linkend="date_time.gregorian.date_algorithms">date_algorithms</link>) was changed. The order of construction parameters was changed which will cause some code to fail execution. This change was made to facilitate more generic local time adjustment code. Thus instead of specifying partial_date pd(Dec,25) the code needs to be changed to partial_date pd(25, Dec);
</para>
<informaltable frame="all">
<tgroup cols="2">
Modified: branches/release/libs/date_time/xmldoc/format_flags.xml
==============================================================================
--- branches/release/libs/date_time/xmldoc/format_flags.xml (original)
+++ branches/release/libs/date_time/xmldoc/format_flags.xml 2010-06-09 12:33:36 EDT (Wed, 09 Jun 2010)
@@ -11,10 +11,10 @@
<title>Format Flags</title>
<para>Many of the format flags this new system uses for output are those used by <code>strftime(...)</code>, but not all. Some new flags have been added, and others overridden. The input system supports only specific flags, therefore, not all flags that work for output will work with input (we are currently working to correct this situation).</para>
-
- <para>The following tables list the all the flags available for both date_time IO as well as strftime. Format flags marked with a single asterisk (*) have a behavior unique to date_time. Those flags marked with an exclamation point (!) are not usable for input (at this time). The first table is for dates, and the second table is for times.
+
+ <para>The following tables list the all the flags available for both date_time IO as well as strftime. Format flags marked with a single asterisk (*) have a behavior unique to date_time. Those flags marked with an exclamation point (!) are not usable for input (at this time). The flags marked with a hash sign (#) are implemented by system locale and are known to be missing on some platforms. The first table is for dates, and the second table is for times.
</para>
-
+
<para>
<anchor id="date_time_io.date_format_flags" />
Date Facet Format Flags
@@ -71,7 +71,7 @@
</row>
<row>
- <entry valign="top" morerows="1"><screen>%C !</screen></entry>
+ <entry valign="top" morerows="1"><screen>%C !#</screen></entry>
<entry>The century number (year/100) as a 2-digit integer.</entry>
</row>
<row>
@@ -87,15 +87,15 @@
</row>
<row>
- <entry valign="top" morerows="1"><screen>%D !</screen></entry>
+ <entry valign="top" morerows="1"><screen>%D !#</screen></entry>
<entry>Equivalent to %m/%d/%y</entry>
</row>
<row>
<entry><screen></screen></entry>
</row>
-
+
<row>
- <entry valign="top" morerows="1"><screen>%e</screen></entry>
+ <entry valign="top" morerows="1"><screen>%e #</screen></entry>
<entry>Like %d, the day of the month as a decimal number, but a leading zero is replaced by a space</entry>
</row>
<row>
@@ -119,7 +119,7 @@
</row>
<row>
- <entry valign="top" morerows="1"><screen>%h !</screen></entry>
+ <entry valign="top" morerows="1"><screen>%h !#</screen></entry>
<entry> Equivalent to %b</entry>
</row>
<row>
@@ -156,14 +156,14 @@
</row>
<row>
<entry><screen>date d(2005, Jan, 1); // Saturday
- // with format %U
- ss << d; // "00"
- d += day(1); // Sunday
- ss << d; // "01" beginning of week 1</screen></entry>
+// with format %U
+ss << d; // "00"
+d += day(1); // Sunday
+ss << d; // "01" beginning of week 1</screen></entry>
</row>
<row>
- <entry valign="top" morerows="1"><screen>%V !</screen></entry>
+ <entry valign="top" morerows="1"><screen>%V !#</screen></entry>
<entry>The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.</entry>
</row>
<row>
@@ -184,10 +184,10 @@
</row>
<row>
<entry><screen>date d(2005, Jan, 2); // Sunday
- // with format %W
- ss << d; // "00"
- d += day(1); // Monday
- ss << d; // "01" beginning of week 1</screen></entry>
+// with format %W
+ss << d; // "00"
+d += day(1); // Monday
+ss << d; // "01" beginning of week 1</screen></entry>
</row>
<row>
@@ -196,15 +196,15 @@
</row>
<row>
<entry><screen>date d(2005,Oct,31);
- date_facet* f = new date_facet("%x");
-
- locale loc = locale(locale("en_US"), f);
- cout.imbue(loc);
- cout << d; // "10/31/2005"
-
- loc = locale(locale("de_DE"), f);
- cout.imbue(loc);
- cout << d; // "31.10.2005"</screen></entry>
+date_facet* f = new date_facet("%x");
+
+locale loc = locale(locale("en_US"), f);
+cout.imbue(loc);
+cout << d; // "10/31/2005"
+
+loc = locale(locale("de_DE"), f);
+cout.imbue(loc);
+cout << d; // "31.10.2005"</screen></entry>
</row>
<row>
@@ -296,21 +296,20 @@
</row>
<row>
<entry><screen>"13:15:16"
- "05:04:03.001234"
- </screen></entry>
+"05:04:03.001234"</screen></entry>
</row>
<row>
- <entry valign="top" morerows="1"><screen>%O</screen></entry>
- <entry>The number of hours in a time duration as a decimal number (range 0 to max. representable duration); single digits are preceded by a zero.</entry>
+ <entry valign="top" morerows="1"><screen>%H</screen></entry>
+ <entry>The hour as a decimal number using a 24-hour clock (range 00 to 23).</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
<entry valign="top" morerows="1"><screen>%I !</screen></entry>
- <entry>The hour as a decimal number using a 12-hour clock</entry>
+ <entry>The hour as a decimal number using a 12-hour clock (range 01 to 12).</entry>
</row>
<row>
<entry></entry>
@@ -321,7 +320,7 @@
<entry>The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank.</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
@@ -329,7 +328,23 @@
<entry>The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank.</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
+ </row>
+
+ <row>
+ <entry valign="top" morerows="1"><screen>%M</screen></entry>
+ <entry>The minute as a decimal number (range 00 to 59).</entry>
+ </row>
+ <row>
+ <entry></entry>
+ </row>
+
+ <row>
+ <entry valign="top" morerows="1"><screen>%O</screen></entry>
+ <entry>The number of hours in a time duration as a decimal number (range 0 to max. representable duration); single digits are preceded by a zero.</entry>
+ </row>
+ <row>
+ <entry></entry>
</row>
<row>
@@ -337,23 +352,23 @@
<entry>Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale.</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
- <entry valign="top" morerows="1"><screen>%P !</screen></entry>
+ <entry valign="top" morerows="1"><screen>%P !#</screen></entry>
<entry>Like %p but in lowercase: `am' or `pm' or a corresponding string for the current locale.</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
- <entry valign="top" morerows="1"><screen>%r !</screen></entry>
+ <entry valign="top" morerows="1"><screen>%r !#</screen></entry>
<entry>The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to `%I:%M:%S %p'</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
@@ -361,7 +376,7 @@
<entry>The time in 24-hour notation (%H:%M)</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
@@ -385,7 +400,7 @@
<entry>The time in 24-hour notation (%H:%M:%S)</entry>
</row>
<row>
- <entry><screen></screen></entry>
+ <entry></entry>
</row>
<row>
@@ -434,16 +449,16 @@
</row>
<row>
<entry><screen>date d(2005,Oct,31);
- ptime pt(d, hours(20));
- time_facet* f = new time_facet("%x %X");
-
- locale loc = locale(locale("en_US"), f);
- cout.imbue(loc);
- cout << pt; // "10/31/2005 08:00:00 PM"
-
- loc = locale(locale("de_DE"), f);
- cout.imbue(loc);
- cout << pt; // "31.10.2005 20:00:00"</screen></entry>
+ptime pt(d, hours(20));
+time_facet* f = new time_facet("%x %X");
+
+locale loc = locale(locale("en_US"), f);
+cout.imbue(loc);
+cout << pt; // "10/31/2005 08:00:00 PM"
+
+loc = locale(locale("de_DE"), f);
+cout.imbue(loc);
+cout << pt; // "31.10.2005 20:00:00"</screen></entry>
</row>
<row>
@@ -451,9 +466,7 @@
<entry>ISO format</entry>
</row>
<row>
- <entry><screen>"20051015T131211-0700"
- // Oct 15, 2005 13:12:11 MST
- </screen></entry>
+ <entry><screen>"20051015T131211-0700" // Oct 15, 2005 13:12:11 MST</screen></entry>
</row>
<row>
@@ -501,5 +514,6 @@
</informaltable>
</para>
<para>* Signifies flags that have a behavior unique to <code>date_time</code>.</para>
+ <para># Signifies flags that have a platform-dependent behavior. These may not be supported everywhere.</para>
<para>! Signifies flags that currently do not work for input.</para>
</section>
Modified: branches/release/libs/test/build/Jamfile.v2
==============================================================================
--- branches/release/libs/test/build/Jamfile.v2 (original)
+++ branches/release/libs/test/build/Jamfile.v2 2010-06-09 12:33:36 EDT (Wed, 09 Jun 2010)
@@ -14,7 +14,7 @@
<link>shared,<toolset>msvc:<cxxflags>-wd4275
<toolset>msvc:<cxxflags>-wd4671
<toolset>msvc:<cxxflags>-wd4673
- <warnings>all
+# <warnings>all
: usage-requirements
<define>BOOST_TEST_NO_AUTO_LINK=1
# Disable Warning about boost::noncopyable not being exported
@@ -108,4 +108,4 @@
boost-install boost_prg_exec_monitor
boost_test_exec_monitor
boost_unit_test_framework ;
-
\ No newline at end of file
+
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