update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -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

View File

@@ -26,7 +26,7 @@ namespace posix_time {
/*! Adds a months object and a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator+(const ptime& t, const boost::gregorian::months& m)
{
@@ -36,7 +36,7 @@ namespace posix_time {
/*! Adds a months object to a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator+=(ptime& t, const boost::gregorian::months& m)
{
@@ -47,7 +47,7 @@ namespace posix_time {
/*! Subtracts a months object and a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator-(const ptime& t, const boost::gregorian::months& m)
{
@@ -58,7 +58,7 @@ namespace posix_time {
/*! Subtracts a months object from a ptime. Result will be same
* day-of-month as ptime unless original day was the last day of month.
* see date_time::months_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator-=(ptime& t, const boost::gregorian::months& m)
{
@@ -70,7 +70,7 @@ namespace posix_time {
/*! Adds a years object and a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator+(const ptime& t, const boost::gregorian::years& y)
{
@@ -80,7 +80,7 @@ namespace posix_time {
/*! Adds a years object to a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator+=(ptime& t, const boost::gregorian::years& y)
{
@@ -90,7 +90,7 @@ namespace posix_time {
/*! Subtracts a years object and a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator-(const ptime& t, const boost::gregorian::years& y)
{
@@ -101,7 +101,7 @@ namespace posix_time {
/*! Subtracts a years object from a ptime. Result will be same
* month and day-of-month as ptime unless original day was the
* last day of month. see date_time::years_duration for more details */
inline
inline BOOST_CXX14_CONSTEXPR
ptime
operator-=(ptime& t, const boost::gregorian::years& y)
{

View File

@@ -1,7 +1,7 @@
#ifndef POSIX_TIME_CONFIG_HPP___
#define POSIX_TIME_CONFIG_HPP___
/* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc.
/* Copyright (c) 2002,2003,2005,2020 CrystalClear Software, Inc.
* 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)
@@ -22,32 +22,19 @@
namespace boost {
namespace posix_time {
//Remove the following line if you want 64 bit millisecond resolution time
//#define BOOST_GDTL_POSIX_TIME_STD_CONFIG
#ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
// set up conditional test compilations
#define BOOST_DATE_TIME_HAS_MILLISECONDS
#define BOOST_DATE_TIME_HAS_MICROSECONDS
#define BOOST_DATE_TIME_HAS_NANOSECONDS
typedef date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::nano,
1000000000, 9 > time_res_traits;
#else
// set up conditional test compilations
#define BOOST_DATE_TIME_HAS_MILLISECONDS
#define BOOST_DATE_TIME_HAS_MICROSECONDS
#undef BOOST_DATE_TIME_HAS_NANOSECONDS
typedef date_time::time_resolution_traits<
boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::micro,
1000000, 6 > time_res_traits;
// #undef BOOST_DATE_TIME_HAS_MILLISECONDS
// #undef BOOST_DATE_TIME_HAS_MICROSECONDS
// #undef BOOST_DATE_TIME_HAS_NANOSECONDS
// typedef date_time::time_resolution_traits<boost::int64_t, boost::date_time::tenth,
// 10, 0 > time_res_traits;
#endif
@@ -66,23 +53,23 @@ namespace posix_time {
typedef time_res_traits::fractional_seconds_type fractional_seconds_type;
typedef time_res_traits::tick_type tick_type;
typedef time_res_traits::impl_type impl_type;
time_duration(hour_type hour,
min_type min,
sec_type sec,
fractional_seconds_type fs=0) :
BOOST_CXX14_CONSTEXPR time_duration(hour_type hour,
min_type min,
sec_type sec,
fractional_seconds_type fs=0) :
date_time::time_duration<time_duration, time_res_traits>(hour,min,sec,fs)
{}
time_duration() :
BOOST_CXX14_CONSTEXPR time_duration() :
date_time::time_duration<time_duration, time_res_traits>(0,0,0)
{}
//! Construct from special_values
time_duration(boost::date_time::special_values sv) :
BOOST_CXX14_CONSTEXPR time_duration(boost::date_time::special_values sv) :
date_time::time_duration<time_duration, time_res_traits>(sv)
{}
//Give duration access to ticks constructor -- hide from users
friend class date_time::time_duration<time_duration, time_res_traits>;
protected:
explicit time_duration(impl_type tick_count) :
BOOST_CXX14_CONSTEXPR explicit time_duration(impl_type tick_count) :
date_time::time_duration<time_duration, time_res_traits>(tick_count)
{}
};
@@ -94,7 +81,7 @@ namespace posix_time {
{
typedef gregorian::date date_type;
typedef time_duration time_duration_type;
simple_time_rep(date_type d, time_duration_type tod) :
BOOST_CXX14_CONSTEXPR simple_time_rep(date_type d, time_duration_type tod) :
day(d),
time_of_day(tod)
{
@@ -116,19 +103,19 @@ namespace posix_time {
}
date_type day;
time_duration_type time_of_day;
bool is_special()const
BOOST_CXX14_CONSTEXPR bool is_special()const
{
return(is_pos_infinity() || is_neg_infinity() || is_not_a_date_time());
}
bool is_pos_infinity()const
BOOST_CXX14_CONSTEXPR bool is_pos_infinity()const
{
return(day.is_pos_infinity() || time_of_day.is_pos_infinity());
}
bool is_neg_infinity()const
BOOST_CXX14_CONSTEXPR bool is_neg_infinity()const
{
return(day.is_neg_infinity() || time_of_day.is_neg_infinity());
}
bool is_not_a_date_time()const
BOOST_CXX14_CONSTEXPR bool is_not_a_date_time()const
{
return(day.is_not_a_date() || time_of_day.is_not_a_date_time());
}

View File

@@ -1,7 +1,7 @@
#ifndef POSIX_TIME_DURATION_HPP___
#define POSIX_TIME_DURATION_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
/* Copyright (c) 2002,2003, 2020 CrystalClear Software, Inc.
* 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)
@@ -26,7 +26,7 @@ namespace posix_time {
{
public:
template <typename T>
explicit hours(T const& h,
BOOST_CXX14_CONSTEXPR explicit hours(T const& h,
typename boost::enable_if<boost::is_integral<T>, void>::type* = BOOST_DATE_TIME_NULLPTR) :
time_duration(numeric_cast<hour_type>(h), 0, 0)
{}
@@ -40,7 +40,7 @@ namespace posix_time {
{
public:
template <typename T>
explicit minutes(T const& m,
BOOST_CXX14_CONSTEXPR explicit minutes(T const& m,
typename boost::enable_if<boost::is_integral<T>, void>::type* = BOOST_DATE_TIME_NULLPTR) :
time_duration(0, numeric_cast<min_type>(m),0)
{}
@@ -54,7 +54,7 @@ namespace posix_time {
{
public:
template <typename T>
explicit seconds(T const& s,
BOOST_CXX14_CONSTEXPR explicit seconds(T const& s,
typename boost::enable_if<boost::is_integral<T>, void>::type* = BOOST_DATE_TIME_NULLPTR) :
time_duration(0,0, numeric_cast<sec_type>(s))
{}

View File

@@ -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);
}
}

View File

@@ -37,26 +37,44 @@ namespace posix_time {
typedef time_system_type::time_duration_type time_duration_type;
typedef ptime time_type;
//! Construct with date and offset in day
ptime(gregorian::date d,time_duration_type td) : date_time::base_time<time_type,time_system_type>(d,td)
BOOST_CXX14_CONSTEXPR
ptime(gregorian::date d,time_duration_type td) :
date_time::base_time<time_type,time_system_type>(d,td)
{}
//! Construct a time at start of the given day (midnight)
explicit ptime(gregorian::date d) : date_time::base_time<time_type,time_system_type>(d,time_duration_type(0,0,0))
BOOST_CXX14_CONSTEXPR
explicit ptime(gregorian::date d) :
date_time::base_time<time_type,time_system_type>(d,time_duration_type(0,0,0))
{}
//! Copy from time_rep
BOOST_CXX14_CONSTEXPR
ptime(const time_rep_type& rhs):
date_time::base_time<time_type,time_system_type>(rhs)
{}
//! Construct from special value
ptime(const special_values sv) : date_time::base_time<time_type,time_system_type>(sv)
BOOST_CXX14_CONSTEXPR
ptime(const special_values sv) :
date_time::base_time<time_type,time_system_type>(sv)
{}
#if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR)
// Default constructor constructs to not_a_date_time
ptime() : date_time::base_time<time_type,time_system_type>(gregorian::date(not_a_date_time), time_duration_type(not_a_date_time))
BOOST_CXX14_CONSTEXPR
ptime() :
date_time::base_time<time_type,time_system_type>(gregorian::date(not_a_date_time),
time_duration_type(not_a_date_time))
{}
#endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR
friend BOOST_CXX14_CONSTEXPR
bool operator==(const ptime& lhs, const ptime& rhs);
};
inline BOOST_CXX14_CONSTEXPR
bool operator==(const ptime& lhs, const ptime& rhs)
{
return ptime::time_system_type::is_equal(lhs.time_,rhs.time_);
}
} }//namespace posix_time

View File

@@ -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){

View File

@@ -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

View File

@@ -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');
}

View File

@@ -11,17 +11,9 @@
#include "boost/date_time/posix_time/posix_time.hpp"
#include "boost/date_time/gregorian/greg_serialize.hpp"
#include "boost/core/nvp.hpp"
#include "boost/numeric/conversion/cast.hpp"
#include "boost/serialization/split_free.hpp"
#include "boost/serialization/nvp.hpp"
#include "boost/serialization/version.hpp"
// macros to split serialize functions into save & load functions
// NOTE: these macros define template functions in the boost::serialization namespace.
// They must be expanded *outside* of any namespace
BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::ptime)
BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::time_duration)
BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::time_period)
#include "boost/type_traits/integral_constant.hpp"
// Define versions for serialization compatibility
// alows the unit tests to make an older version to check compatibility
@@ -29,11 +21,35 @@ BOOST_SERIALIZATION_SPLIT_FREE(boost::posix_time::time_period)
#define BOOST_DATE_TIME_POSIX_TIME_DURATION_VERSION 1
#endif
BOOST_CLASS_VERSION(boost::posix_time::time_duration, BOOST_DATE_TIME_POSIX_TIME_DURATION_VERSION)
namespace boost {
namespace serialization {
template<typename T>
struct version;
template<>
struct version<boost::posix_time::time_duration>
: integral_constant<int, BOOST_DATE_TIME_POSIX_TIME_DURATION_VERSION>
{
};
// A macro to split serialize functions into save & load functions.
// It is here to avoid dependency on Boost.Serialization just for the
// BOOST_SERIALIZATION_SPLIT_FREE macro
#define BOOST_DATE_TIME_SPLIT_FREE(T) \
template<class Archive> \
inline void serialize(Archive & ar, \
T & t, \
const unsigned int file_version) \
{ \
split_free(ar, t, file_version); \
}
BOOST_DATE_TIME_SPLIT_FREE(boost::posix_time::ptime)
BOOST_DATE_TIME_SPLIT_FREE(boost::posix_time::time_duration)
BOOST_DATE_TIME_SPLIT_FREE(boost::posix_time::time_period)
#undef BOOST_DATE_TIME_SPLIT_FREE
/*** time_duration ***/