Compare commits

..

52 Commits

Author SHA1 Message Date
Peter Dimov 6248d64ed9 Merge branch 'develop' 2026-06-01 01:52:20 +03:00
Andrey Semashev 6b387c4969 Remove dependencies on Boost.StaticAssert. (#250)
Boost.StaticAssert has been merged into Boost.Config, so remove
the dependency.
2026-02-06 03:26:58 +02:00
James E. King III 69c45b7a2b Update README 2025-07-07 06:39:45 -04:00
James E. King III 19ffa6232d Implement a reusable GHA workflow with configuration options. 2025-07-06 22:04:23 -04:00
Jeff Garland 363e04d7ec Merge pull request #242 from jeking3/coverity-255065
issue-204: period::intersects incorrect for empty periods
2025-07-06 18:06:39 -07:00
James E. King III 64c1df1e3e issue-204: period::intersects incorrect for empty periods
Originally identified by Coverity Scan.  Zero length periods like
[3, 3) cannot intersect with anything.  Invalid periods like
[5, 4) also cannot intersect with anything.  In both cases the
unit tests are wrong, and fixing them reveals the implementation
is not canonical for half-open sane intervals.
2025-07-06 14:56:23 -04:00
René Ferdinand Rivera Morell 645574e5df Add support for modular build structure. (#239)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add missing NO_LIB usage requirements.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Adjust doc build to avoid boost-root references.

* Update build deps.

* Rework GHA to use containers for the ubuntu that are god or going away.

* Remove obsolete package installs.

* Need another package?

* Some deepndencies are now C++11 only. Hence date_time is now also C++11 only.

* Switch macOS test to use the latest version.

* Remove not-needed software-properties-common package.

* Remove setup gcc toolchain step.

* Install some missing compilers.

* Maybe the gcc builds for the specific ubuntu versions rea broken. Switch to something newer.
2025-06-27 02:30:25 +03:00
Jeff Garland 85e637cb32 minor date-time fixes for 1.81 release (#219)
* fix typo in time_period docs (#212)

Co-authored-by: Quinn O'Connor <qoconnor@fastenal.com>

* Fix constexpr of gregorian::date::date(special_values) to improve perf (#214)

GCC up to at least 10.2 fail to resolve
gregorian::date::date(special_values) as constexpr function due to
assignment to *this within the constructor. Refactoring constructor to
initialize the instance once leads to large performance improvement.

* Avoid using likely function as multiple projects define a likely macro (#216)

* Iso doc fixes (#215)

* to_iso_*string() use "." as fractional separator

The fractional separator for the various to_iso_* methods
is "." not "," (per to_iso_string_type() implementation).
Fix the documentation to match the implementation.

* use "ISO 8601" not "iso" in documentation

The standard is "ISO 8601", so use that instead
of just "iso" or "ISO" in comments and documentation.

* fractional seconds only included if non-zero (#110)

Consistently document that the fractional seconds
are only included if non-zero.

Use "where fffffffff" not "were fff".

* Fix ccache saving on cache hit (#211)

See boostorg/boost-ci#166

* chore: bump macos runner version (#213)

GitHub Action is sunsetting the macOS 10.15 Actions runner. It will stop working intermittently until being completely removed by 2022-8-30: https://github.blog/changelog/2022-07-20-github-actions-the-macos-10-15-actions-runner-image-is-being-deprecated-and-will-be-removed-by-8-30-22

Co-authored-by: Quinnsicle <qtoconnor@gmail.com>
Co-authored-by: Quinn O'Connor <qoconnor@fastenal.com>
Co-authored-by: Povilas Kanapickas <povilas@radix.lt>
Co-authored-by: Antony Polukhin <antoshkka@gmail.com>
Co-authored-by: Luke Mewburn <luke@mewburn.net>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Baoshuo Ren <i@baoshuo.ren>
2022-10-31 09:22:31 -07:00
Baoshuo Ren 39714907b7 chore: bump macos runner version (#213)
GitHub Action is sunsetting the macOS 10.15 Actions runner. It will stop working intermittently until being completely removed by 2022-8-30: https://github.blog/changelog/2022-07-20-github-actions-the-macos-10-15-actions-runner-image-is-being-deprecated-and-will-be-removed-by-8-30-22
2022-09-20 15:13:04 -07:00
Alexander Grund abef5a147a Fix ccache saving on cache hit (#211)
See boostorg/boost-ci#166
2022-09-20 15:12:17 -07:00
Luke Mewburn ddcfd00391 Iso doc fixes (#215)
* to_iso_*string() use "." as fractional separator

The fractional separator for the various to_iso_* methods
is "." not "," (per to_iso_string_type() implementation).
Fix the documentation to match the implementation.

* use "ISO 8601" not "iso" in documentation

The standard is "ISO 8601", so use that instead
of just "iso" or "ISO" in comments and documentation.

* fractional seconds only included if non-zero (#110)

Consistently document that the fractional seconds
are only included if non-zero.

Use "where fffffffff" not "were fff".
2022-09-20 15:10:38 -07:00
Antony Polukhin c02d713cef Avoid using likely function as multiple projects define a likely macro (#216) 2022-09-08 04:01:15 -07:00
Povilas Kanapickas b81ed2874f Fix constexpr of gregorian::date::date(special_values) to improve perf (#214)
GCC up to at least 10.2 fail to resolve
gregorian::date::date(special_values) as constexpr function due to
assignment to *this within the constructor. Refactoring constructor to
initialize the instance once leads to large performance improvement.
2022-08-01 03:34:36 -07:00
Quinnsicle 0aed920bfb fix typo in time_period docs (#212)
Co-authored-by: Quinn O'Connor <qoconnor@fastenal.com>
2022-07-02 10:41:51 -07:00
Raphaël Duhen f972dc9656 Fix minor typo (#210)
Thanks!
2022-04-29 09:33:12 -07:00
James E. King III 7677fdce5a Fix appveyor links in readme 2022-04-28 08:08:09 -04:00
James E. King III 8729945096 remove drone config 2022-04-24 21:00:53 -04:00
Owen Rudge cbad9bcec9 Add from_time_t test for 64-bit time_t 2022-03-01 11:15:22 -05:00
Owen Rudge 64fe6586fe Fix from_time_t Y2K38 bug on LLP64 platforms 2022-03-01 11:15:22 -05:00
James E. King III a20a5c8b7c Merge branch 'master' into develop 2022-02-20 06:58:55 -05:00
timmaraju ff77162265 fix signed to unsigned conversion warning (#179)
MSVC 19.28.29336.0 throws the following warning when
boost::date_time::gregorian_date is called.

warning C4365: 'initializing': conversion from 'int' to 'unsigned long', signed/unsigned mismatch
warning C4365: const boost::posix_time::ptime Since1970(boost::gregorian::date(1970U, 1U, 1U));
warning C4365:                                                                                ^
<path>\include\boost\date_time\date.hpp(72,35): message : while evaluating constexpr function 'boost::date_time::gregorian_calendar_base<boost::gregorian::greg_year_month_day,unsigned int>::day_number'
<path>\include\boost\date_time\date.hpp(72,35): message :       : days_(calendar::day_number(ymd_type(y, m, d)))

Co-authored-by: timmaraju <keerthi.timmaraju@teamviewer.com>
2022-02-12 05:53:38 -07:00
James E. King III 0be5d92c90 refresh ci, codecov, readme
- align to current boost-ci practice
- deal with VERY slow test runner in microsec_time_clock test
- disable sanitize tests - too many issues in boost serialization right now
- omit unit tests from coverage
2022-02-11 21:14:28 -05:00
Jeff Garland 33dc6136f1 misc fixes and updates for date-time boost 1.77 (#196)
* Change greg_month and greg_weekday to be not marked as exported/imported (#146)

* Changed greg_month and greg_weekday to be not marked as exported/imported.

Both greg_month and greg_weekday classes are implemented completely in headers,
so they need not be marked with BOOST_DATE_TIME_DECL. For consistency with other
similar classes, they are now marked with BOOST_SYMBOL_VISIBLE.

This should fix linking errors on Windows/MSVC, where all members of greg_month
and greg_weekday classes remain unresolved as they are expected to be
implemented in a shared library.

* Enabled shared and static linking in AppVeyor CI.

* fix new msvc warning in date_parsing with Warn4 - issue #148

* Cast month numbers to the correct type in map init (#152)

Since the map contains unsigned short for month numbers, it is more correct to explicitly cast constants to that type rather than short.

* Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74 (#150)

* Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers.

* Change BOOST_BORLANDC back to __BORLANDC__ for non-posix functionality.

* Include the header file.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Revert "Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero."

This reverts commit 88e45e951b.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Remove separate outside of template class friend functions.

* Define all the friend functions outside the class to conform with the necessity of Embarcadero C++ clang-based compilers that need the friend functions in exported/imported classes to be defined outside the class. This is an Embarcadero C++ clang-based compiler bug which i reported to Embarcadero.

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* tune: add initial cmake configuration (#151)

* tune: add initial cmake configuration

* bugfix: Incorrect library alias

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings. (#155)

Also fix Clang -Wextra-semi-stmt and Clang-tidy readability-container-size-empty warnings.
Alphabetical order of STL headers.
Fix some misspellings.

Co-authored-by: Eugene Zelenko <eugene@diakopto.com>

* Break DateTime <-> Serialization circular dependency (#154)

Breaks DateTime -> Serialization -> Spirit -> Thread -> DateTime chain.

The Serialization documentation seems to be explicitly allow this:
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/traits.html#version
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/serialization.html#splitting

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Fix clang 10 C++17 warnings about deprecated implicit assignment operators. (#158)

C++17 deprecates implicit generation of assignment operator in presence of
explicitly declared copy constructor. In future standards this behavior may
be removed.

In the affected Boost.DateTime classes, the explicitly defined copy
constructors are functionally equivalent to those would be generated
implicitly, so we can just remove them. The additional benefit is that the
implicitly generated ones will have constexpr and noexcept specifications,
and will also allow implicit move constructors and assignment operators.

* Suppress MSVC CRT deprecations on Clang (#160)

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Add BOOST_CXX14_CONSTEXPR to CV assign() (#161)

Without this change the BOOST_CXX14_CONSTEXPR on the constructors has no
effect, as they invoke assign()

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* add constexpr tests to date, ptime, constrained_value (#162)

* merge some doc changes for constexpr fix (#163)

* add constexpr tests to date, ptime, constrained_value

* add some docs for 1.74 release

* const-qualify retrieval and comparison methods of time_itr and date_itr_base (#170)

* [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's  compilation level, without having to search the library's documentation to find this out. (#178)

* add drone config [ci skip] (#180)

* Add GitHub Actions config [ci skip] (#182)

* Update README.md

* Update README.md

* Update README.md

fixup comments on readme to match header_only status

* fix #189 for autolink -- driveby change to remove gcc2.95 support (#191)

* ptime from iso error string error with date only (#192)

* fix #189 for autolink -- driveby change to remove gcc2.95 support

* fix #187 date-only case to avoid string exception, beef up error case test

* ci updates (#194)

* fix #189 for autolink -- driveby change to remove gcc2.95 support

* fix #187 date-only case to avoid string exception, beef up error case test

* attempted fix for #193 - ci issues

* attempted fix for #193 - ci issues try 2

* attempted fix for #193 - ci issues try 3

* attempted fix for #193 - ci issues try 4

* attempted fix for #193 - ci issues try 4a

* attempted fix for #193 - ci issues try 5

* attempted fix for #193 - ci issues try 6

* attempted fix for #193 - ci issues try 7 - rm clang 3.8

* Regenerate CMakeLists.txt

* Add stub source file

Co-authored-by: Andrey Semashev <Lastique@users.noreply.github.com>
Co-authored-by: Edward Diener <eldlistmailingz@tropicsoft.com>
Co-authored-by: tapika <tapika@yahoo.com>
Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
Co-authored-by: Eugene Zelenko <eugene@diakopto.com>
Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>
Co-authored-by: Roger Orr <rogero@howzatt.co.uk>
Co-authored-by: klaus triendl <klaus@triendl.eu>
Co-authored-by: Sam Darwin <samuel.d.darwin@gmail.com>
Co-authored-by: Peter Dimov <pdimov@gmail.com>
2021-06-28 08:14:45 -07:00
Jeff Garland 7156392706 Merge branch 'master' into develop 2021-06-28 07:55:17 -07:00
Peter Dimov 561ccb878d Add stub source file 2021-06-08 21:52:12 +03:00
Peter Dimov 3feaece6d2 Regenerate CMakeLists.txt 2021-06-08 21:51:59 +03:00
Peter Dimov 9970590094 Add stub source file 2021-05-28 01:27:21 +03:00
Peter Dimov 4b97311ca7 Regenerate CMakeLists.txt 2021-05-28 01:26:14 +03:00
Jeff Garland a94bcf288d ci updates (#194)
* fix #189 for autolink -- driveby change to remove gcc2.95 support

* fix #187 date-only case to avoid string exception, beef up error case test

* attempted fix for #193 - ci issues

* attempted fix for #193 - ci issues try 2

* attempted fix for #193 - ci issues try 3

* attempted fix for #193 - ci issues try 4

* attempted fix for #193 - ci issues try 4a

* attempted fix for #193 - ci issues try 5

* attempted fix for #193 - ci issues try 6

* attempted fix for #193 - ci issues try 7 - rm clang 3.8
2021-05-02 17:27:18 -07:00
Jeff Garland 8011fdf0bc ptime from iso error string error with date only (#192)
* fix #189 for autolink -- driveby change to remove gcc2.95 support

* fix #187 date-only case to avoid string exception, beef up error case test
2021-05-02 08:57:36 -07:00
Jeff Garland 15be01a02d fix #189 for autolink -- driveby change to remove gcc2.95 support (#191) 2021-04-30 11:51:48 -07:00
Jeff Garland acbee0dc6a Update README.md
fixup comments on readme to match header_only status
2021-03-23 08:28:14 -07:00
Jeff Garland aa9c5dfd48 Update README.md 2021-03-23 08:26:07 -07:00
Jeff Garland 47de78e4fc Update README.md 2021-03-23 08:25:32 -07:00
Jeff Garland 79ca1aa0a7 Merge minor date-time updates for boost 1.76 (#183)
* Change greg_month and greg_weekday to be not marked as exported/imported (#146)

* Changed greg_month and greg_weekday to be not marked as exported/imported.

Both greg_month and greg_weekday classes are implemented completely in headers,
so they need not be marked with BOOST_DATE_TIME_DECL. For consistency with other
similar classes, they are now marked with BOOST_SYMBOL_VISIBLE.

This should fix linking errors on Windows/MSVC, where all members of greg_month
and greg_weekday classes remain unresolved as they are expected to be
implemented in a shared library.

* Enabled shared and static linking in AppVeyor CI.

* fix new msvc warning in date_parsing with Warn4 - issue #148

* Cast month numbers to the correct type in map init (#152)

Since the map contains unsigned short for month numbers, it is more correct to explicitly cast constants to that type rather than short.

* Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74 (#150)

* Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers.

* Change BOOST_BORLANDC back to __BORLANDC__ for non-posix functionality.

* Include the header file.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Revert "Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero."

This reverts commit 88e45e951b.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Remove separate outside of template class friend functions.

* Define all the friend functions outside the class to conform with the necessity of Embarcadero C++ clang-based compilers that need the friend functions in exported/imported classes to be defined outside the class. This is an Embarcadero C++ clang-based compiler bug which i reported to Embarcadero.

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* tune: add initial cmake configuration (#151)

* tune: add initial cmake configuration

* bugfix: Incorrect library alias

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings. (#155)

Also fix Clang -Wextra-semi-stmt and Clang-tidy readability-container-size-empty warnings.
Alphabetical order of STL headers.
Fix some misspellings.

Co-authored-by: Eugene Zelenko <eugene@diakopto.com>

* Break DateTime <-> Serialization circular dependency (#154)

Breaks DateTime -> Serialization -> Spirit -> Thread -> DateTime chain.

The Serialization documentation seems to be explicitly allow this:
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/traits.html#version
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/serialization.html#splitting

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Fix clang 10 C++17 warnings about deprecated implicit assignment operators. (#158)

C++17 deprecates implicit generation of assignment operator in presence of
explicitly declared copy constructor. In future standards this behavior may
be removed.

In the affected Boost.DateTime classes, the explicitly defined copy
constructors are functionally equivalent to those would be generated
implicitly, so we can just remove them. The additional benefit is that the
implicitly generated ones will have constexpr and noexcept specifications,
and will also allow implicit move constructors and assignment operators.

* Suppress MSVC CRT deprecations on Clang (#160)

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Add BOOST_CXX14_CONSTEXPR to CV assign() (#161)

Without this change the BOOST_CXX14_CONSTEXPR on the constructors has no
effect, as they invoke assign()

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* add constexpr tests to date, ptime, constrained_value (#162)

* merge some doc changes for constexpr fix (#163)

* add constexpr tests to date, ptime, constrained_value

* add some docs for 1.74 release

* const-qualify retrieval and comparison methods of time_itr and date_itr_base (#170)

* [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's  compilation level, without having to search the library's documentation to find this out. (#178)

* add drone config [ci skip] (#180)

* Add GitHub Actions config [ci skip] (#182)

Co-authored-by: Andrey Semashev <Lastique@users.noreply.github.com>
Co-authored-by: Edward Diener <eldlistmailingz@tropicsoft.com>
Co-authored-by: tapika <tapika@yahoo.com>
Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
Co-authored-by: Eugene Zelenko <eugene@diakopto.com>
Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>
Co-authored-by: Roger Orr <rogero@howzatt.co.uk>
Co-authored-by: klaus triendl <klaus@triendl.eu>
Co-authored-by: Sam Darwin <samuel.d.darwin@gmail.com>
2021-03-05 08:49:04 -07:00
Sam Darwin ccc21804bd Add GitHub Actions config [ci skip] (#182) 2021-03-04 12:59:38 -07:00
Sam Darwin 31c983b256 add drone config [ci skip] (#180) 2021-01-26 16:17:52 -07:00
Edward Diener f92b2b3bfc [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. (#178) 2021-01-19 17:59:35 -07:00
klaus triendl b43d605ad2 const-qualify retrieval and comparison methods of time_itr and date_itr_base (#170) 2020-09-03 16:19:53 -07:00
Jeff Garland fa46e55ca8 final merges for 1.74 (#164)
* Change greg_month and greg_weekday to be not marked as exported/imported (#146)

* Changed greg_month and greg_weekday to be not marked as exported/imported.

Both greg_month and greg_weekday classes are implemented completely in headers,
so they need not be marked with BOOST_DATE_TIME_DECL. For consistency with other
similar classes, they are now marked with BOOST_SYMBOL_VISIBLE.

This should fix linking errors on Windows/MSVC, where all members of greg_month
and greg_weekday classes remain unresolved as they are expected to be
implemented in a shared library.

* Enabled shared and static linking in AppVeyor CI.

* fix new msvc warning in date_parsing with Warn4 - issue #148

* Cast month numbers to the correct type in map init (#152)

Since the map contains unsigned short for month numbers, it is more correct to explicitly cast constants to that type rather than short.

* Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74 (#150)

* Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers.

* Change BOOST_BORLANDC back to __BORLANDC__ for non-posix functionality.

* Include the header file.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Revert "Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero."

This reverts commit 88e45e951b.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Remove separate outside of template class friend functions.

* Define all the friend functions outside the class to conform with the necessity of Embarcadero C++ clang-based compilers that need the friend functions in exported/imported classes to be defined outside the class. This is an Embarcadero C++ clang-based compiler bug which i reported to Embarcadero.

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* tune: add initial cmake configuration (#151)

* tune: add initial cmake configuration

* bugfix: Incorrect library alias

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings. (#155)

Also fix Clang -Wextra-semi-stmt and Clang-tidy readability-container-size-empty warnings.
Alphabetical order of STL headers.
Fix some misspellings.

Co-authored-by: Eugene Zelenko <eugene@diakopto.com>

* Break DateTime <-> Serialization circular dependency (#154)

Breaks DateTime -> Serialization -> Spirit -> Thread -> DateTime chain.

The Serialization documentation seems to be explicitly allow this:
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/traits.html#version
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/serialization.html#splitting

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Fix clang 10 C++17 warnings about deprecated implicit assignment operators. (#158)

C++17 deprecates implicit generation of assignment operator in presence of
explicitly declared copy constructor. In future standards this behavior may
be removed.

In the affected Boost.DateTime classes, the explicitly defined copy
constructors are functionally equivalent to those would be generated
implicitly, so we can just remove them. The additional benefit is that the
implicitly generated ones will have constexpr and noexcept specifications,
and will also allow implicit move constructors and assignment operators.

* Suppress MSVC CRT deprecations on Clang (#160)

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* Add BOOST_CXX14_CONSTEXPR to CV assign() (#161)

Without this change the BOOST_CXX14_CONSTEXPR on the constructors has no
effect, as they invoke assign()

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>

* add constexpr tests to date, ptime, constrained_value (#162)

* merge some doc changes for constexpr fix (#163)

* add constexpr tests to date, ptime, constrained_value

* add some docs for 1.74 release

Co-authored-by: Andrey Semashev <Lastique@users.noreply.github.com>
Co-authored-by: Edward Diener <eldlistmailingz@tropicsoft.com>
Co-authored-by: tapika <tapika@yahoo.com>
Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
Co-authored-by: Eugene Zelenko <eugene@diakopto.com>
Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>
Co-authored-by: Roger Orr <rogero@howzatt.co.uk>
2020-07-16 09:01:11 -07:00
Jeff Garland 61677ba228 merge some doc changes for constexpr fix (#163)
* add constexpr tests to date, ptime, constrained_value

* add some docs for 1.74 release
2020-07-13 08:12:09 -07:00
Jeff Garland 30795441e4 add constexpr tests to date, ptime, constrained_value (#162) 2020-07-09 08:06:58 -07:00
Roger Orr 77495803c1 Add BOOST_CXX14_CONSTEXPR to CV assign() (#161)
Without this change the BOOST_CXX14_CONSTEXPR on the constructors has no
effect, as they invoke assign()

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>
2020-07-08 08:41:24 -07:00
Nikita Kniazev 247424d08d Suppress MSVC CRT deprecations on Clang (#160)
Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>
2020-07-08 07:56:10 -07:00
Andrey Semashev 76852e4aab Fix clang 10 C++17 warnings about deprecated implicit assignment operators. (#158)
C++17 deprecates implicit generation of assignment operator in presence of
explicitly declared copy constructor. In future standards this behavior may
be removed.

In the affected Boost.DateTime classes, the explicitly defined copy
constructors are functionally equivalent to those would be generated
implicitly, so we can just remove them. The additional benefit is that the
implicitly generated ones will have constexpr and noexcept specifications,
and will also allow implicit move constructors and assignment operators.
2020-06-23 13:28:16 -07:00
Nikita Kniazev 356c5c2600 Break DateTime <-> Serialization circular dependency (#154)
Breaks DateTime -> Serialization -> Spirit -> Thread -> DateTime chain.

The Serialization documentation seems to be explicitly allow this:
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/traits.html#version
https://www.boost.org/doc/libs/1_73_0/libs/serialization/doc/serialization.html#splitting

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>
2020-05-25 09:39:21 -07:00
EugeneZelenko 3d55c15cbb Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings. (#155)
Also fix Clang -Wextra-semi-stmt and Clang-tidy readability-container-size-empty warnings.
Alphabetical order of STL headers.
Fix some misspellings.

Co-authored-by: Eugene Zelenko <eugene@diakopto.com>
2020-05-23 07:19:59 -07:00
tapika d77ee59bc2 tune: add initial cmake configuration (#151)
* tune: add initial cmake configuration

* bugfix: Incorrect library alias

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>
2020-05-18 13:59:29 -07:00
Edward Diener 5093074e0e Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74 (#150)
* Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers.

* Change BOOST_BORLANDC back to __BORLANDC__ for non-posix functionality.

* Include the header file.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Revert "Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero."

This reverts commit 88e45e951b.

* Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero.

* Remove separate outside of template class friend functions.

* Define all the friend functions outside the class to conform with the necessity of Embarcadero C++ clang-based compilers that need the friend functions in exported/imported classes to be defined outside the class. This is an Embarcadero C++ clang-based compiler bug which i reported to Embarcadero.

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>
2020-05-04 09:09:57 -07:00
Andrey Semashev ecf042f538 Cast month numbers to the correct type in map init (#152)
Since the map contains unsigned short for month numbers, it is more correct to explicitly cast constants to that type rather than short.
2020-05-03 07:52:25 -07:00
JeffGarland d0b3c1da88 fix new msvc warning in date_parsing with Warn4 - issue #148 2020-04-10 06:27:11 -07:00
Andrey Semashev e9a9ce3e35 Change greg_month and greg_weekday to be not marked as exported/imported (#146)
* Changed greg_month and greg_weekday to be not marked as exported/imported.

Both greg_month and greg_weekday classes are implemented completely in headers,
so they need not be marked with BOOST_DATE_TIME_DECL. For consistency with other
similar classes, they are now marked with BOOST_SYMBOL_VISIBLE.

This should fix linking errors on Windows/MSVC, where all members of greg_month
and greg_weekday classes remain unresolved as they are expected to be
implemented in a shared library.

* Enabled shared and static linking in AppVeyor CI.
2020-04-06 08:55:36 -07:00
55 changed files with 720 additions and 613 deletions
+116
View File
@@ -0,0 +1,116 @@
# Copyright 2016, 2017 Peter Dimov
# Copyright 2017 - 2019 James E. King III
# Copyright 2019 - 2021 Alexander Grund
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
#
# Generic Appveyor build script for boostorg repositories
# See: https://github.com/boostorg/boost-ci/
#
# Instructions for customizing this script for your library:
#
# 1. Customize the compilers and language levels you want.
# 2. If you have more than include/, src/, test/, example/, examples/,
# benchmark/ or tools/ directories, set the environment variable DEPINST.
# For example if your build uses code in "bench/" and "fog/" directories:
# - DEPINST: --include bench --include fog
# 3. Enable pull request builds in your boostorg/<library> account.
#
# That's it - the script will do everything else for you.
#
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
- /bugfix\/.*/
- /feature\/.*/
- /fix\/.*/
- /pr\/.*/
matrix:
fast_finish: false
# Adding MAYFAIL to any matrix job allows it to fail but the build stays green:
allow_failures:
- MAYFAIL: true
environment:
global:
B2_CI_VERSION: 1
GIT_FETCH_JOBS: 4
# see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
# to use the default for a given environment, comment it out; recommend you build debug and release however:
# on Windows it is important to exercise all the possibilities, especially shared vs static, however most
# libraries that care about this exercise it in their Jamfiles...
B2_ADDRESS_MODEL: 32,64
B2_LINK: shared,static
# B2_THREADING: threading=multi,single
B2_VARIANT: release
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
matrix:
- FLAVOR: Visual Studio 2017 C++2a Strict
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_CXXFLAGS: -permissive-
B2_CXXSTD: 2a
B2_TOOLSET: msvc-14.1
- FLAVOR: Visual Studio 2017 C++14/17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_CXXSTD: 14,17
B2_TOOLSET: msvc-14.1
- FLAVOR: clang-cl
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_ADDRESS_MODEL: 64
B2_CXXSTD: 11,14,17
B2_TOOLSET: clang-win
- FLAVOR: Visual Studio 2015, 2013
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
B2_TOOLSET: msvc-12.0,msvc-14.0
- FLAVOR: Visual Studio 2008, 2010, 2012
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
B2_TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
B2_ADDRESS_MODEL: 32 # No 64bit support
- FLAVOR: cygwin (32-bit)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ADDPATH: C:\cygwin\bin;
B2_ADDRESS_MODEL: 32
B2_CXXSTD: 03,11,14,1z
B2_THREADING: threadapi=pthread
B2_TOOLSET: gcc
- FLAVOR: cygwin (64-bit)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ADDPATH: C:\cygwin64\bin;
B2_ADDRESS_MODEL: 64
B2_CXXSTD: 03,11,14,1z
B2_THREADING: threadapi=pthread
B2_TOOLSET: gcc
- FLAVOR: mingw64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
B2_ADDRESS_MODEL: 64
B2_CXXSTD: 03,11,14,17,2a
B2_TOOLSET: gcc
install:
- git clone --depth 1 https://github.com/boostorg/boost-ci.git C:\boost-ci-cloned
# Copy ci folder if not testing Boost.CI
- if NOT "%APPVEYOR_PROJECT_NAME%" == "boost-ci" xcopy /s /e /q /i /y C:\boost-ci-cloned\ci .\ci
- rmdir /s /q C:\boost-ci-cloned
- ci\appveyor\install.bat
build: off
test_script: ci\build.bat
+23
View File
@@ -0,0 +1,23 @@
# Copyright 2019 - 2021 Alexander Grund
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
#
# Sample codecov configuration file. Edit as required
codecov:
max_report_age: off
require_ci_to_pass: yes
notify:
# Increase this if you have multiple coverage collection jobs
after_n_builds: 2
wait_for_ci: yes
# Change how pull request comments look
comment:
layout: "reach,diff,flags,files,footer"
# Ignore specific files or folders. Glob patterns are supported.
# See https://docs.codecov.com/docs/ignoring-paths
ignore:
- libs/date_time/test/
- test
+50
View File
@@ -0,0 +1,50 @@
#
# Copyright 2020-2021 Peter Dimov
# Copyright 2021 Andrey Semashev
# Copyright 2021-2024 Alexander Grund
# Copyright 2022-2025 James E. King III
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
#
# This workflow uses the Boost.CI reusable workflow which builds a variety of
# configurations of your project, runs tests, and generates code coverage reports.
#
# To use it, copy this file into your repository as `.github/workflows/ci.yml` and
# customize it appropriately.
#
---
name: Boost.CI
on:
pull_request:
push:
branches:
- master
- develop
- bugfix/**
- feature/**
- fix/**
- pr/**
paths-ignore:
- LICENSE
- meta/**
- README.md
jobs:
call-boost-ci:
name: Run Boost.CI
uses: boostorg/boost-ci/.github/workflows/reusable.yml@master
with:
# no endian branches
enable_multiarch: false
# serialization has issues, not enough time to add suppressions
enable_sanitizers: false
# these compilers fail
exclude_compiler: 'gcc-4.7,gcc-4.8,gcc-4.9,gcc-5,clang-3.5,clang-3.6,clang-3.7,clang-3.8'
# the tests take a while; this reduces the load a bit and there isn't any C++20 specific code
exclude_cxxstd: '98,03,0x,2a,20'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
-231
View File
@@ -1,231 +0,0 @@
# Copyright 2016 Peter Dimov
# Copyright 2017 - 2019 James E. King III
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
#
# Generic Travis CI build script for boostorg repositories
# See: https://github.com/boostorg/boost-ci
#
# Instructions for customizing this script for your library:
#
# 1. Customize the compilers and language levels you want in the 'jobs'.
# 2. If you have more than include/, src/, test/, example/, examples/, or
# tools/ directories, modify your Travis CI project and add the environment
# variable DEPINST. For example if your build uses code in "bench/" and
# "fog/" directories, then set DEPINST to the following:
# --include bench --include fog
# 3. If you want to enable Coverity Scan, you need to provide the environment
# variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in
# your github settings.
# 4. Enable pull request builds in your boostorg/<library> account.
#
# That's it - the scripts will do everything else for you.
dist: xenial
language: cpp
env:
global:
# see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
# - B2_ADDRESS_MODEL=address-model=64,32
# - B2_LINK=link=shared,static
# - B2_THREADING=threading=multi,single
- B2_VARIANT=variant=release
install:
- git clone https://github.com/boostorg/boost-ci.git boost-ci
- cp -pr boost-ci/ci boost-ci/.codecov.yml .
- source ci/travis/install.sh
addons:
apt:
packages:
- binutils-gold
- gdb
- libc6-dbg
branches:
only:
- master
- develop
- /bugfix\/.*/
- /feature\/.*/
- /fix\/.*/
- /pr\/.*/
script:
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/build.sh
#
# Default toolsets in Ubuntu
#
# trusty xenial bionic
# 14.04 16.04 18.04
# ------ ------ ------
# clang 3.4 3.8 6.0
# gcc 4.8.2 5.3.1 7.3.0
#
anchors:
clang-38: &clang-38 { apt: { packages: [ "clang-3.8",
"libstdc++-6-dev" ], sources: [ "llvm-toolchain-xenial-3.8",
"ubuntu-toolchain-r-test" ] } }
clang-4: &clang-4 { apt: { packages: [ "clang-4.0",
"libstdc++-6-dev" ], sources: [ "llvm-toolchain-xenial-4.0",
"ubuntu-toolchain-r-test" ] } }
clang-5: &clang-5 { apt: { packages: [ "clang-5.0",
"libstdc++-7-dev" ], sources: [ "llvm-toolchain-xenial-5.0",
"ubuntu-toolchain-r-test" ] } }
clang-6: &clang-6 { apt: { packages: [ "clang-6.0",
"libc6-dbg",
"libc++-dev",
"libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-6.0",
"ubuntu-toolchain-r-test" ] } }
clang-7: &clang-7 { apt: { packages: [ "clang-7",
"libc6-dbg",
"libc++-dev",
"libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-7",
"ubuntu-toolchain-r-test" ] } }
clang-8: &clang-8 { apt: { packages: [ "clang-8",
"libc6-dbg",
"libc++-dev",
"libstdc++-8-dev" ], sources: [ "llvm-toolchain-xenial-8",
"ubuntu-toolchain-r-test" ] } }
gcc-48: &gcc-48 { apt: { packages: [ "g++-4.8" ] } }
gcc-49: &gcc-49 { apt: { packages: [ "g++-4.9" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-5: &gcc-5 { apt: { packages: [ "g++-5" ] } }
gcc-6: &gcc-6 { apt: { packages: [ "g++-6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-7: &gcc-7 { apt: { packages: [ "g++-7" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-8: &gcc-8 { apt: { packages: [ "g++-8" ], sources: [ "ubuntu-toolchain-r-test" ] } }
gcc-9: &gcc-9 { apt: { packages: [ "g++-9" ], sources: [ "ubuntu-toolchain-r-test" ] } }
jobs:
allow_failures:
# https://github.com/boostorg/date_time/issues/111
- env:
- COMMENT=ubsan
- B2_VARIANT=variant=debug
- B2_TOOLSET=gcc-8
- B2_CXXSTD=03,11,14
- B2_CXXFLAGS="undefined-sanitizer=norecover"
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
- B2_LINKFLAGS="linkflags=-fuse-ld=gold"
- UBSAN_OPTIONS=print_stacktrace=1
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
include:
# libstdc++
- { os: "linux", dist: "trusty", # xenial has libstdc++ from gcc 5.4.0 with newer ABI
env: [ "B2_TOOLSET=gcc-4.8", "B2_CXXSTD=03,11", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *gcc-48 }
- { os: "linux", dist: "trusty", # xenial has libstdc++ from gcc 5.4.0 with newer ABI
env: [ "B2_TOOLSET=gcc-4.9", "B2_CXXSTD=03,11", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *gcc-49 }
- { os: "linux", env: [ "B2_TOOLSET=gcc-5", "B2_CXXSTD=03,11" ], addons: *gcc-5 }
- { os: "linux", env: [ "B2_TOOLSET=gcc-6", "B2_CXXSTD=11,14", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *gcc-6 }
- { os: "linux", env: [ "B2_TOOLSET=gcc-7", "B2_CXXSTD=14,17", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *gcc-7 }
- { os: "linux", env: [ "B2_TOOLSET=gcc-8", "B2_CXXSTD=17,2a", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *gcc-8 }
- { os: "linux", env: [ "B2_TOOLSET=gcc-9", "B2_CXXSTD=17,2a", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *gcc-9 }
- { os: "linux", dist: "trusty", # xenial has libstdc++ from gcc 5.4.0 with newer ABI
env: [ "B2_TOOLSET=clang-3.8", "B2_CXXSTD=03,11", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *clang-38 }
- { os: "linux", env: [ "B2_TOOLSET=clang-4.0", "B2_CXXSTD=11,14", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *clang-4 }
- { os: "linux", env: [ "B2_TOOLSET=clang-5.0", "B2_CXXSTD=11,14", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *clang-5 }
- { os: "linux", env: [ "B2_TOOLSET=clang-6.0", "B2_CXXSTD=14,17", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *clang-6 }
- { os: "linux", env: [ "B2_TOOLSET=clang-7", "B2_CXXSTD=17,2a", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *clang-7 }
- { os: "linux", env: [ "B2_TOOLSET=clang-8", "B2_CXXSTD=17,2a", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ], addons: *clang-8 }
# libc++
- { os: "linux", env: [ "B2_TOOLSET=clang-6.0", "B2_CXXSTD=03,11,14",
"B2_CXXFLAGS=-stdlib=libc++" ], addons: *clang-6 }
- { os: "osx" , env: [ "B2_TOOLSET=clang", "B2_CXXSTD=03,11,17", "BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1" ] }
# to enable Intel ICC define INTEL_ICC_SERIAL_NUMBER and the following:
# - { os: "linux", env: [ "B2_TOOLSET=intel-linux", "B2_CXXSTD=11,14,17" ], addons: *gcc-7,
# script: cd $BOOST_ROOT/libs/$SELF && ci/travis/intelicc.sh }
- os: linux
env:
- COMMENT=codecov.io
- B2_CXXSTD=03,11
- B2_TOOLSET=gcc-8
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
addons: *gcc-8
script:
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/codecov.sh
- os: linux
env:
- COMMENT=asan
- B2_VARIANT=variant=debug
- B2_TOOLSET=gcc-8
- B2_CXXSTD=03,11,14
- B2_CXXFLAGS="address-sanitizer=norecover"
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
addons: *gcc-8
- os: linux
env:
- COMMENT=tsan
- B2_VARIANT=variant=debug
- B2_TOOLSET=gcc-8
- B2_CXXSTD=03,11,14
- B2_CXXFLAGS="thread-sanitizer=norecover"
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
addons: *gcc-8
- os: linux
env:
- COMMENT=ubsan
- B2_VARIANT=variant=debug
- B2_TOOLSET=gcc-8
- B2_CXXSTD=03,11,14
- B2_CXXFLAGS="undefined-sanitizer=norecover"
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
# https://github.com/boostorg/build/issues/451 using the gold linker to work around an issue
- B2_LINKFLAGS="linkflags=-fuse-ld=gold"
- UBSAN_OPTIONS=print_stacktrace=1
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
addons: *gcc-8
- os: linux
env:
- COMMENT=valgrind
- B2_TOOLSET=clang-6.0
- B2_CXXSTD=03,11,14
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
- B2_VARIANT=variant=debug
- B2_TESTFLAGS=testing.launcher=valgrind
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
- VALGRIND_OPTS=--error-exitcode=1
addons: *clang-6
script:
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/valgrind.sh
# - os: linux
# env:
# - COMMENT=cppcheck
# script:
# - cd $BOOST_ROOT/libs/$SELF
# - ci/travis/cppcheck.sh
#################### Jobs to run on pushes to master, develop ###################
# Coverity Scan
- os: linux
if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (develop, master)) AND (type IN (cron, push))
env:
- COMMENT="Coverity Scan"
- B2_TOOLSET=clang
- BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
script:
- cd $BOOST_ROOT/libs/$SELF
- ci/travis/coverity.sh
notifications:
email:
false
+4
View File
@@ -0,0 +1,4 @@
# https://github.com/boostorg/serialization/issues/122
vptr:/usr/include/c++/*/bits/ios_base.h
# https://github.com/boostorg/serialization/issues/193
# could not figure out how to suppress it
+44 -13
View File
@@ -1,21 +1,52 @@
# Copyright 2020 Tarmo Pikaro
# Generated by `boostdep --cmake date_time`
# Copyright 2020 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required( VERSION 3.5 )
project( BoostDateTime LANGUAGES CXX)
cmake_minimum_required(VERSION 3.5...3.16)
add_library( boost_date_time
src/gregorian/greg_month.cpp
)
add_library( Boost::date_time ALIAS boost_date_time )
project(boost_date_time VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
target_include_directories( boost_date_time PUBLIC include )
target_link_libraries( boost_date_time
PUBLIC
Boost::config
add_library(boost_date_time
src/gregorian/greg_month.cpp
)
add_library(Boost::date_time ALIAS boost_date_time)
target_include_directories(boost_date_time PUBLIC include)
target_link_libraries(boost_date_time
PUBLIC
Boost::algorithm
Boost::assert
Boost::config
Boost::core
Boost::io
Boost::lexical_cast
Boost::numeric_conversion
Boost::range
Boost::smart_ptr
Boost::throw_exception
Boost::tokenizer
Boost::type_traits
Boost::utility
Boost::winapi
)
target_compile_definitions(boost_date_time
PUBLIC BOOST_DATE_TIME_NO_LIB
PRIVATE BOOST_DATE_TIME_SOURCE
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_date_time PUBLIC BOOST_DATE_TIME_DYN_LINK)
else()
target_compile_definitions(boost_date_time PUBLIC BOOST_DATE_TIME_STATIC_LINK)
endif()
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
-11
View File
@@ -1,11 +0,0 @@
# Boost.DateTime Library Jamfile
#
# Copyright (c) 2018 James E. King III
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# please order by name to ease maintenance
build-project example ;
build-project test ;
+19 -17
View File
@@ -6,28 +6,31 @@ Distributed under the [Boost Software License, Version 1.0](http://www.boost.org
### Properties
* C++03
* Requires Linking
* C++11
* Header only
### Build Status
Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
:-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
[`master`](https://github.com/boostorg/date_time/tree/master) | [![Build Status](https://travis-ci.org/boostorg/date_time.svg?branch=master)](https://travis-ci.org/boostorg/date_time) | [![Build status](https://ci.appveyor.com/api/projects/status/upf5c528fy09fudk?svg=true)](https://ci.appveyor.com/project/jeking3/date-time-1evbf) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/14908/badge.svg)](https://scan.coverity.com/projects/boostorg-date_time) | [![codecov](https://codecov.io/gh/boostorg/date_time/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/date_time/branch/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/date_time.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/date_time.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/date_time.html)
[`develop`](https://github.com/boostorg/date_time/tree/develop) | [![Build Status](https://travis-ci.org/boostorg/date_time.svg?branch=develop)](https://travis-ci.org/boostorg/date_time) | [![Build status](https://ci.appveyor.com/api/projects/status/upf5c528fy09fudk/branch/develop?svg=true)](https://ci.appveyor.com/project/boostorg/date_time/branch/develop) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/14908/badge.svg)](https://scan.coverity.com/projects/boostorg-date_time) | [![codecov](https://codecov.io/gh/boostorg/date_time/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/date_time/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/date_time.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/date_time.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/date_time.html)
<!-- boost-ci/tools/makebadges.sh --repo date_time --appveyorbadge upf5c528fy09fudk --codecovbadge nDoh7t8f6g --coverity 14908 -->
| Branch | GHA CI | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
| :-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
| [`master`](https://github.com/boostorg/date_time/tree/master) | [![Build Status](https://github.com/boostorg/date_time/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/date_time/actions?query=branch:master) | [![Build status](https://ci.appveyor.com/api/projects/status/upf5c528fy09fudk/branch/master?svg=true)](https://ci.appveyor.com/project/cppalliance/date-time/branch/master) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/14908/badge.svg)](https://scan.coverity.com/projects/boostorg-date_time) | [![codecov](https://codecov.io/gh/boostorg/date_time/branch/master/graph/badge.svg?token=nDoh7t8f6g)](https://codecov.io/gh/boostorg/date_time/tree/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/date_time.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](https://www.boost.org/doc/libs/master/libs/date_time) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](https://www.boost.org/development/tests/master/developer/date_time.html) |
| [`develop`](https://github.com/boostorg/date_time/tree/develop) | [![Build Status](https://github.com/boostorg/date_time/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/date_time/actions?query=branch:develop) | [![Build status](https://ci.appveyor.com/api/projects/status/upf5c528fy09fudk/branch/develop?svg=true)](https://ci.appveyor.com/project/cppalliance/date-time/branch/develop) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/14908/badge.svg)](https://scan.coverity.com/projects/boostorg-date_time) | [![codecov](https://codecov.io/gh/boostorg/date_time/branch/develop/graph/badge.svg?token=nDoh7t8f6g)](https://codecov.io/gh/boostorg/date_time/tree/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/date_time.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](https://www.boost.org/doc/libs/develop/libs/date_time) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](https://www.boost.org/development/tests/develop/developer/date_time.html) |
### Directories
| Name | Purpose |
| --------- | ------------------------------ |
| `build` | build script for link library |
| `data` | timezone database |
| `doc` | documentation |
| `example` | use case examples |
| `include` | headers |
| `src` | source code for link library |
| `test` | unit tests |
| `xmldoc` | additional documentation |
Note that the built library is only for build backward compatibility and contains no symbols. date_time is now header only.
| Name | Purpose |
| --------- | --------------------------------------- |
| `build` | build script for optional lib build |
| `data` | timezone database |
| `doc` | documentation |
| `example` | use case examples |
| `include` | headers |
| `src` | source code for optional link library |
| `test` | unit tests |
| `xmldoc` | documentation source |
### More information
@@ -35,4 +38,3 @@ Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs |
* [Report bugs](https://github.com/boostorg/date_time/issues): Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
* [Submit Pull Requests](https://github.com/boostorg/date_time/pulls) against the **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt). Be sure to include tests proving your changes work properly.
* Discussions about the library are held on the [Boost developers mailing list](http://www.boost.org/community/groups.html#main). Be sure to read the [discussion policy](http://www.boost.org/community/policy.html) before posting and add the `[date_time]` tag at the beginning of the subject line.
-157
View File
@@ -1,157 +0,0 @@
# Copyright 2016, 2017 Peter Dimov
# Copyright (C) 2017 - 2019 James E. King III
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
#
# Generic Appveyor build script for boostorg repositories
# See: https://github.com/boostorg/boost-ci/
#
# Instructions for customizing this script for your library:
#
# 1. Customize the compilers and language levels you want.
# 2. If you have more than include/, src/, test/, example/, examples/,
# benchmark/ or tools/ directories, set the environment variable DEPINST.
# For example if your build uses code in "bench/" and "fog/" directories:
# - DEPINST: --include bench --include fog
# 3. Enable pull request builds in your boostorg/<library> account.
#
# That's it - the script will do everything else for you.
#
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
- /bugfix\/.*/
- /feature\/.*/
- /fix\/.*/
- /pr\/.*/
matrix:
# Adding MAYFAIL to any matrix job allows it to fail but the build stays green:
allow_failures:
- MAYFAIL: true
environment:
global:
# see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
# to use the default for a given environment, comment it out; recommend you build debug and release however:
# on Windows it is important to exercise all the possibilities, especially shared vs static, however most
# libraries that care about this exercise it in their Jamfiles...
# B2_ADDRESS_MODEL: address-model=64,32
# B2_THREADING: threading=multi,single
B2_LINK: link=shared,static
B2_VARIANT: variant=release
matrix:
- FLAVOR: Visual Studio 2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
B2_ADDRESS_MODEL: address-model=64
B2_CXXFLAGS: cxxflags=-permissive-
B2_CXXSTD: latest # 2a
B2_TOOLSET: msvc-14.2
- FLAVOR: Visual Studio 2017 C++2a Strict
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_ADDRESS_MODEL: address-model=64
B2_CXXFLAGS: cxxflags=-permissive-
B2_CXXSTD: latest # 2a
B2_TOOLSET: msvc-14.1
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: Visual Studio 2017 C++17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_ADDRESS_MODEL: address-model=64
B2_CXXSTD: 17
B2_TOOLSET: msvc-14.1
B2_VARIANT: variant=debug
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: Visual Studio 2017 C++14 (Default)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_ADDRESS_MODEL: address-model=64,32
B2_TOOLSET: msvc-14.1
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: clang-cl
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
B2_ADDRESS_MODEL: address-model=64
B2_CXXSTD: 11
B2_TOOLSET: clang-win
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: Visual Studio 2015 C++14 (Default)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
B2_ADDRESS_MODEL: address-model=64,32
B2_TOOLSET: msvc-14.0
B2_VARIANT: variant=debug
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: Visual Studio 2010, 2012, 2013
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
B2_TOOLSET: msvc-10.0,msvc-11.0,msvc-12.0
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: cygwin (32-bit)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ADDPATH: C:\cygwin\bin;
B2_ADDRESS_MODEL: address-model=32
B2_CXXSTD: 03,11
# https://github.com/boostorg/test/issues/144
B2_DEFINES: define=_POSIX_C_SOURCE=200112L
B2_THREADING: threadapi=pthread
B2_TOOLSET: gcc
B2_VARIANT: variant=debug
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: cygwin (64-bit)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ADDPATH: C:\cygwin64\bin;
B2_ADDRESS_MODEL: address-model=64
B2_CXXSTD: 11,17
# https://github.com/boostorg/test/issues/144
B2_DEFINES: define=_POSIX_C_SOURCE=200112L define=__USE_ISOC99
B2_THREADING: threadapi=pthread
B2_TOOLSET: gcc
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: mingw32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARCH: i686
B2_ADDRESS_MODEL: address-model=32
B2_CXXSTD: 03,11
SCRIPT: ci\appveyor\mingw.bat
B2_VARIANT: variant=debug
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
- FLAVOR: mingw64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARCH: x86_64
B2_ADDRESS_MODEL: address-model=64
B2_CXXSTD: 11,17
B2_DEFINES: define=__USE_ISOC99
SCRIPT: ci\appveyor\mingw.bat
BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS: 1
install:
- set SELF=%APPVEYOR_PROJECT_NAME:-=_%
- git clone https://github.com/boostorg/boost-ci.git C:\boost-ci
- xcopy /s /e /q /i C:\boost-ci\ci .\ci
- ci\appveyor\install.bat
build: off
test_script:
- set SELF=%APPVEYOR_PROJECT_NAME:-=_%
- PATH=%ADDPATH%%PATH%
# The definition of B2_TOOLCXX omits B2_CXXSTD= if it was not defined above
- IF NOT DEFINED B2_CXXSTD (SET B2_TOOLCXX=toolset=%B2_TOOLSET%) ELSE (SET B2_TOOLCXX=toolset=%B2_TOOLSET% cxxstd=%B2_CXXSTD%)
# Echo the complete build command to the build log
- IF NOT DEFINED SCRIPT (ECHO b2 libs/%SELF:\=/% %B2_TOOLCXX% %B2_CXXFLAGS% %B2_DEFINES% %B2_THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
# Now go build...
- IF DEFINED SCRIPT (call libs\%SELF%\%SCRIPT%) ELSE (b2 libs/%SELF:\=/% %B2_TOOLCXX% %B2_CXXFLAGS% %B2_DEFINES% %B2_THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
+37
View File
@@ -0,0 +1,37 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.2 ;
constant boost_dependencies :
/boost/algorithm//boost_algorithm
/boost/assert//boost_assert
/boost/config//boost_config
/boost/core//boost_core
/boost/io//boost_io
/boost/lexical_cast//boost_lexical_cast
/boost/numeric_conversion//boost_numeric_conversion
/boost/range//boost_range
/boost/smart_ptr//boost_smart_ptr
/boost/throw_exception//boost_throw_exception
/boost/tokenizer//boost_tokenizer
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility
/boost/winapi//boost_winapi ;
project /boost/date_time
: common-requirements
<include>include
;
explicit
[ alias boost_date_time : build//boost_date_time ]
[ alias all : boost_date_time example test ]
;
call-if : boost-library date_time
: install boost_date_time
;
+5 -5
View File
@@ -1,5 +1,5 @@
# Copyright (c) 2002-2005 CrystalClear Software, Inc.
# Use, modification and distribution is subject to the
# Use, modification and distribution is 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)
#
@@ -7,18 +7,18 @@
#
project boost/date_time
project
: common-requirements <library>$(boost_dependencies)
: requirements
<define>DATE_TIME_INLINE
<link>shared:<define>BOOST_ALL_DYN_LINK=1
<link>shared:<define>BOOST_ALL_DYN_LINK=1
: usage-requirements
<define>DATE_TIME_INLINE
<link>shared:<define>BOOST_DATE_TIME_DYN_LINK=1
<define>BOOST_DATE_TIME_NO_LINK=1
: source-location ../src
;
# greg_month.cpp is now just a stub so that there is
# still a boost_date_time library to link for backward compatibility
lib boost_date_time : gregorian/greg_month.cpp ;
boost-install boost_date_time ;
+2
View File
@@ -4,6 +4,8 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.2 ;
###############################################################################
alias boostdoc
: ../xmldoc/date_time.xml
+7 -7
View File
@@ -1,4 +1,4 @@
project libs/date_time/example ;
project : requirements <library>/boost/date_time//boost_date_time ;
exe dates_as_strings : gregorian/dates_as_strings.cpp ;
exe days_alive : gregorian/days_alive.cpp ;
@@ -18,19 +18,19 @@ exe days_since_year_start : gregorian/days_since_year_start.cpp ;
exe local_utc_conversion : posix_time/local_utc_conversion.cpp
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
;
exe print_hours : posix_time/print_hours.cpp
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
;
exe time_math : posix_time/time_math.cpp
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
;
exe time_periods : posix_time/time_periods.cpp
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
;
exe simple_time_zone : local_time/simple_time_zone.cpp ;
@@ -41,7 +41,7 @@ exe io_tutorial : tutorial/io_tutorial.cpp ;
# Copyright (c) 2002-2005
# CrystalClear Software, Inc.
# Subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or
# 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)
+1 -1
View File
@@ -25,7 +25,7 @@ main()
date d(from_simple_string(s));
std::cout << to_simple_string(d) << std::endl;
//Read ISO Standard(CCYYMMDD) and output ISO Extended
//Read ISO 8601 Standard(CCYYMMDD) and output ISO 8601 Extended
std::string ud("20011009"); //2001-Oct-09
date d1(from_undelimited_string(ud));
std::cout << to_iso_extended_string(d1) << std::endl;
+1 -1
View File
@@ -83,7 +83,7 @@ int main()
us_facet->format("%m/%d/%Y");
std::cout << d1 << std::endl; // 10/01/2002
// English names, iso order (year-month-day), '-' separator
// English names, ISO 8601 order (year-month-day), '-' separator
us_facet->format("%Y-%b-%d");
std::cout << d1 << std::endl; // 2002-Oct-01
+9 -4
View File
@@ -90,10 +90,13 @@ namespace date_time {
}
#else // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS
#if (defined(_MSC_VER) && (_MSC_VER >= 1400))
#if defined(__clang__) // Clang has to be checked before MSVC
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400))
#pragma warning(push) // preserve warning settings
#pragma warning(disable : 4996) // disable depricated localtime/gmtime warning on vc8
#endif // _MSC_VER >= 1400
#endif
//! requires a pointer to a user created std::tm struct
inline
static std::tm* localtime(const std::time_t* t, std::tm* result)
@@ -112,9 +115,11 @@ namespace date_time {
boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time"));
return result;
}
#if (defined(_MSC_VER) && (_MSC_VER >= 1400))
#if defined(__clang__) // Clang has to be checked before MSVC
#pragma clang diagnostic pop
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400))
#pragma warning(pop) // restore warnings to previous state
#endif // _MSC_VER >= 1400
#endif
#endif // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS
};
@@ -28,10 +28,6 @@
// Include extensions to date_duration - comment out to remove this feature
#define BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES
// these extensions are known to cause problems with gcc295
#if defined(__GNUC__) && (__GNUC__ < 3)
#undef BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES
#endif
#if (defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) || BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x581) ) )
#define BOOST_DATE_TIME_NO_MEMBER_INIT
@@ -123,26 +119,6 @@ namespace std {
# define BOOST_DATE_TIME_DECL
#endif
//
// Automatically link to the correct build variant where possible.
//
#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_DATE_TIME_NO_LIB) && !defined(BOOST_DATE_TIME_SOURCE)
//
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME boost_date_time
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
# define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif // auto-linking disabled
#if defined(BOOST_HAS_THREADS)
# if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) || defined(__BORLANDC__)
@@ -65,7 +65,7 @@ namespace CV {
protected:
value_type value_;
private:
void assign(value_type value)
BOOST_CXX14_CONSTEXPR void assign(value_type value)
{
//adding 1 below gets rid of a compiler warning which occurs when the
//min_value is 0 and the type is unsigned....
+1 -1
View File
@@ -21,7 +21,7 @@ namespace date_time {
/*!
The date template represents an interface shell for a date class
that is based on a year-month-day system such as the gregorian
or iso systems. It provides basic operations to enable calculation
or ISO 8601 systems. It provides basic operations to enable calculation
and comparisons.
<b>Theory</b>
+8 -8
View File
@@ -53,14 +53,14 @@ namespace date_time {
}
virtual duration_type get_offset(const date_type& current) const=0;
virtual duration_type get_neg_offset(const date_type& current) const=0;
date_type operator*() {return current_;}
date_type* operator->() {return &current_;}
bool operator< (const date_type& d) {return current_ < d;}
bool operator<= (const date_type& d) {return current_ <= d;}
bool operator> (const date_type& d) {return current_ > d;}
bool operator>= (const date_type& d) {return current_ >= d;}
bool operator== (const date_type& d) {return current_ == d;}
bool operator!= (const date_type& d) {return current_ != d;}
const date_type& operator*() const {return current_;}
const date_type* operator->() const {return &current_;}
bool operator< (const date_type& d) const {return current_ < d;}
bool operator<= (const date_type& d) const {return current_ <= d;}
bool operator> (const date_type& d) const {return current_ > d;}
bool operator>= (const date_type& d) const {return current_ >= d;}
bool operator== (const date_type& d) const {return current_ == d;}
bool operator!= (const date_type& d) const {return current_ != d;}
private:
date_type current_;
};
@@ -65,7 +65,7 @@ namespace gregorian {
std::basic_string<charT> s(date_time::date_formatter<date,date_time::iso_format<charT>,charT>::date_to_string(d.begin()));
return s + sep + date_time::date_formatter<date,date_time::iso_format<charT>,charT>::date_to_string(d.last());
}
//! Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
//! Date period to ISO 8601 standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
/*!\ingroup date_format
*/
inline std::string to_iso_string(const date_period& d) {
@@ -78,7 +78,7 @@ namespace gregorian {
inline std::basic_string<charT> to_iso_extended_string_type(const date& d) {
return date_time::date_formatter<date,date_time::iso_extended_format<charT>,charT>::date_to_string(d);
}
//! Convert to iso extended format string CCYY-MM-DD. Example 2002-12-31
//! Convert to ISO 8601 extended format string CCYY-MM-DD. Example 2002-12-31
/*!\ingroup date_format
*/
inline std::string to_iso_extended_string(const date& d) {
@@ -90,7 +90,7 @@ namespace gregorian {
inline std::basic_string<charT> to_iso_string_type(const date& d) {
return date_time::date_formatter<date,date_time::iso_format<charT>,charT>::date_to_string(d);
}
//! Convert to iso standard string YYYYMMDD. Example: 20021231
//! Convert to ISO 8601 standard string YYYYMMDD. Example: 20021231
/*!\ingroup date_format
*/
inline std::string to_iso_string(const date& d) {
@@ -35,7 +35,7 @@ namespace gregorian {
return std::string("[" + d1 + "/" + d2 + "]");
}
//! Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
//! Date period to ISO 8601 standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231
/*!\ingroup date_format
*/
inline std::string to_iso_string(const date_period& d) {
@@ -44,14 +44,14 @@ namespace gregorian {
}
//! Convert to iso extended format string CCYY-MM-DD. Example 2002-12-31
//! Convert to ISO 8601 extended format string CCYY-MM-DD. Example 2002-12-31
/*!\ingroup date_format
*/
inline std::string to_iso_extended_string(const date& d) {
return date_time::date_formatter<date,date_time::iso_extended_format<char> >::date_to_string(d);
}
//! Convert to iso standard string YYYYMMDD. Example: 20021231
//! Convert to ISO 8601 standard string YYYYMMDD. Example: 20021231
/*!\ingroup date_format
*/
inline std::string to_iso_string(const date& d) {
+12 -13
View File
@@ -74,18 +74,8 @@ namespace gregorian {
{}
//! Constructor for infinities, not a date, max and min date
BOOST_CXX14_CONSTEXPR explicit date(special_values sv):
date_time::date<date, gregorian_calendar, date_duration>(date_rep_type::from_special(sv))
{
if (sv == min_date_time)
{
*this = date(1400, 1, 1);
}
if (sv == max_date_time)
{
*this = date(9999, 12, 31);
}
}
date_time::date<date, gregorian_calendar, date_duration>(from_special_adjusted(sv))
{}
//!Return the Julian Day number for the date.
BOOST_CXX14_CONSTEXPR date_int_type julian_day() const
{
@@ -105,7 +95,7 @@ namespace gregorian {
ymd_type ymd = year_month_day();
return gregorian_calendar::modjulian_day_number(ymd);
}
//!Return the iso 8601 week number 1..53
//!Return the ISO 8601 week number 1..53
BOOST_CXX14_CONSTEXPR int week_number() const
{
ymd_type ymd = year_month_day();
@@ -129,6 +119,15 @@ namespace gregorian {
private:
BOOST_CXX14_CONSTEXPR date_rep_type from_special_adjusted(special_values sv)
{
switch (sv)
{
case min_date_time: return gregorian_calendar::day_number(ymd_type(1400, 1, 1));
case max_date_time: return gregorian_calendar::day_number(ymd_type(9999, 12, 31));
default: return date_rep_type::from_special(sv);
}
}
};
inline BOOST_CXX14_CONSTEXPR
@@ -64,12 +64,12 @@ namespace gregorian {
return date_time::parse_date<date>(s, date_time::ymd_order_dmy);
}
//! From iso type date string where with order year-month-day eg: 20020125
//! From ISO 8601 type date string where with order year-month-day eg: 20020125
inline date from_undelimited_string(const std::string& s) {
return date_time::parse_undelimited_date<date>(s);
}
//! From iso type date string where with order year-month-day eg: 20020125
//! From ISO 8601 type date string where with order year-month-day eg: 20020125
inline date date_from_iso_string(const std::string& s) {
return date_time::parse_undelimited_date<date>(s);
}
@@ -25,8 +25,8 @@ namespace date_time {
return d;
}
//!Return the iso week number for the date
/*!Implements the rules associated with the iso 8601 week number.
//!Return the ISO 8601 week number for the date
/*!Implements the rules associated with the ISO 8601 week number.
Basically the rule is that Week 1 of the year is the week that contains
January 4th or the week that contains the first Thursday in January.
Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000.
@@ -77,7 +77,7 @@ namespace date_time {
unsigned short a = static_cast<unsigned short>((14-ymd.month)/12);
unsigned short y = static_cast<unsigned short>(ymd.year + 4800 - a);
unsigned short m = static_cast<unsigned short>(ymd.month + 12*a - 3);
unsigned long d = ymd.day + ((153*m + 2)/5) + 365*y + (y/4) - (y/100) + (y/400) - 32045;
unsigned long d = static_cast<unsigned long>(ymd.day) + ((153*m + 2)/5) + 365*y + (y/4) - (y/100) + (y/400) - 32045;
return static_cast<date_int_type>(d);
}
+13 -13
View File
@@ -14,11 +14,11 @@
namespace boost {
namespace date_time {
//! Class to provide common iso formatting spec
//! Class to provide common ISO 8601 formatting spec
template<class charT>
class iso_format_base {
public:
//! Describe month format -- its an integer in iso format
//! Describe month format -- its an integer in ISO 8601 format
static month_format_spec month_format()
{
return month_as_integer;
@@ -40,17 +40,17 @@ public:
return "-infinity";
}
//! ISO char for a year -- used in durations
//! ISO 8601 char for a year -- used in durations
static charT year_sep_char()
{
return 'Y';
}
//! ISO char for a month
//! ISO 8601 char for a month
static charT month_sep_char()
{
return '-';
}
//! ISO char for a day
//! ISO 8601 char for a day
static charT day_sep_char()
{
return '-';
@@ -70,7 +70,7 @@ public:
{
return ':';
}
//! ISO char for a period
//! ISO 8601 char for a period
static charT period_start_char()
{
return 'P';
@@ -143,11 +143,11 @@ public:
#ifndef BOOST_NO_STD_WSTRING
//! Class to provide common iso formatting spec
//! Class to provide common ISO 8601 formatting spec
template<>
class iso_format_base<wchar_t> {
public:
//! Describe month format -- its an integer in iso format
//! Describe month format -- its an integer in ISO 8601 format
static month_format_spec month_format()
{
return month_as_integer;
@@ -169,17 +169,17 @@ public:
return L"-infinity";
}
//! ISO char for a year -- used in durations
//! ISO 8601 char for a year -- used in durations
static wchar_t year_sep_char()
{
return 'Y';
}
//! ISO char for a month
//! ISO 8601 char for a month
static wchar_t month_sep_char()
{
return '-';
}
//! ISO char for a day
//! ISO 8601 char for a day
static wchar_t day_sep_char()
{
return '-';
@@ -199,7 +199,7 @@ public:
{
return ':';
}
//! ISO char for a period
//! ISO 8601 char for a period
static wchar_t period_start_char()
{
return 'P';
@@ -272,7 +272,7 @@ public:
#endif // BOOST_NO_STD_WSTRING
//! Format description for iso normal YYYYMMDD
//! Format description for ISO 8601 normal YYYYMMDD
template<class charT>
class iso_format : public iso_format_base<charT> {
public:
@@ -315,7 +315,7 @@ namespace local_time {
//! Returns name of associated time zone or "Coordinated Universal Time".
/*! Optional bool parameter will return time zone as an offset
* (ie "+07:00" extended iso format). Empty string is returned for
* (ie "+07:00" extended ISO 8601 format). Empty string is returned for
* classes that do not use a time_zone */
std::string zone_name(bool as_offset=false) const
{
@@ -349,7 +349,7 @@ namespace local_time {
}
//! Returns abbreviation of associated time zone or "UTC".
/*! Optional bool parameter will return time zone as an offset
* (ie "+0700" iso format). Empty string is returned for classes
* (ie "+0700" ISO 8601 format). Empty string is returned for classes
* that do not use a time_zone */
std::string zone_abbrev(bool as_offset=false) const
{
+1 -3
View File
@@ -299,9 +299,7 @@ namespace date_time {
inline BOOST_CXX14_CONSTEXPR
bool period<point_rep,duration_rep>::intersects(const period<point_rep,duration_rep>& other) const
{
return ( contains(other.begin_) ||
other.contains(begin_) ||
((other.begin_ < begin_) && (other.last_ >= begin_)));
return !is_null() && !other.is_null() && (begin_ < other.end()) && (other.begin_ < end());
}
//! Returns the period of intersection or invalid range no intersection
@@ -26,7 +26,7 @@ namespace posix_time {
inline
ptime from_time_t(std::time_t t)
{
return ptime(gregorian::date(1970,1,1)) + seconds(static_cast<long>(t));
return ptime(gregorian::date(1970,1,1)) + seconds(t);
}
//! Function that converts a ptime into a time_t
@@ -97,7 +97,7 @@ namespace posix_time {
throw; // rethrow original exception
}
else {
// if the user want's to fail quietly, we simply set the failbit
// if the user wants to fail quietly, we simply set the failbit
is.setstate(std::ios_base::failbit);
}
}
@@ -157,7 +157,7 @@ namespace posix_time {
}// else
return ss.str();
}
//! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456
//! Time duration in ISO 8601 format -hhmmss.fffffff. Example: 10:09:03.0123456
/*!\ingroup time_format
*/
inline std::string to_iso_string(time_duration td){
@@ -215,7 +215,7 @@ namespace posix_time {
return ts;
}
}
//! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator
//! Convert ISO 8601 short form YYYYMMDDTHHMMSS where T is the date-time separator
/*!\ingroup time_format
*/
inline std::string to_iso_string(ptime t){
@@ -251,7 +251,7 @@ namespace posix_time {
inline std::wstring to_simple_wstring(time_duration td) {
return to_simple_string_type<wchar_t>(td);
}
//! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456
//! Time duration in ISO 8601 format -hhmmss.fffffff. Example: 10:09:03.0123456
/*!\ingroup time_format
*/
inline std::wstring to_iso_wstring(time_duration td){
@@ -266,7 +266,7 @@ namespace posix_time {
inline std::wstring to_simple_wstring(time_period tp){
return to_simple_string_type<wchar_t>(tp);
}
//! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator
//! Convert ISO 8601 short form YYYYMMDDTHHMMSS where T is the date-time separator
/*!\ingroup time_format
*/
inline std::wstring to_iso_wstring(ptime t){
@@ -82,7 +82,7 @@ namespace posix_time {
return ss.str();
}
//! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456
//! Time duration in ISO 8601 format -hhmmss.fffffff. Example: 10:09:03.0123456
/*!\ingroup time_format
*/
inline
@@ -173,7 +173,7 @@ namespace posix_time {
return std::string("[" + d1 + "/" + d2 +"]");
}
//! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator
//! Convert ISO 8601 short form YYYYMMDDTHHMMSS where T is the date-time separator
/*!\ingroup time_format
*/
inline
@@ -36,6 +36,10 @@ namespace posix_time {
}
inline ptime from_iso_extended_string(const std::string& s) {
if (s.size() == 10) { //assume we just have a date which is 10 chars
gregorian::date d = gregorian::from_simple_string(s);
return ptime( d );
}
return date_time::parse_delimited_time<ptime>(s, 'T');
}
@@ -97,7 +97,7 @@ namespace boost { namespace date_time {
//! match() should be called and return value checked.
//! \param[in] str the string to check
//! \returns false if it is definitely not a special value
static bool likely(const string_type& str)
static bool should_call_match(const string_type& str)
{
if (!str.empty()) {
switch (str[0]) {
+1 -1
View File
@@ -481,7 +481,7 @@ namespace date_time {
boost::algorithm::replace_all(format, unrestricted_hours_format, hours_str);
}
// We still have to process restricted hours format specifier. In order to
// support parseability of durations in ISO format (%H%M%S), we'll have to
// support parseability of durations in ISO 8601 format (%H%M%S), we'll have to
// restrict the stringified hours length to 2 characters.
if (format.find(hours_format) != string_type::npos) {
if (hours_str.empty())
+8 -8
View File
@@ -30,14 +30,14 @@ namespace date_time {
current_ = current_ - offset_;
return *this;
}
time_type operator*() {return current_;}
time_type* operator->() {return &current_;}
bool operator< (const time_type& t) {return current_ < t;}
bool operator<= (const time_type& t) {return current_ <= t;}
bool operator!= (const time_type& t) {return current_ != t;}
bool operator== (const time_type& t) {return current_ == t;}
bool operator> (const time_type& t) {return current_ > t;}
bool operator>= (const time_type& t) {return current_ >= t;}
const time_type& operator*() const {return current_;}
const time_type* operator->() const {return &current_;}
bool operator< (const time_type& t) const {return current_ < t;}
bool operator<= (const time_type& t) const {return current_ <= t;}
bool operator!= (const time_type& t) const {return current_ != t;}
bool operator== (const time_type& t) const {return current_ == t;}
bool operator> (const time_type& t) const {return current_ > t;}
bool operator>= (const time_type& t) const {return current_ >= t;}
private:
time_type current_;
+2 -2
View File
@@ -183,7 +183,7 @@ namespace date_time {
}
//! Parse time duration part of an iso time of form: [-]hhmmss[.fff...] (eg: 120259.123 is 12 hours, 2 min, 59 seconds, 123000 microseconds)
//! Parse time duration part of an ISO 8601 time of form: [-]hhmmss[.fff...] (eg: 120259.123 is 12 hours, 2 min, 59 seconds, 123000 microseconds)
template<class time_duration>
inline
time_duration
@@ -309,7 +309,7 @@ namespace date_time {
// then from_iso_string should be able to read a special value string
// the special_values_parser is expensive to set up and not thread-safe
// so it cannot be static, so we need to be careful about when we use it
if (svp_type::likely(s)) {
if (svp_type::should_call_match(s)) {
typedef typename svp_type::stringstream_type ss_type;
typedef typename svp_type::stream_itr_type itr_type;
typedef typename svp_type::match_results mr_type;
+2 -1
View File
@@ -12,5 +12,6 @@
"maintainers": [
"Jeff Garland <jeff -at- crystalclearsoftware.com>",
"James E. King III <jking -at- apache.org>"
]
],
"cxxstd": "11"
}
+20 -19
View File
@@ -3,10 +3,12 @@ import path ;
import regex ;
import testing ;
project : requirements <library>/boost/date_time//boost_date_time ;
local DATE_TIME_DYNAMIC_PROPERTIES = <define>BOOST_ALL_DYN_LINK <runtime-link>shared <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG <define>BOOST_ALL_NO_LIB ;
local DATE_TIME_PROPERTIES = <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
# FIXME
#std::locale-support
# FIXME
#std::locale-support
<define>BOOST_ALL_NO_LIB ;
# core stuff
@@ -43,12 +45,12 @@ run gregorian/testparse_date.cpp ;
run gregorian/testperiod.cpp ;
run gregorian/testgreg_serialize.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : : <define>DATE_TIME_XML_SERIALIZE
: testgreg_serialize_xml ;
run gregorian/testgreg_serialize.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : :
: testgreg_serialize ;
@@ -65,7 +67,7 @@ run posix_time/testtime.cpp ;
run posix_time/testmicrosec_time_clock.cpp ;
run posix_time/testgreg_duration_operators.cpp ;
run posix_time/testtime_facet.cpp ;
run posix_time/testtime_input_facet.cpp
run posix_time/testtime_input_facet.cpp
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: testtime_input_facet ;
@@ -75,35 +77,35 @@ run posix_time/testtime_formatters.cpp
# text archive tests
run posix_time/testtime_serialize.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : :
: testtime_serialize ;
run posix_time/testtime_serialize.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: testtime_serialize_std_config ;
# xml archive tests
run posix_time/testtime_serialize.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : : <define>DATE_TIME_XML_SERIALIZE <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: testtime_serialize_xml_std_config ;
run posix_time/testtime_serialize.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : : <define>DATE_TIME_XML_SERIALIZE
: testtime_serialize_xml ;
# versioning tests
run posix_time/testtime_serialize_versioning.cpp
../../serialization/build//boost_serialization
: : testtime_serialize_versioning_prev
/boost/serialization//boost_serialization
: : testtime_serialize_versioning_prev
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
: testtime_serialize_versioning_curr ;
run posix_time/testtime_serialize_versioning.cpp
../../serialization/build//boost_serialization
/boost/serialization//boost_serialization
: : : <define>BOOST_DATE_TIME_POSIX_TIME_DURATION_VERSION=0
: testtime_serialize_versioning_prev ;
@@ -124,7 +126,7 @@ run local_time/testlocal_time.cpp ;
run local_time/testlocal_time_iterator.cpp ;
run local_time/testlocal_time_period.cpp ;
run local_time/testtz_database.cpp
run local_time/testtz_database.cpp
: : ../data/date_time_zonespec.csv local_time/poorly_formed_zonespec.csv
: ;
run local_time/testlocal_time_facet.cpp
@@ -137,17 +139,16 @@ run local_time/testclocks.cpp ;
#{
# local DATE_TIME_PROPERTIES = <define>BOOST_ALL_NO_LIB <define>USE_DATE_TIME_PRE_1_33_FACET_IO
# # FIXME
# # std::locale-support toolset::require-boost-spirit-support
# # std::locale-support toolset::require-boost-spirit-support
# ;
# Iterate over all public headers and generate a self-contained header test to check for any missing includes
# and basic syntax errors.
if ! [ os.environ BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{
local headers_path = [ path.make $(BOOST_ROOT)/libs/date_time/include/boost ] ;
for file in [ path.glob-tree $(headers_path) : *.hpp ]
for file in [ glob-tree-ex ../include/boost : *.hpp ]
{
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
local rel_file = [ path.relative-to ../include/boost $(file) ] ;
# Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
# All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
@@ -159,8 +160,8 @@ if ! [ os.environ BOOST_DATE_TIME_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
# Copyright (c) 2000-2020
# CrystalClear Software, Inc.
# Subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or
# 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)
+22
View File
@@ -0,0 +1,22 @@
# Copyright 2021-2024 Alexander Grund
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_subdir_test LANGUAGES CXX)
# Those 2 should work the same
# while using find_package for the installed Boost avoids the need to manually specify dependencies
if(BOOST_CI_INSTALL_TEST)
find_package(boost_date_time REQUIRED)
else()
set(BOOST_INCLUDE_LIBRARIES date_time)
add_subdirectory(../../../.. deps/boost EXCLUDE_FROM_ALL)
endif()
add_executable(main main.cpp)
target_link_libraries(main Boost::date_time)
enable_testing()
add_test(NAME main COMMAND main)
+86
View File
@@ -0,0 +1,86 @@
/* A simple example for using a custom_time_zone and a posix_time_zone.
*/
#include "boost/date_time/local_time/local_time.hpp"
#include <iostream>
int
main()
{
using namespace boost;
using namespace local_time;
using namespace gregorian;
using posix_time::time_duration;
/***** custom_time_zone *****/
// create the dependent objects for a custom_time_zone
time_zone_names tzn("Eastern Standard Time", "EST",
"Eastern Daylight Time", "EDT");
time_duration utc_offset(-5,0,0);
dst_adjustment_offsets adj_offsets(time_duration(1,0,0),
time_duration(2,0,0),
time_duration(2,0,0));
// rules for this zone are:
// start on first Sunday of April at 2 am
// end on last Sunday of October at 2 am
// so we use a first_last_dst_rule
first_day_of_the_week_in_month start_rule(Sunday, Apr);
last_day_of_the_week_in_month end_rule(Sunday, Oct);
shared_ptr<dst_calc_rule> nyc_rules(new first_last_dst_rule(start_rule,
end_rule));
// create more dependent objects for a non-dst custom_time_zone
time_zone_names tzn2("Mountain Standard Time", "MST",
"", ""); // no dst means empty dst strings
time_duration utc_offset2(-7,0,0);
dst_adjustment_offsets adj_offsets2(time_duration(0,0,0),
time_duration(0,0,0),
time_duration(0,0,0));
// no dst means we need a null pointer to the rules
shared_ptr<dst_calc_rule> phx_rules;
// create the custom_time_zones
time_zone_ptr nyc_1(new custom_time_zone(tzn, utc_offset, adj_offsets, nyc_rules));
time_zone_ptr phx_1(new custom_time_zone(tzn2, utc_offset2, adj_offsets2, phx_rules));
/***** posix_time_zone *****/
// create posix_time_zones that are the duplicates of the
// custom_time_zones created above. See posix_time_zone documentation
// for details on full zone names.
std::string nyc_string, phx_string;
nyc_string = "EST-05:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00";
// nyc_string = "EST-05EDT,M4.1.0,M10.5.0"; // shorter when defaults used
phx_string = "MST-07"; // no-dst
time_zone_ptr nyc_2(new posix_time_zone(nyc_string));
time_zone_ptr phx_2(new posix_time_zone(phx_string));
/***** show the sets are equal *****/
std::cout << "The first zone is in daylight savings from:\n "
<< nyc_1->dst_local_start_time(2004) << " through "
<< nyc_1->dst_local_end_time(2004) << std::endl;
std::cout << "The second zone is in daylight savings from:\n "
<< nyc_2->dst_local_start_time(2004) << " through "
<< nyc_2->dst_local_end_time(2004) << std::endl;
std::cout << "The third zone (no daylight savings):\n "
<< phx_1->std_zone_abbrev() << " and "
<< phx_1->base_utc_offset() << std::endl;
std::cout << "The fourth zone (no daylight savings):\n "
<< phx_2->std_zone_abbrev() << " and "
<< phx_2->base_utc_offset() << std::endl;
return 0;
}
/* Copyright 2001-2005: CrystalClear Software, Inc
* http://www.crystalclearsoftware.com
*
* 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)
*/
+19
View File
@@ -34,6 +34,25 @@ main()
date def;
check("Default constructor", def == date(not_a_date_time));
#endif
#ifdef BOOST_NO_CXX14_CONSTEXPR
check("constexpr not configured", true);
#else
//check constexpr case
{
constexpr date d1(1900,1,1);
static_assert(d1.day() == 1, "constexpr construction day()");
static_assert(d1.month() == 1, "constexpr construction month()");
static_assert(d1.year() == 1900, "constexpr construction year()");
constexpr date d2 = date(2000,12,31);
constexpr date d3(d2);
static_assert(d3.day() == 31, "constexpr construct and copy day()");
static_assert(d3.month() == 12, "constexpr construct and copy month()");
static_assert(d3.year() == 2000, "constexpr construct and copy year()");
check("constexpr tests compiled", true);
}
#endif
date d1(1900,1,1);
date d2 = date(2000,1,1);
+24 -2
View File
@@ -48,7 +48,7 @@ main()
std::cout << "Check local time of microsec_clock against second_clock" << std::endl;
ptime last = microsec_clock::local_time();
int max = 30;
int max = 5;
for (int i=0; i<max; i++)
{
// Some systems loop too fast so "last is less" tests fail due to
@@ -64,6 +64,17 @@ main()
ptime t2 = microsec_clock::local_time();
std::cout << t2 << std::endl;
// sometimes on very slow systems (github actions) a long time
// can pass between syncing to the next second + 300ms (see previous
// function) and asking for t2; therefore if the fractional seconds
// of t2 are less than 300ms we skip that test loop assuming it
// took too long
time_duration t2_tod = t2.time_of_day();
if (t2_tod.fractional_seconds() < (t2_tod.ticks_per_second() * 3) / 10) {
std::cout << "SKIP :: we had a significant host processing delay" << std::endl;
continue;
}
check("check equality of hours "
"between second_clock and microsec_clock timestamps",
t1.time_of_day().hours() == t2.time_of_day().hours());
@@ -90,7 +101,7 @@ main()
std::cout << "Check universal time of microsec_clock against second_clock" << std::endl;
max = 10;
max = 5;
last = microsec_clock::universal_time();
for (int i=0; i<max; i++)
{
@@ -107,6 +118,17 @@ main()
ptime t2 = microsec_clock::universal_time();
std::cout << t2 << std::endl;
// sometimes on very slow systems (github actions) a long time
// can pass between syncing to the next second + 300ms (see previous
// function) and asking for t2; therefore if the fractional seconds
// of t2 are less than 300ms we skip that test loop assuming it
// took too long
time_duration t2_tod = t2.time_of_day();
if (t2_tod.fractional_seconds() < (t2_tod.ticks_per_second() * 3) / 10) {
std::cout << "SKIP :: we had a significant host processing delay" << std::endl;
continue;
}
check("check equality of hours "
"between second_clock and microsec_clock timestamps",
t1.time_of_day().hours() == t2.time_of_day().hours());
+31
View File
@@ -220,6 +220,8 @@ main()
ptime t27 = from_iso_extended_string(ts10);
check("parse iso extended time w/ frac sec (dec only): " + ts10,
t27 == ptime(date(1900,12,31),time_duration(23,0,0,0)));
#else
std::string ts3("20020120T235859.123456");
ptime t20 = from_iso_string(ts3);
@@ -260,6 +262,35 @@ main()
ptime t27 = from_iso_extended_string(ts10);
check("parse iso extended time w/ frac sec (dec only): " + ts10,
t27 == ptime(date(1900,12,31),time_duration(23,0,0,0)));
//the following test cases are for this issue:
//https://github.com/boostorg/date_time/issues/187
try {
std::string ts11("1900-12-31"); //date only string
ptime t28 = from_iso_extended_string(ts11);
check("parse iso extended time date only): " + ts11,
t28 == ptime(date(1900,12,31),time_duration(0,0,0,0)));
}
catch( std::exception& e )
{
std::cout << e.what() << std::endl;
check("parse iso extended time date only): 1900-12-32", false);
}
try {
//expect a date-time exception here
std::string ts12("1900-1"); //completely bogus string
ptime t29 = from_iso_extended_string(ts12);
check("parse iso extended time bad string: " + ts12, false);
(void) t29; //supress unused compiler warning, this is never reached
}
catch( std::exception& e )
{
//Day of month value is out of range 1..31
// std::cout << e.what() << std::endl;
check("parse iso extended time date only): 1900-1", true);
}
#endif // BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
}
+34
View File
@@ -29,6 +29,28 @@ void special_values_tests()
}
#endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR
#ifdef BOOST_NO_CXX14_CONSTEXPR
check("constexpr not configured", true);
#else
//check constexpr case
{
constexpr date d1(1970,1,1);
constexpr ptime t1(d1);
static_assert(t1.date().day() == 1, "constexpr construction day()");
static_assert(t1.date().month() == 1, "constexpr construction month()");
static_assert(t1.date().year() == 1970, "constexpr construction year()");
static_assert(t1.time_of_day().hours() == 0, "constexpr construction hour()");
static_assert(t1.time_of_day().minutes() == 0, "constexpr construction minute()");
static_assert(t1.time_of_day().seconds() == 0, "constexpr construction second()");
constexpr ptime t2(d1, time_duration(1,2,3));
static_assert(t2.time_of_day().hours() == 1, "constexpr contruct with duration hour()");
static_assert(t2.time_of_day().minutes() == 2, "constexpr contruct with duration minute()");
static_assert(t2.time_of_day().seconds() == 3, "constexpr contruct with duration second()");
check("constexpr tests compiled", true);
}
#endif
{ // special values construction tests
ptime p_sv1(pos_infin);
std::string s("+infinity");
@@ -284,6 +306,18 @@ main()
t18 == ptime(date(2032,2,15), time_duration(18,47,14)));
check("time_t conversion from 1960483634", to_time_t(t18) == tt3);
#if !defined(BOOST_NO_INT64_T)
// 64-bit time_t test (if running with a 64-bit time_t)
if (sizeof(std::time_t) >= 8)
{
std::time_t tt4(INT64_C(11864480887));
t18 = from_time_t(tt4); //2345-12-21 09:08:07
check("time_t conversion of 11864480887",
t18 == ptime(date(2345,12,21), time_duration(9,8,7)));
check("time_t conversion from 11864480887", to_time_t(t18) == tt4);
}
#endif
special_values_tests();
//min and max constructors
+10 -2
View File
@@ -17,8 +17,8 @@ class day_value_policies
{
public:
typedef unsigned int value_type;
static unsigned int min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; };
static unsigned int max BOOST_PREVENT_MACRO_SUBSTITUTION () { return 31;};
static BOOST_CXX14_CONSTEXPR unsigned int min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; };
static BOOST_CXX14_CONSTEXPR unsigned int max BOOST_PREVENT_MACRO_SUBSTITUTION () { return 31;};
static void on_error(unsigned int&, unsigned int, boost::CV::violation_enum)
{
throw bad_day();
@@ -41,6 +41,14 @@ int main()
unsigned int i = cv1;
check("test conversion", i == cv1);
#ifdef BOOST_NO_CXX14_CONSTEXPR
check("constexpr not configured", true);
#else
//check constexpr case
constexpr constrained_value<day_value_policies> cv3(1);
static_assert(cv3 == 1, "constexpr construction/conversion");
check("constexpr constrained value construct and equal", true);
#endif
try {
constrained_value<one_to_ten_range_policy> cv3(11);
+4 -4
View File
@@ -125,8 +125,8 @@ int main(){
check("Contains rep", !zero_len.contains(3));
check("Contains period (not)", !zero_len.contains(a_period(5,8)));
check("Contains period", p1.contains(zero_len));
check("Intersects", zero_len.intersects(p1));
check("Intersects", p1.intersects(zero_len));
check("Intersects", !zero_len.intersects(p1));
check("Intersects", !p1.intersects(zero_len));
check("Adjacent", zero_len.is_adjacent(a_period(-10,3)));
check("Adjacent", a_period(-10,3).is_adjacent(zero_len));
check("Intersection", (zero_len.intersection(p1) == zero_len));
@@ -146,8 +146,8 @@ int main(){
check("Contains rep in-between (always false)", !null_per.contains(3));
check("Contains period (not)", !null_per.contains(a_period(7,9)));
check("Contains period", p1.contains(null_per));
check("Intersects", null_per.intersects(p1));
check("Intersects", p1.intersects(null_per));
check("Intersects", !null_per.intersects(p1));
check("Intersects", !p1.intersects(null_per));
check("Adjacent", null_per.is_adjacent(a_period(-10,5)));
check("Adjacent", null_per.is_adjacent(a_period(1,10)));
+24 -24
View File
@@ -1,5 +1,5 @@
# Copyright (c) 2002-2006 CrystalClear Software, Inc.
# Use, modification and distribution is subject to the
# Use, modification and distribution is 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)
#
@@ -9,7 +9,7 @@ import set ;
using boostbook ;
using doxygen ;
boostbook date_time : date_time.xml
boostbook date_time : date_time.xml
:
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
<dependency>date_time_autodoc
@@ -21,23 +21,23 @@ boostbook date_time : date_time.xml
# boostbook date_time_doc : exclusive_date_time.xml ;
# file lists take the form of [ set.difference [ glob include/these ] : [ glob but/not/these ] ]
# file lists take the form of [ set.difference [ glob include/these ] : [ glob but/not/these ] ]
local date_time_files = [ glob ../../../boost/date_time/*.hpp ] ;
local date_time_files = [ glob ../include/boost/date_time/*.hpp ] ;
# local date_time_files = [ set.difference
# [ glob ../../../boost/date_time/*.hpp ] :
# [ glob ../../../boost/date_time/testfrmwk.hpp
# # ../../../boost/date_time/time_zone_base.hpp
# # ../../../boost/date_time/time_zone_names.hpp
# # ../../../boost/date_time/tz_db_base.hpp
# # ../../../boost/date_time/dst_transition_generators.hpp
# ]
# local date_time_files = [ set.difference
# [ glob ../include/boost/date_time/*.hpp ] :
# [ glob ../include/boost/date_time/testfrmwk.hpp
# # ../../../boost/date_time/time_zone_base.hpp
# # ../../../boost/date_time/time_zone_names.hpp
# # ../../../boost/date_time/tz_db_base.hpp
# # ../../../boost/date_time/dst_transition_generators.hpp
# ]
# ] ;
local gregorian_files = [ set.difference
[ glob ../../../boost/date_time/gregorian/*.hpp ] :
[ glob ../../../boost/date_time/gregorian/event_schedule.hpp ]
local gregorian_files = [ set.difference
[ glob ../include/boost/date_time/gregorian/*.hpp ] :
[ glob ../include/boost/date_time/gregorian/event_schedule.hpp ]
] ;
#ECHO $(date_time_files) ; # useful for debugging
@@ -45,33 +45,33 @@ local gregorian_files = [ set.difference
# to build the autodoc files, run bjam --v2 autodoc_target. copy generated
# file from bin.v2 dir to here. run ref_tag_fix.pl.
doxygen date_time_autodoc :
$(date_time_files) :
<doxygen:param>ENABLE_PREPROCESSING=NO
doxygen date_time_autodoc :
$(date_time_files) :
<doxygen:param>ENABLE_PREPROCESSING=NO
<xsl:param>boost.doxygen.reftitle="Date Time Reference"
<doxygen.doxproc.title>"Date Time Reference"
<doxygen.doxproc.id>"date_time_reference"
;
doxygen gregorian_autodoc :
$(gregorian_files) :
<doxygen:param>ENABLE_PREPROCESSING=NO
$(gregorian_files) :
<doxygen:param>ENABLE_PREPROCESSING=NO
<xsl:param>boost.doxygen.reftitle="Gregorian Reference"
<doxygen.doxproc.title>"Gregorian Reference"
<doxygen.doxproc.id>"gregorian_reference"
;
doxygen posix_time_autodoc :
[ glob ../../../boost/date_time/posix_time/*.hpp ] :
<doxygen:param>ENABLE_PREPROCESSING=NO
[ glob ../include/boost/date_time/posix_time/*.hpp ] :
<doxygen:param>ENABLE_PREPROCESSING=NO
<xsl:param>boost.doxygen.reftitle="Posix Time Reference"
<doxygen.doxproc.title>"Posix Time Reference"
<doxygen.doxproc.id>"posix_time_reference"
;
doxygen local_time_autodoc :
[ glob ../../../boost/date_time/local_time/*.hpp ] :
<doxygen:param>ENABLE_PREPROCESSING=NO
[ glob ../include/boost/date_time/local_time/*.hpp ] :
<doxygen:param>ENABLE_PREPROCESSING=NO
<xsl:param>boost.doxygen.reftitle="Local Time Reference"
<doxygen.doxproc.title>"Local Time Reference"
<doxygen.doxproc.id>"local_time_reference"
+35
View File
@@ -12,6 +12,41 @@
<!-- 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.73 to 1.74 </bridgehead>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>Bug-Fix</entry>
<entry>
Fix constrained_value::assign to be constexpr so ptime and date construction are constexpr. See:
<ulink url="https://github.com/boostorg/date_time/pull/161">pull 161</ulink> and
<ulink url="https://github.com/boostorg/date_time/pull/162">pull 161</ulink>.
</entry>
</row>
<row>
<entry>Bug-Fix</entry>
<entry>
Suppress MSVC CRT deprecations on Clang. See:
<ulink url="https://github.com/boostorg/date_time/pull/160">pull 160</ulink>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<bridgehead renderas="sect3">Changes from Boost 1.72 to 1.73 </bridgehead>
<informaltable frame="all">
<tgroup cols="2">
+1 -1
View File
@@ -132,7 +132,7 @@ date d(from_string(ds));</screen></entry>
<row>
<entry valign="top" morerows="1"><screen>date from_undelimited_string(std::string)</screen></entry>
<entry>From iso type date string where with order year-month-day eg: 20020125</entry>
<entry>From ISO 8601 type date string where with order year-month-day eg: 20020125</entry>
</row>
<row>
<entry><screen>std::string ds("20020125");
+1 -1
View File
@@ -103,7 +103,7 @@
us_facet->format("%m/%d/%Y");
std::cout << d1 << std::endl; // 10/01/2002
// English names, iso order (year-month-day), '-' separator
// English names, ISO 8601 order (year-month-day), '-' separator
us_facet->format("%Y-%b-%d");
std::cout << d1 << std::endl; // 2002-Oct-01
+2 -2
View File
@@ -328,7 +328,7 @@ mar_mst.shift(hours(48));
<!-- TODO: the streaming operators have not bee changed from time_period to local_time_period
<row>
<entry valign="top" morerows="1"><screen>operator&lt;&lt;</screen></entry>
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
@@ -337,7 +337,7 @@ mar_mst.shift(hours(48));
<row>
<entry valign="top" morerows="1"><screen>operator&gt;&gt;</screen></entry>
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
+7 -7
View File
@@ -127,7 +127,7 @@ ptime t(time_from_string(ts))</screen></entry>
<row>
<entry valign="top" morerows="1"><screen>ptime from_iso_string(std::string)</screen></entry>
<entry>From non delimited iso form string.</entry>
<entry>From non delimited ISO 8601 form string.</entry>
</row>
<row>
<entry><screen>std::string ts("20020131T235959");
@@ -136,7 +136,7 @@ ptime t(from_iso_string(ts))</screen></entry>
<row>
<entry valign="top" morerows="1"><screen>ptime from_iso_extended_string(std::string)</screen></entry>
<entry>From delimited iso form string.</entry>
<entry>From delimited ISO 8601 form string.</entry>
</row>
<row>
<entry><screen>std::string ts("2020-01-31T23:59:59.123");
@@ -345,7 +345,7 @@ pt3.is_special(); // --> false</screen></entry>
<tbody>
<row>
<entry valign="top" morerows="1"><screen>std::string to_simple_string(ptime)</screen></entry>
<entry>To <code>YYYY-mmm-DD HH:MM:SS.fffffffff</code> string where <code>mmm</code> 3 char month name. Fractional seconds only included if non-zero.</entry>
<entry>To <code>YYYY-mmm-DD HH:MM:SS.fffffffff</code> string where <code>mmm</code> 3 char month name and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>2002-Jan-01 10:00:01.123456789</screen></entry>
@@ -353,18 +353,18 @@ pt3.is_special(); // --> false</screen></entry>
<row>
<entry valign="top" morerows="1"><screen>std::string to_iso_string(ptime)</screen></entry>
<entry>Convert to form <code>YYYYMMDDTHHMMSS,fffffffff</code> where <code>T</code> is the date-time separator</entry>
<entry>Convert to form <code>YYYYMMDDTHHMMSS.fffffffff</code> where <code>T</code> is the date-time separator and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>20020131T100001,123456789</screen></entry>
<entry><screen>20020131T100001.123456789</screen></entry>
</row>
<row>
<entry valign="top" morerows="1"><screen>std::string to_iso_extended_string(ptime)</screen></entry>
<entry>Convert to form <code>YYYY-MM-DDTHH:MM:SS,fffffffff</code> where <code>T</code> is the date-time separator</entry>
<entry>Convert to form <code>YYYY-MM-DDTHH:MM:SS.fffffffff</code> where <code>T</code> is the date-time separator and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>2002-01-31T10:00:01,123456789</screen></entry>
<entry><screen>2002-01-31T10:00:01.123456789</screen></entry>
</row>
</tbody>
</tgroup>
+3 -3
View File
@@ -479,7 +479,7 @@ td3.is_special(); // --> false</screen></entry>
<tbody>
<row>
<entry valign="top" morerows="1"><screen>std::string to_simple_string(time_duration)</screen></entry>
<entry>To <code>HH:MM:SS.fffffffff</code> were <code>fff</code> is fractional seconds that are only included if non-zero.</entry>
<entry>To <code>HH:MM:SS.fffffffff</code> where <code>fffffffff</code> is fractional seconds that are only included if non-zero.</entry>
</row>
<row>
<entry><screen>10:00:01.123456789</screen></entry>
@@ -487,10 +487,10 @@ td3.is_special(); // --> false</screen></entry>
<row>
<entry valign="top" morerows="1"><screen>std::string to_iso_string(time_duration)</screen></entry>
<entry>Convert to form <code>HHMMSS,fffffffff</code>.</entry>
<entry>Convert to form <code>HHMMSS.fffffffff</code> where the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>100001,123456789</screen></entry>
<entry><screen>100001.123456789</screen></entry>
</row>
</tbody>
</tgroup>
+4 -4
View File
@@ -191,7 +191,7 @@ tp.last();// --> 2002-Jan-01 09:59:59.999999999</screen>
ptime t1(d, seconds(10)); //10 sec after midnight
ptime t2(d, hours(10)); //10 hours after midnight
time_period tp(t1, t2);
tp.last(); // --> 2002-Jan-01 10:00:00</screen>
tp.end(); // --> 2002-Jan-01 10:00:00</screen>
</entry>
</row>
@@ -311,7 +311,7 @@ tp2.intersects(tp1); // --> true</screen>
<row>
<entry valign="top" morerows="1"><screen>std::string
to_simple_string(time_period dp)</screen></entry>
<entry>To <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name.</entry>
<entry>To <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>[2002-Jan-01 01:25:10.000000001/
@@ -341,7 +341,7 @@ tp2.intersects(tp1); // --> true</screen>
<tbody>
<row>
<entry valign="top" morerows="1"><screen>operator&lt;&lt;</screen></entry>
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
<entry>Output streaming operator for time duration. Uses facet to output [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \
@@ -350,7 +350,7 @@ tp2.intersects(tp1); // --> true</screen>
<row>
<entry valign="top" morerows="1"><screen>operator&gt;&gt;</screen></entry>
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are left out when zero.</entry>
<entry>Input streaming operator for time duration. Uses facet to read [date time_of_day/date time_of_day]. The default is format is <code>[YYYY-mmm-DD hh:mm:ss.fffffffff/YYYY-mmm-DD hh:mm:ss.fffffffff]</code> string where <code>mmm</code> is 3 char month name and the fractional seconds are only included if non-zero.</entry>
</row>
<row>
<entry><screen>[2002-Jan-01 01:25:10.000000001/ \