diff options
Diffstat (limited to '3rdParty/Boost/src/boost/date_time')
98 files changed, 146 insertions, 148 deletions
diff --git a/3rdParty/Boost/src/boost/date_time/adjust_functors.hpp b/3rdParty/Boost/src/boost/date_time/adjust_functors.hpp index dde8ca8..f6c5a04 100644 --- a/3rdParty/Boost/src/boost/date_time/adjust_functors.hpp +++ b/3rdParty/Boost/src/boost/date_time/adjust_functors.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_ADJUST_FUNCTORS_HPP___ #define _DATE_TIME_ADJUST_FUNCTORS_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/date.hpp" #include "boost/date_time/wrapping_int.hpp" namespace boost { namespace date_time { //! Functor to iterate a fixed number of days template<class date_type> class day_functor { public: typedef typename date_type::duration_type duration_type; day_functor(int f) : f_(f) {} duration_type get_offset(const date_type& d) const { // why is 'd' a parameter??? // fix compiler warnings d.year(); return duration_type(f_); } duration_type get_neg_offset(const date_type& d) const { // fix compiler warnings d.year(); return duration_type(-f_); } private: int f_; }; //! Provides calculation to find next nth month given a date diff --git a/3rdParty/Boost/src/boost/date_time/c_local_time_adjustor.hpp b/3rdParty/Boost/src/boost/date_time/c_local_time_adjustor.hpp index 45e96d3..aa56312 100644 --- a/3rdParty/Boost/src/boost/date_time/c_local_time_adjustor.hpp +++ b/3rdParty/Boost/src/boost/date_time/c_local_time_adjustor.hpp @@ -1,66 +1,69 @@ #ifndef DATE_TIME_C_LOCAL_TIME_ADJUSTOR_HPP__ #define DATE_TIME_C_LOCAL_TIME_ADJUSTOR_HPP__ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ /*! @file c_local_time_adjustor.hpp Time adjustment calculations based on machine */ #include <stdexcept> #include <boost/throw_exception.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/c_time.hpp> namespace boost { namespace date_time { //! Adjust to / from utc using the C API /*! Warning!!! This class assumes that timezone settings of the * machine are correct. This can be a very dangerous assumption. */ template<class time_type> class c_local_adjustor { public: typedef typename time_type::time_duration_type time_duration_type; typedef typename time_type::date_type date_type; typedef typename date_type::duration_type date_duration_type; //! Convert a utc time to local time static time_type utc_to_local(const time_type& t) { date_type time_t_start_day(1970,1,1); time_type time_t_start_time(time_t_start_day,time_duration_type(0,0,0)); if (t < time_t_start_time) { boost::throw_exception(std::out_of_range("Cannot convert dates prior to Jan 1, 1970")); BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return time_t_start_time); // should never reach } date_duration_type dd = t.date() - time_t_start_day; time_duration_type td = t.time_of_day(); - std::time_t t2 = dd.days()*86400 + td.hours()*3600 + td.minutes()*60 + td.seconds(); + std::time_t t2 = static_cast<std::time_t>(dd.days())*86400 + + static_cast<std::time_t>(td.hours())*3600 + + static_cast<std::time_t>(td.minutes())*60 + + td.seconds(); std::tm tms, *tms_ptr; tms_ptr = c_time::localtime(&t2, &tms); date_type d(static_cast<unsigned short>(tms_ptr->tm_year + 1900), static_cast<unsigned short>(tms_ptr->tm_mon + 1), static_cast<unsigned short>(tms_ptr->tm_mday)); time_duration_type td2(tms_ptr->tm_hour, tms_ptr->tm_min, tms_ptr->tm_sec, t.time_of_day().fractional_seconds()); return time_type(d,td2); } }; } } //namespace date_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/c_time.hpp b/3rdParty/Boost/src/boost/date_time/c_time.hpp index f7e116b..5998908 100644 --- a/3rdParty/Boost/src/boost/date_time/c_time.hpp +++ b/3rdParty/Boost/src/boost/date_time/c_time.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_C_TIME_HPP___ #define DATE_TIME_C_TIME_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ /*! @file c_time.hpp Provide workarounds related to the ctime header */ #include <ctime> #include <string> // to be able to convert from string literals to exceptions #include <stdexcept> #include <boost/throw_exception.hpp> #include <boost/date_time/compiler_config.hpp> //Work around libraries that don't put time_t and time in namespace std #ifdef BOOST_NO_STDC_NAMESPACE namespace std { using ::time_t; using ::time; using ::localtime; using ::tm; using ::gmtime; } #endif // BOOST_NO_STDC_NAMESPACE //The following is used to support high precision time clocks #ifdef BOOST_HAS_GETTIMEOFDAY #include <sys/time.h> #endif #ifdef BOOST_HAS_FTIME #include <time.h> #endif namespace boost { namespace date_time { //! Provides a uniform interface to some 'ctime' functions /*! Provides a uniform interface to some ctime functions and * their '_r' counterparts. The '_r' functions require a pointer to a * user created std::tm struct whereas the regular functions use a * staticly created struct and return a pointer to that. These wrapper @@ -56,68 +56,68 @@ namespace date_time { inline static std::tm* localtime(const std::time_t* t, std::tm* result) { // localtime_r() not in namespace std??? #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 std::tm tmp; if(!localtime_r(t,&tmp)) result = 0; else *result = tmp; #else result = localtime_r(t, result); #endif if (!result) boost::throw_exception(std::runtime_error("could not convert calendar time to local time")); return result; } //! requires a pointer to a user created std::tm struct inline static std::tm* gmtime(const std::time_t* t, std::tm* result) { // gmtime_r() not in namespace std??? #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 std::tm tmp; if(!gmtime_r(t,&tmp)) result = 0; else *result = tmp; #else result = gmtime_r(t, result); #endif if (!result) boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time")); return result; } -#else // BOOST_HAS_THREADS +#else // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS #if (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 //! requires a pointer to a user created std::tm struct inline static std::tm* localtime(const std::time_t* t, std::tm* result) { result = std::localtime(t); if (!result) boost::throw_exception(std::runtime_error("could not convert calendar time to local time")); return result; } //! requires a pointer to a user created std::tm struct inline static std::tm* gmtime(const std::time_t* t, std::tm* result) { result = std::gmtime(t); if (!result) boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time")); return result; } #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) #pragma warning(pop) // restore warnings to previous state #endif // _MSC_VER >= 1400 -#endif // BOOST_HAS_THREADS +#endif // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS }; }} // namespaces #endif // DATE_TIME_C_TIME_HPP___ diff --git a/3rdParty/Boost/src/boost/date_time/compiler_config.hpp b/3rdParty/Boost/src/boost/date_time/compiler_config.hpp index 1aa1330..e37d061 100644 --- a/3rdParty/Boost/src/boost/date_time/compiler_config.hpp +++ b/3rdParty/Boost/src/boost/date_time/compiler_config.hpp @@ -1,43 +1,43 @@ #ifndef DATE_TIME_COMPILER_CONFIG_HPP___ #define DATE_TIME_COMPILER_CONFIG_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2011-07-26 10:40:21 -0700 (Tue, 26 Jul 2011) $ + * $Date$ */ #include <cstdlib> #include <boost/config.hpp> #include <boost/detail/workaround.hpp> // With boost release 1.33, date_time will be using a different, // more flexible, IO system. This new system is not compatible with // old compilers. The original date_time IO system remains for those // compilers. They must define this macro to use the legacy IO. // (defined(__BORLANDC__) && (__BORLANDC__ <= 0x0581) ) ) && #if( BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) \ || BOOST_WORKAROUND( __GNUC__, < 3) \ || (BOOST_WORKAROUND( _MSC_VER, <= 1300) ) \ ) \ && !defined(USE_DATE_TIME_PRE_1_33_FACET_IO) # define USE_DATE_TIME_PRE_1_33_FACET_IO #endif // This file performs some local compiler configurations #include <boost/date_time/locale_config.hpp> //set up locale configurations //Set up a configuration parameter for platforms that have //GetTimeOfDay #if defined(BOOST_HAS_GETTIMEOFDAY) || defined(BOOST_HAS_FTIME) #define BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK #endif // To Force no default constructors for date & ptime, un-comment following //#define DATE_TIME_NO_DEFAULT_CONSTRUCTOR // Include extensions to date_duration - comment out to remove this feature #define BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES diff --git a/3rdParty/Boost/src/boost/date_time/constrained_value.hpp b/3rdParty/Boost/src/boost/date_time/constrained_value.hpp index 7338105..910e99a 100644 --- a/3rdParty/Boost/src/boost/date_time/constrained_value.hpp +++ b/3rdParty/Boost/src/boost/date_time/constrained_value.hpp @@ -1,44 +1,44 @@ #ifndef CONSTRAINED_VALUE_HPP___ #define CONSTRAINED_VALUE_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <exception> #include <stdexcept> #include <boost/config.hpp> #include <boost/throw_exception.hpp> #include <boost/mpl/if.hpp> #include <boost/type_traits/is_base_of.hpp> namespace boost { //! Namespace containing constrained_value template and types namespace CV { //! Represent a min or max violation type enum violation_enum {min_violation, max_violation}; //! A template to specify a constrained basic value type /*! This template provides a quick way to generate * an integer type with a constrained range. The type * provides for the ability to specify the min, max, and * and error handling policy. * * <b>value policies</b> * A class that provides the range limits via the min and * max functions as well as a function on_error that * determines how errors are handled. A common strategy * would be to assert or throw and exception. The on_error * is passed both the current value and the new value that * is in error. * */ template<class value_policies> class constrained_value { public: typedef typename value_policies::value_type value_type; diff --git a/3rdParty/Boost/src/boost/date_time/date.hpp b/3rdParty/Boost/src/boost/date_time/date.hpp index f77ae29..2bd936c 100644 --- a/3rdParty/Boost/src/boost/date_time/date.hpp +++ b/3rdParty/Boost/src/boost/date_time/date.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_HPP___ #define DATE_TIME_DATE_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <boost/operators.hpp> #include <boost/date_time/year_month_day.hpp> #include <boost/date_time/special_defs.hpp> namespace boost { namespace date_time { //!Representation of timepoint at the one day level resolution. /*! 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 and comparisons. <b>Theory</b> This date representation fundamentally departs from the C tm struct approach. The goal for this type is to provide efficient date operations (add, subtract) and storage (minimize space to represent) in a concrete class. Thus, the date uses a count internally to represent a particular date. The calendar parameter defines the policies for converting the the year-month-day and internal counted form here. Applications that need to perform heavy formatting of the same date repeatedly will perform better by using the year-month-day representation. Internally the date uses a day number to represent the date. This is a monotonic time representation. This representation allows for fast comparison as well as simplifying the creation of writing numeric operations. Essentially, the internal day number is like adjusted julian day. The adjustment is determined by the Epoch date which is represented as day 1 of the calendar. Day 0 is reserved for negative infinity so that diff --git a/3rdParty/Boost/src/boost/date_time/date_clock_device.hpp b/3rdParty/Boost/src/boost/date_time/date_clock_device.hpp index 6202f6c..2145d65 100644 --- a/3rdParty/Boost/src/boost/date_time/date_clock_device.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_clock_device.hpp @@ -1,77 +1,77 @@ #ifndef DATE_CLOCK_DEVICE_HPP___ #define DATE_CLOCK_DEVICE_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/c_time.hpp" namespace boost { namespace date_time { //! A clock providing day level services based on C time_t capabilities /*! This clock uses Posix interfaces as its implementation and hence * uses the timezone settings of the operating system. Incorrect * user settings will result in incorrect results for the calls * to local_day. */ template<class date_type> class day_clock { public: typedef typename date_type::ymd_type ymd_type; //! Get the local day as a date type static date_type local_day() { return date_type(local_day_ymd()); } //! Get the local day as a ymd_type static typename date_type::ymd_type local_day_ymd() { ::std::tm result; ::std::tm* curr = get_local_time(result); - return ymd_type(curr->tm_year + 1900, - curr->tm_mon + 1, - curr->tm_mday); + return ymd_type(static_cast<unsigned short>(curr->tm_year + 1900), + static_cast<unsigned short>(curr->tm_mon + 1), + static_cast<unsigned short>(curr->tm_mday)); } //! Get the current day in universal date as a ymd_type static typename date_type::ymd_type universal_day_ymd() { ::std::tm result; ::std::tm* curr = get_universal_time(result); - return ymd_type(curr->tm_year + 1900, - curr->tm_mon + 1, - curr->tm_mday); + return ymd_type(static_cast<unsigned short>(curr->tm_year + 1900), + static_cast<unsigned short>(curr->tm_mon + 1), + static_cast<unsigned short>(curr->tm_mday)); } //! Get the UTC day as a date type static date_type universal_day() { return date_type(universal_day_ymd()); } private: static ::std::tm* get_local_time(std::tm& result) { ::std::time_t t; ::std::time(&t); return c_time::localtime(&t, &result); } static ::std::tm* get_universal_time(std::tm& result) { ::std::time_t t; ::std::time(&t); return c_time::gmtime(&t, &result); } }; } } //namespace date_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/date_defs.hpp b/3rdParty/Boost/src/boost/date_time/date_defs.hpp index ae7e4c5..6c80db3 100644 --- a/3rdParty/Boost/src/boost/date_time/date_defs.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_defs.hpp @@ -1,26 +1,26 @@ #ifndef DATE_TIME_DATE_DEFS_HPP #define DATE_TIME_DATE_DEFS_HPP /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { namespace date_time { //! An enumeration of weekday names enum weekdays {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}; //! Simple enum to allow for nice programming with Jan, Feb, etc enum months_of_year {Jan=1,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,NotAMonth,NumMonths}; } } //namespace date_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/date_duration.hpp b/3rdParty/Boost/src/boost/date_time/date_duration.hpp index c573944..f5b4b08 100644 --- a/3rdParty/Boost/src/boost/date_time/date_duration.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_duration.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_DURATION__ #define DATE_TIME_DATE_DURATION__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <boost/operators.hpp> #include <boost/date_time/special_defs.hpp> namespace boost { namespace date_time { //! Duration type with date level resolution template<class duration_rep_traits> class date_duration : private boost::less_than_comparable1< date_duration< duration_rep_traits > , boost::equality_comparable1< date_duration< duration_rep_traits > , boost::addable1< date_duration< duration_rep_traits > , boost::subtractable1< date_duration< duration_rep_traits > , boost::dividable2< date_duration< duration_rep_traits >, int > > > > > { public: typedef typename duration_rep_traits::int_type duration_rep_type; typedef typename duration_rep_traits::impl_type duration_rep; //! Construct from a day count explicit date_duration(duration_rep day_count) : days_(day_count) {} /*! construct from special_values - only works when * instantiated with duration_traits_adapted */ date_duration(special_values sv) : days_(duration_rep::from_special(sv)) {} // copy constructor required for addable<> & subtractable<> //! Construct from another date_duration (Copy Constructor) diff --git a/3rdParty/Boost/src/boost/date_time/date_duration_types.hpp b/3rdParty/Boost/src/boost/date_time/date_duration_types.hpp index e44c59f..8c0e986 100644 --- a/3rdParty/Boost/src/boost/date_time/date_duration_types.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_duration_types.hpp @@ -1,44 +1,44 @@ #ifndef DATE_DURATION_TYPES_HPP___ #define DATE_DURATION_TYPES_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <boost/date_time/int_adapter.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/date_duration.hpp> namespace boost { namespace date_time { //! Additional duration type that represents a number of n*7 days template <class duration_config> class weeks_duration : public date_duration<duration_config> { public: weeks_duration(typename duration_config::impl_type w) : date_duration<duration_config>(w * 7) {} weeks_duration(special_values sv) : date_duration<duration_config>(sv) {} }; // predeclare template<class t> class years_duration; //! additional duration type that represents a logical month /*! A logical month enables things like: "date(2002,Mar,2) + months(2) -> * 2002-May2". If the date is a last day-of-the-month, the result will * also be a last-day-of-the-month. */ template<class base_config> class months_duration { private: typedef typename base_config::int_rep int_rep; typedef typename int_rep::int_type int_type; diff --git a/3rdParty/Boost/src/boost/date_time/date_facet.hpp b/3rdParty/Boost/src/boost/date_time/date_facet.hpp index fc2ddc2..c3574cc 100644 --- a/3rdParty/Boost/src/boost/date_time/date_facet.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_facet.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_DATE_FACET__HPP___ #define _DATE_TIME_DATE_FACET__HPP___ /* Copyright (c) 2004-2005 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) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ #include <locale> #include <string> #include <vector> #include <iterator> // ostreambuf_iterator #include <boost/throw_exception.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/period.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/special_values_formatter.hpp> #include <boost/date_time/period_formatter.hpp> #include <boost/date_time/period_parser.hpp> #include <boost/date_time/date_generator_formatter.hpp> #include <boost/date_time/date_generator_parser.hpp> #include <boost/date_time/format_date_parser.hpp> namespace boost { namespace date_time { /*! Class that provides format based I/O facet for date types. * * This class allows the formatting of dates by using format string. * Format strings are: * * - %A => long_weekday_format - Full name Ex: Tuesday * - %a => short_weekday_format - Three letter abbreviation Ex: Tue * - %B => long_month_format - Full name Ex: October * - %b => short_month_format - Three letter abbreviation Ex: Oct * - %x => standard_format_specifier - defined by the locale * - %Y-%b-%d => default_date_format - YYYY-Mon-dd * * Default month format == %b * Default weekday format == %a diff --git a/3rdParty/Boost/src/boost/date_time/date_format_simple.hpp b/3rdParty/Boost/src/boost/date_time/date_format_simple.hpp index 05119c4..4529903 100644 --- a/3rdParty/Boost/src/boost/date_time/date_format_simple.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_format_simple.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_SIMPLE_FORMAT_HPP___ #define DATE_TIME_SIMPLE_FORMAT_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/parse_format_base.hpp" namespace boost { namespace date_time { //! Class to provide simple basic formatting rules template<class charT> class simple_format { public: //! String used printed is date is invalid static const charT* not_a_date() { return "not-a-date-time"; } //! String used to for positive infinity value static const charT* pos_infinity() { return "+infinity"; } //! String used to for positive infinity value static const charT* neg_infinity() { return "-infinity"; } //! Describe month format static month_format_spec month_format() { return month_as_short_string; } static ymd_order_spec date_order() { return ymd_order_iso; //YYYY-MM-DD diff --git a/3rdParty/Boost/src/boost/date_time/date_formatting.hpp b/3rdParty/Boost/src/boost/date_time/date_formatting.hpp index 06709bc..d4ca3dd 100644 --- a/3rdParty/Boost/src/boost/date_time/date_formatting.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_formatting.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_FORMATTING_HPP___ #define DATE_TIME_DATE_FORMATTING_HPP___ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ #include "boost/date_time/iso_format.hpp" #include "boost/date_time/compiler_config.hpp" #include <string> #include <sstream> #include <iomanip> /* NOTE: "formatter" code for older compilers, ones that define * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * date_formatting_limited.hpp */ namespace boost { namespace date_time { //! Formats a month as as string into an ostream template<class month_type, class format_type, class charT=char> class month_formatter { typedef std::basic_ostream<charT> ostream_type; public: //! Formats a month as as string into an ostream /*! This function demands that month_type provide * functions for converting to short and long strings * if that capability is used. */ static ostream_type& format_month(const month_type& month, ostream_type &os) { switch (format_type::month_format()) { case month_as_short_string: { os << month.as_short_string(); diff --git a/3rdParty/Boost/src/boost/date_time/date_formatting_limited.hpp b/3rdParty/Boost/src/boost/date_time/date_formatting_limited.hpp index 5721473..7c5c173 100644 --- a/3rdParty/Boost/src/boost/date_time/date_formatting_limited.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_formatting_limited.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_FORMATTING_LIMITED_HPP___ #define DATE_TIME_DATE_FORMATTING_LIMITED_HPP___ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/iso_format.hpp" #include "boost/date_time/compiler_config.hpp" #include <string> #include <sstream> #include <iomanip> namespace boost { namespace date_time { //! Formats a month as as string into an ostream template<class month_type, class format_type> class month_formatter { public: //! Formats a month as as string into an ostream /*! This function demands that month_type provide * functions for converting to short and long strings * if that capability is used. */ static std::ostream& format_month(const month_type& month, std::ostream& os) { switch (format_type::month_format()) { case month_as_short_string: { os << month.as_short_string(); break; } case month_as_long_string: { os << month.as_long_string(); diff --git a/3rdParty/Boost/src/boost/date_time/date_formatting_locales.hpp b/3rdParty/Boost/src/boost/date_time/date_formatting_locales.hpp index e3aec49..2c17c05 100644 --- a/3rdParty/Boost/src/boost/date_time/date_formatting_locales.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_formatting_locales.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ #define DATE_TIME_DATE_FORMATTING_LOCALES_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/locale_config.hpp" // set BOOST_DATE_TIME_NO_LOCALE #ifndef BOOST_DATE_TIME_NO_LOCALE #include "boost/date_time/iso_format.hpp" #include "boost/date_time/date_names_put.hpp" #include "boost/date_time/parse_format_base.hpp" //#include <string> #include <sstream> #include <iomanip> namespace boost { namespace date_time { //! Formats a month as as string into an ostream template<class facet_type, class charT = char> class ostream_month_formatter { public: typedef typename facet_type::month_type month_type; typedef std::basic_ostream<charT> ostream_type; //! Formats a month as as string into an output iterator static void format_month(const month_type& month, ostream_type& os, const facet_type& f) { switch (f.month_format()) { diff --git a/3rdParty/Boost/src/boost/date_time/date_generator_formatter.hpp b/3rdParty/Boost/src/boost/date_time/date_generator_formatter.hpp index 159cf36..42c396b 100644 --- a/3rdParty/Boost/src/boost/date_time/date_generator_formatter.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_generator_formatter.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_DATE_GENERATOR_FORMATTER__HPP___ #define _DATE_TIME_DATE_GENERATOR_FORMATTER__HPP___ /* Copyright (c) 2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <iostream> #include <string> #include <vector> #include <algorithm> #include "boost/date_time/date_generators.hpp" namespace boost { namespace date_time { //! Formats date_generators for output /*! Formatting of date_generators follows specific orders for the * various types of date_generators. * - partial_date => "dd Month" * - nth_day_of_the_week_in_month => "nth weekday of month" * - first_day_of_the_week_in_month => "first weekday of month" * - last_day_of_the_week_in_month => "last weekday of month" * - first_day_of_the_week_after => "weekday after" * - first_day_of_the_week_before => "weekday before" * While the order of the elements in these phrases cannot be changed, * the elements themselves can be. Weekday and Month get their formats * and names from the date_facet. The remaining elements are stored in * the date_generator_formatter and can be customized upon construction * or via a member function. The default elements are those shown in the * examples above. */ template <class date_type, class CharT, class OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > class date_generator_formatter { public: typedef partial_date<date_type> partial_date_type; typedef nth_kday_of_month<date_type> nth_kday_type; typedef first_kday_of_month<date_type> first_kday_type; typedef last_kday_of_month<date_type> last_kday_type; typedef first_kday_after<date_type> kday_after_type; diff --git a/3rdParty/Boost/src/boost/date_time/date_generator_parser.hpp b/3rdParty/Boost/src/boost/date_time/date_generator_parser.hpp index 7cff9ca..f4d7b27 100644 --- a/3rdParty/Boost/src/boost/date_time/date_generator_parser.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_generator_parser.hpp @@ -1,45 +1,45 @@ #ifndef DATE_TIME_DATE_GENERATOR_PARSER_HPP__ #define DATE_TIME_DATE_GENERATOR_PARSER_HPP__ /* Copyright (c) 2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <string> #include <vector> #include <iterator> // istreambuf_iterator #include <boost/throw_exception.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/string_parse_tree.hpp> #include <boost/date_time/date_generators.hpp> #include <boost/date_time/format_date_parser.hpp> namespace boost { namespace date_time { //! Class for date_generator parsing /*! The elements of a date_generator "phrase" are parsed from the input stream in a * particular order. All elements are required and the order in which they appear * cannot change, however, the elements themselves can be changed. The default * elements and their order are as follows: * * - partial_date => "dd Month" * - nth_day_of_the_week_in_month => "nth weekday of month" * - first_day_of_the_week_in_month => "first weekday of month" * - last_day_of_the_week_in_month => "last weekday of month" * - first_day_of_the_week_after => "weekday after" * - first_day_of_the_week_before => "weekday before" * * Weekday and Month names and formats are handled via the date_input_facet. * */ template<class date_type, typename charT> class date_generator_parser { public: typedef std::basic_string<charT> string_type; typedef std::istreambuf_iterator<charT> stream_itr_type; diff --git a/3rdParty/Boost/src/boost/date_time/date_generators.hpp b/3rdParty/Boost/src/boost/date_time/date_generators.hpp index 6d3a4ac..274ce1f 100644 --- a/3rdParty/Boost/src/boost/date_time/date_generators.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_generators.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_GENERATORS_HPP__ #define DATE_TIME_DATE_GENERATORS_HPP__ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ /*! @file date_generators.hpp Definition and implementation of date algorithm templates */ #include <stdexcept> #include <sstream> #include <boost/throw_exception.hpp> #include <boost/date_time/date.hpp> #include <boost/date_time/compiler_config.hpp> namespace boost { namespace date_time { //! Base class for all generators that take a year and produce a date. /*! This class is a base class for polymorphic function objects that take a year and produce a concrete date. @param date_type The type representing a date. This type must export a calender_type which defines a year_type. */ template<class date_type> class year_based_generator { public: typedef typename date_type::calendar_type calendar_type; typedef typename calendar_type::year_type year_type; year_based_generator() {} virtual ~year_based_generator() {} virtual date_type get_date(year_type y) const = 0; //! Returns a string for use in a POSIX time_zone string virtual std::string to_string() const =0; }; //! Generates a date by applying the year to the given month and day. diff --git a/3rdParty/Boost/src/boost/date_time/date_iterator.hpp b/3rdParty/Boost/src/boost/date_time/date_iterator.hpp index c8ec50e..3526ba1 100644 --- a/3rdParty/Boost/src/boost/date_time/date_iterator.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_iterator.hpp @@ -1,44 +1,44 @@ #ifndef DATE_ITERATOR_HPP___ #define DATE_ITERATOR_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <iterator> namespace boost { namespace date_time { //! An iterator over dates with varying resolution (day, week, month, year, etc) enum date_resolutions {day, week, months, year, decade, century, NumDateResolutions}; //! Base date iterator type /*! This class provides the skeleton for the creation of iterators. * New and interesting interators can be created by plugging in a new * function that derives the next value from the current state. * generation of various types of -based information. * * <b>Template Parameters</b> * * <b>date_type</b> * * The date_type is a concrete date_type. The date_type must * define a duration_type and a calendar_type. */ template<class date_type> class date_itr_base { // works, but benefit unclear at the moment // class date_itr_base : public std::iterator<std::input_iterator_tag, // date_type, void, void, void>{ public: typedef typename date_type::duration_type duration_type; typedef date_type value_type; typedef std::input_iterator_tag iterator_category; date_itr_base(date_type d) : current_(d) {} virtual ~date_itr_base() {} date_itr_base& operator++() diff --git a/3rdParty/Boost/src/boost/date_time/date_names_put.hpp b/3rdParty/Boost/src/boost/date_time/date_names_put.hpp index 32aeb36..e055fa8 100644 --- a/3rdParty/Boost/src/boost/date_time/date_names_put.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_names_put.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DATE_NAMES_PUT_HPP___ #define DATE_TIME_DATE_NAMES_PUT_HPP___ /* Copyright (c) 2002-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include "boost/date_time/locale_config.hpp" // set BOOST_DATE_TIME_NO_LOCALE #ifndef BOOST_DATE_TIME_NO_LOCALE #include "boost/date_time/special_defs.hpp" #include "boost/date_time/date_defs.hpp" #include "boost/date_time/parse_format_base.hpp" #include "boost/lexical_cast.hpp" #include <locale> namespace boost { namespace date_time { //! Output facet base class for gregorian dates. /*! This class is a base class for date facets used to localize the * names of months and the names of days in the week. * * Requirements of Config * - define an enumeration month_enum that enumerates the months. * The enumeration should be '1' based eg: Jan==1 * - define as_short_string and as_long_string * * (see langer & kreft p334). * */ template<class Config, class charT = char, class OutputIterator = std::ostreambuf_iterator<charT> > class date_names_put : public std::locale::facet { public: diff --git a/3rdParty/Boost/src/boost/date_time/date_parsing.hpp b/3rdParty/Boost/src/boost/date_time/date_parsing.hpp index 35ec8e4..33c5366 100644 --- a/3rdParty/Boost/src/boost/date_time/date_parsing.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_parsing.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_DATE_PARSING_HPP___ #define _DATE_TIME_DATE_PARSING_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ #include <string> #include <iterator> #include <algorithm> #include <boost/tokenizer.hpp> #include <boost/lexical_cast.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/parse_format_base.hpp> #if defined(BOOST_DATE_TIME_NO_LOCALE) #include <cctype> // ::tolower(int) #else #include <locale> // std::tolower(char, locale) #endif namespace boost { namespace date_time { //! A function to replace the std::transform( , , ,tolower) construct /*! This function simply takes a string, and changes all the characters * in that string to lowercase (according to the default system locale). * In the event that a compiler does not support locales, the old * C style tolower() is used. */ inline std::string convert_to_lower(std::string inp) { #if !defined(BOOST_DATE_TIME_NO_LOCALE) const std::locale loc(std::locale::classic()); #endif std::string::size_type i = 0, n = inp.length(); for (; i < n; ++i) { inp[i] = @@ -81,118 +81,116 @@ namespace date_time { * 'size' can be sent in with: (greg_month::max)() (which 12), * (greg_weekday::max)() + 1 (which is 7) or date_time::NumSpecialValues */ template<class charT> short find_match(const charT* const* short_names, const charT* const* long_names, short size, const std::basic_string<charT>& s) { for(short i = 0; i < size; ++i){ if(short_names[i] == s || long_names[i] == s){ return i; } } return size; // not-found, return a value out of range } //! Generic function to parse a delimited date (eg: 2002-02-10) /*! Accepted formats are: "2003-02-10" or " 2003-Feb-10" or * "2003-Feburary-10" * The order in which the Month, Day, & Year appear in the argument * string can be accomodated by passing in the appropriate ymd_order_spec */ template<class date_type> date_type parse_date(const std::string& s, int order_spec = ymd_order_iso) { std::string spec_str; if(order_spec == ymd_order_iso) { spec_str = "ymd"; } else if(order_spec == ymd_order_dmy) { spec_str = "dmy"; } else { // (order_spec == ymd_order_us) spec_str = "mdy"; } - typedef typename date_type::year_type year_type; typedef typename date_type::month_type month_type; unsigned pos = 0; unsigned short year(0), month(0), day(0); typedef typename std::basic_string<char>::traits_type traits_type; typedef boost::char_separator<char, traits_type> char_separator_type; typedef boost::tokenizer<char_separator_type, std::basic_string<char>::const_iterator, std::basic_string<char> > tokenizer; typedef boost::tokenizer<char_separator_type, std::basic_string<char>::const_iterator, std::basic_string<char> >::iterator tokenizer_iterator; // may need more delimiters, these work for the regression tests const char sep_char[] = {',','-','.',' ','/','\0'}; char_separator_type sep(sep_char); tokenizer tok(s,sep); for(tokenizer_iterator beg=tok.begin(); beg!=tok.end() && pos < spec_str.size(); ++beg, ++pos) { switch(spec_str.at(pos)) { case 'y': { year = boost::lexical_cast<unsigned short>(*beg); break; } case 'm': { month = month_str_to_ushort<month_type>(*beg); break; } case 'd': { day = boost::lexical_cast<unsigned short>(*beg); break; } default: break; } //switch } return date_type(year, month, day); } //! Generic function to parse undelimited date (eg: 20020201) template<class date_type> date_type parse_undelimited_date(const std::string& s) { int offsets[] = {4,2,2}; int pos = 0; - typedef typename date_type::year_type year_type; //typename date_type::ymd_type ymd((year_type::min)(),1,1); unsigned short y = 0, m = 0, d = 0; /* The two bool arguments state that parsing will not wrap * (only the first 8 characters will be parsed) and partial * strings will not be parsed. * Ex: * "2005121" will parse 2005 & 12, but not the "1" */ boost::offset_separator osf(offsets, offsets+3, false, false); typedef typename boost::tokenizer<boost::offset_separator, std::basic_string<char>::const_iterator, std::basic_string<char> > tokenizer_type; tokenizer_type tok(s, osf); for(typename tokenizer_type::iterator ti=tok.begin(); ti!=tok.end();++ti) { unsigned short i = boost::lexical_cast<unsigned short>(*ti); switch(pos) { case 0: y = i; break; case 1: m = i; break; case 2: d = i; break; default: break; } pos++; } return date_type(y,m,d); } //! Helper function for 'date gregorian::from_stream()' /*! Creates a string from the iterators that reference the * begining & end of a char[] or string. All elements are * used in output string */ template<class date_type, class iterator_type> inline date_type from_stream_type(iterator_type& beg, diff --git a/3rdParty/Boost/src/boost/date_time/dst_rules.hpp b/3rdParty/Boost/src/boost/date_time/dst_rules.hpp index cf65c16..3229019 100644 --- a/3rdParty/Boost/src/boost/date_time/dst_rules.hpp +++ b/3rdParty/Boost/src/boost/date_time/dst_rules.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_DST_RULES_HPP__ #define DATE_TIME_DST_RULES_HPP__ /* Copyright (c) 2002,2003, 2007 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ /*! @file dst_rules.hpp Contains template class to provide static dst rule calculations */ #include "boost/date_time/date_generators.hpp" #include "boost/date_time/period.hpp" #include "boost/date_time/date_defs.hpp" #include <stdexcept> namespace boost { namespace date_time { enum time_is_dst_result {is_not_in_dst, is_in_dst, ambiguous, invalid_time_label}; //! Dynamic class used to caluclate dst transition information template<class date_type_, class time_duration_type_> class dst_calculator { public: typedef time_duration_type_ time_duration_type; typedef date_type_ date_type; //! Check the local time offset when on dst start day /*! On this dst transition, the time label between * the transition boundary and the boudary + the offset * are invalid times. If before the boundary then still * not in dst. *@param time_of_day Time offset in the day for the local time *@param dst_start_offset_minutes Local day offset for start of dst *@param dst_length_minutes Number of minutes to adjust clock forward diff --git a/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp b/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp index 3c7f13f..ca5a1ad 100644 --- a/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp +++ b/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_FILETIME_FUNCTIONS_HPP__ #define DATE_TIME_FILETIME_FUNCTIONS_HPP__ /* Copyright (c) 2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ /*! @file filetime_functions.hpp * Function(s) for converting between a FILETIME structure and a * time object. This file is only available on systems that have * BOOST_HAS_FTIME defined. */ #include <boost/date_time/compiler_config.hpp> #if defined(BOOST_HAS_FTIME) // skip this file if no FILETIME #if defined(BOOST_USE_WINDOWS_H) # include <windows.h> #endif #include <boost/cstdint.hpp> #include <boost/date_time/time.hpp> #include <boost/date_time/date_defs.hpp> namespace boost { namespace date_time { namespace winapi { #if !defined(BOOST_USE_WINDOWS_H) extern "C" { struct FILETIME { boost::uint32_t dwLowDateTime; boost::uint32_t dwHighDateTime; }; diff --git a/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp b/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp index 0c3503f..a40dee6 100644 --- a/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp +++ b/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp @@ -1,149 +1,149 @@ #ifndef DATE_TIME_FORMAT_DATE_PARSER_HPP__ #define DATE_TIME_FORMAT_DATE_PARSER_HPP__ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ #include "boost/lexical_cast.hpp" #include "boost/date_time/string_parse_tree.hpp" #include "boost/date_time/strings_from_facet.hpp" #include "boost/date_time/special_values_parser.hpp" #include <string> #include <vector> #include <sstream> #include <iterator> #ifndef BOOST_NO_STDC_NAMESPACE # include <cctype> #else # include <ctype.h> #endif #ifdef BOOST_NO_STDC_NAMESPACE namespace std { using ::isspace; using ::isdigit; } #endif namespace boost { namespace date_time { //! Helper function for parsing fixed length strings into integers /*! Will consume 'length' number of characters from stream. Consumed * character are transfered to parse_match_result struct. * Returns '-1' if no number can be parsed or incorrect number of * digits in stream. */ template<typename int_type, typename charT> inline int_type fixed_string_to_int(std::istreambuf_iterator<charT>& itr, std::istreambuf_iterator<charT>& stream_end, parse_match_result<charT>& mr, unsigned int length, const charT& fill_char) { //typedef std::basic_string<charT> string_type; unsigned int j = 0; //string_type s; while (j < length && itr != stream_end && (std::isdigit(*itr) || *itr == fill_char)) { if(*itr == fill_char) { /* Since a fill_char can be anything, we convert it to a zero. * lexical_cast will behave predictably when zero is used as fill. */ mr.cache += ('0'); } else { mr.cache += (*itr); } itr++; j++; } - int_type i = -1; + int_type i = static_cast<int_type>(-1); // mr.cache will hold leading zeros. size() tells us when input is too short. if(mr.cache.size() < length) { return i; } try { i = boost::lexical_cast<int_type>(mr.cache); }catch(bad_lexical_cast&){ // we want to return -1 if the cast fails so nothing to do here } return i; } //! Helper function for parsing fixed length strings into integers /*! Will consume 'length' number of characters from stream. Consumed * character are transfered to parse_match_result struct. * Returns '-1' if no number can be parsed or incorrect number of * digits in stream. */ template<typename int_type, typename charT> inline int_type fixed_string_to_int(std::istreambuf_iterator<charT>& itr, std::istreambuf_iterator<charT>& stream_end, parse_match_result<charT>& mr, unsigned int length) { return fixed_string_to_int<int_type, charT>(itr, stream_end, mr, length, '0'); } //! Helper function for parsing varied length strings into integers /*! Will consume 'max_length' characters from stream only if those * characters are digits. Returns '-1' if no number can be parsed. * Will not parse a number preceeded by a '+' or '-'. */ template<typename int_type, typename charT> inline int_type var_string_to_int(std::istreambuf_iterator<charT>& itr, const std::istreambuf_iterator<charT>& stream_end, unsigned int max_length) { typedef std::basic_string<charT> string_type; unsigned int j = 0; string_type s; while (itr != stream_end && (j < max_length) && std::isdigit(*itr)) { s += (*itr); ++itr; ++j; } - int_type i = -1; + int_type i = static_cast<int_type>(-1); if(!s.empty()) { i = boost::lexical_cast<int_type>(s); } return i; } //! Class with generic date parsing using a format string /*! The following is the set of recognized format specifiers - %a - Short weekday name - %A - Long weekday name - %b - Abbreviated month name - %B - Full month name - %d - Day of the month as decimal 01 to 31 - %j - Day of year as decimal from 001 to 366 - %m - Month name as a decimal 01 to 12 - %U - Week number 00 to 53 with first Sunday as the first day of week 1? - %w - Weekday as decimal number 0 to 6 where Sunday == 0 - %W - Week number 00 to 53 where Monday is first day of week 1 - %x - facet default date representation - %y - Year without the century - eg: 04 for 2004 - %Y - Year with century The weekday specifiers (%a and %A) do not add to the date construction, but they provide a way to skip over the weekday names for formats that provide them. todo -- Another interesting feature that this approach could provide is an option to fill in any missing fields with the current values from the clock. So if you have %m-%d the parser would detect the missing year value and fill it in using the clock. todo -- What to do with the %x. %x in the classic facet is just bad... */ @@ -239,71 +239,72 @@ class format_date_parser parse_date(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, const special_values_parser<date_type,charT>& sv_parser) const { return parse_date(sitr, stream_end, m_format, sv_parser); } /*! Of all the objects that the format_date_parser can parse, only a * date can be a special value. Therefore, only parse_date checks * for special_values. */ date_type parse_date(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str, const special_values_parser<date_type,charT>& sv_parser) const { bool use_current_char = false; // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } short year(0), month(0), day(0), day_of_year(0);// wkday(0); /* Initialized the following to their minimum values. These intermediate * objects are used so we get specific exceptions when part of the input * is unparsable. * Ex: "205-Jan-15" will throw a bad_year, "2005-Jsn-15"- bad_month, etc.*/ year_type t_year(1400); month_type t_month(1); day_type t_day(1); day_of_week_type wkday(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { switch(*itr) { case 'a': { //this value is just throw away. It could be used for //error checking potentially, but it isn't helpful in //actually constructing the date - we just need to get it //out of the stream match_results mr = m_weekday_short_names.match(sitr, stream_end); if(mr.current_match == match_results::PARSE_ERROR) { // check special_values if(sv_parser.match(sitr, stream_end, mr)) { return date_type(static_cast<special_values>(mr.current_match)); } } wkday = mr.current_match; if (mr.has_remaining()) { use_current_char = true; } break; } case 'A': { //this value is just throw away. It could be used for //error checking potentially, but it isn't helpful in //actually constructing the date - we just need to get it //out of the stream match_results mr = m_weekday_long_names.match(sitr, stream_end); if(mr.current_match == match_results::PARSE_ERROR) { // check special_values if(sv_parser.match(sitr, stream_end, mr)) { return date_type(static_cast<special_values>(mr.current_match)); } } wkday = mr.current_match; @@ -438,300 +439,293 @@ class format_date_parser sitr++; } } } if (day_of_year > 0) { date_type d(static_cast<unsigned short>(year-1),12,31); //end of prior year return d + duration_type(day_of_year); } return date_type(t_year, t_month, t_day); // exceptions were thrown earlier // if input was no good } //! Throws bad_month if unable to parse month_type parse_month(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str) const { match_results mr; return parse_month(sitr, stream_end, format_str, mr); } //! Throws bad_month if unable to parse month_type parse_month(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str, match_results& mr) const { bool use_current_char = false; // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } - charT current_char = *sitr; short month(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { switch(*itr) { case 'b': { mr = m_month_short_names.match(sitr, stream_end); month = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; } case 'B': { mr = m_month_long_names.match(sitr, stream_end); month = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; } case 'm': { month = var_string_to_int<short, charT>(sitr, stream_end, 2); // var_string_to_int returns -1 if parse failed. That will // cause a bad_month exception to be thrown so we do nothing here break; } default: {} //ignore those we don't understand }//switch } else { // itr == '%', second consecutive sitr++; } itr++; //advance past format specifier } else { //skip past chars in format and in buffer itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; } } } return month_type(month); // throws bad_month exception when values are zero } //! Expects 1 or 2 digits 1-31. Throws bad_day_of_month if unable to parse day_type parse_var_day_of_month(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end) const { // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } return day_type(var_string_to_int<short, charT>(sitr, stream_end, 2)); } //! Expects 2 digits 01-31. Throws bad_day_of_month if unable to parse day_type parse_day_of_month(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end) const { // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } //return day_type(var_string_to_int<short, charT>(sitr, stream_end, 2)); match_results mr; return day_type(fixed_string_to_int<short, charT>(sitr, stream_end, mr, 2)); } day_of_week_type parse_weekday(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str) const { match_results mr; return parse_weekday(sitr, stream_end, format_str, mr); } day_of_week_type parse_weekday(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str, match_results& mr) const { bool use_current_char = false; // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } - charT current_char = *sitr; short wkday(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { switch(*itr) { case 'a': { //this value is just throw away. It could be used for //error checking potentially, but it isn't helpful in //actually constructing the date - we just need to get it //out of the stream mr = m_weekday_short_names.match(sitr, stream_end); wkday = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; } case 'A': { //this value is just throw away. It could be used for //error checking potentially, but it isn't helpful in //actually constructing the date - we just need to get it //out of the stream mr = m_weekday_long_names.match(sitr, stream_end); wkday = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; } case 'w': { // weekday as number 0-6, Sunday == 0 wkday = var_string_to_int<short, charT>(sitr, stream_end, 2); break; } default: {} //ignore those we don't understand }//switch } else { // itr == '%', second consecutive sitr++; } itr++; //advance past format specifier } else { //skip past chars in format and in buffer itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; } } } return day_of_week_type(wkday); // throws bad_day_of_month exception // when values are zero } //! throws bad_year if unable to parse year_type parse_year(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str) const { match_results mr; return parse_year(sitr, stream_end, format_str, mr); } //! throws bad_year if unable to parse year_type parse_year(std::istreambuf_iterator<charT>& sitr, std::istreambuf_iterator<charT>& stream_end, string_type format_str, match_results& mr) const { bool use_current_char = false; // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } - charT current_char = *sitr; unsigned short year(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { //match_results mr; switch(*itr) { case 'Y': { // year from 4 digit string year = fixed_string_to_int<short, charT>(sitr, stream_end, mr, 4); break; } case 'y': { // year from 2 digit string (no century) year = fixed_string_to_int<short, charT>(sitr, stream_end, mr, 2); year += 2000; //make 2 digit years in this century break; } default: {} //ignore those we don't understand }//switch } else { // itr == '%', second consecutive sitr++; } itr++; //advance past format specifier } else { //skip past chars in format and in buffer itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; } } } return year_type(year); // throws bad_year exception when values are zero } private: string_type m_format; parse_tree_type m_month_short_names; parse_tree_type m_month_long_names; parse_tree_type m_weekday_short_names; parse_tree_type m_weekday_long_names; }; } } //namespace #endif diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp index 33f6856..c844c4e 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp @@ -1,44 +1,44 @@ #ifndef _GREGORIAN__CONVERSION_HPP___ #define _GREGORIAN__CONVERSION_HPP___ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $ + * $Date$ */ #include <cstring> #include <string> #include <stdexcept> #include <boost/throw_exception.hpp> #include <boost/date_time/c_time.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/gregorian/gregorian_types.hpp> namespace boost { namespace gregorian { //! Converts a date to a tm struct. Throws out_of_range exception if date is a special value inline std::tm to_tm(const date& d) { if (d.is_special()) { std::string s = "tm unable to handle "; switch (d.as_special()) { case date_time::not_a_date_time: s += "not-a-date-time value"; break; case date_time::neg_infin: s += "-infinity date value"; break; case date_time::pos_infin: s += "+infinity date value"; break; default: s += "a special date value"; break; } boost::throw_exception(std::out_of_range(s)); } diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/formatters.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/formatters.hpp index eda7dc3..d486ef0 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/formatters.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/formatters.hpp @@ -1,44 +1,44 @@ #ifndef GREGORIAN_FORMATTERS_HPP___ #define GREGORIAN_FORMATTERS_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/gregorian/gregorian_types.hpp" #if defined(BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) #include "boost/date_time/date_formatting_limited.hpp" #else #include "boost/date_time/date_formatting.hpp" #endif #include "boost/date_time/iso_format.hpp" #include "boost/date_time/date_format_simple.hpp" /* NOTE: "to_*_string" code for older compilers, ones that define * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * formatters_limited.hpp */ namespace boost { namespace gregorian { // wrapper function for to_simple_(w)string(date) template<class charT> inline std::basic_string<charT> to_simple_string_type(const date& d) { return date_time::date_formatter<date,date_time::simple_format<charT>,charT>::date_to_string(d); } //! To YYYY-mmm-DD string where mmm 3 char month name. Example: 2002-Jan-01 /*!\ingroup date_format */ inline std::string to_simple_string(const date& d) { return to_simple_string_type<char>(d); } // wrapper function for to_simple_(w)string(date_period) diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/formatters_limited.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/formatters_limited.hpp index 8dfd2d0..755f5aa 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/formatters_limited.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/formatters_limited.hpp @@ -1,44 +1,44 @@ #ifndef GREGORIAN_FORMATTERS_LIMITED_HPP___ #define GREGORIAN_FORMATTERS_LIMITED_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/date_formatting_limited.hpp" #include "boost/date_time/iso_format.hpp" #include "boost/date_time/date_format_simple.hpp" #include "boost/date_time/compiler_config.hpp" namespace boost { namespace gregorian { //! To YYYY-mmm-DD string where mmm 3 char month name. Example: 2002-Jan-01 /*!\ingroup date_format */ inline std::string to_simple_string(const date& d) { return date_time::date_formatter<date,date_time::simple_format<char> >::date_to_string(d); } //! Convert date period to simple string. Example: [2002-Jan-01/2002-Jan-02] /*!\ingroup date_format */ inline std::string to_simple_string(const date_period& d) { std::string s("["); std::string d1(date_time::date_formatter<date,date_time::simple_format<char> >::date_to_string(d.begin())); std::string d2(date_time::date_formatter<date,date_time::simple_format<char> >::date_to_string(d.last())); return std::string("[" + d1 + "/" + d2 + "]"); } //! Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231 /*!\ingroup date_format */ inline std::string to_iso_string(const date_period& d) { std::string s(date_time::date_formatter<date,date_time::iso_format<char> >::date_to_string(d.begin())); return s + "/" + date_time::date_formatter<date,date_time::iso_format<char> >::date_to_string(d.last()); } diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp index e9c1852..34ce0ae 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp @@ -1,44 +1,44 @@ #ifndef GREGORIAN_GREGORIAN_CALENDAR_HPP__ #define GREGORIAN_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/cstdint.hpp> #include <boost/date_time/gregorian/greg_weekday.hpp> #include <boost/date_time/gregorian/greg_day_of_year.hpp> #include <boost/date_time/gregorian_calendar.hpp> #include <boost/date_time/gregorian/greg_ymd.hpp> #include <boost/date_time/int_adapter.hpp> namespace boost { namespace gregorian { //!An internal date representation that includes infinities, not a date typedef date_time::int_adapter<uint32_t> fancy_date_rep; //! Gregorian calendar for this implementation, hard work in the base class gregorian_calendar : public date_time::gregorian_calendar_base<greg_year_month_day, fancy_date_rep::int_type> { public: //! Type to hold a weekday (eg: Sunday, Monday,...) typedef greg_weekday day_of_week_type; //! Counter type from 1 to 366 for gregorian dates. typedef greg_day_of_year_rep day_of_year_type; //! Internal date representation that handles infinity, not a date typedef fancy_date_rep date_rep_type; //! Date rep implements the traits stuff as well typedef fancy_date_rep date_traits_type; private: }; } } //namespace gregorian diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp index 860a407..f7aa2fc 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp @@ -1,44 +1,44 @@ #ifndef GREG_DATE_HPP___ #define GREG_DATE_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/throw_exception.hpp> #include <boost/date_time/date.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/gregorian/greg_calendar.hpp> #include <boost/date_time/gregorian/greg_duration.hpp> namespace boost { namespace gregorian { //bring special enum values into the namespace using date_time::special_values; using date_time::not_special; using date_time::neg_infin; using date_time::pos_infin; using date_time::not_a_date_time; using date_time::max_date_time; using date_time::min_date_time; //! A date type based on gregorian_calendar /*! This class is the primary interface for programming with greogorian dates. The is a lightweight type that can be freely passed by value. All comparison operators are supported. \ingroup date_basics */ class date : public date_time::date<date, gregorian_calendar, date_duration> { public: typedef gregorian_calendar::year_type year_type; typedef gregorian_calendar::month_type month_type; typedef gregorian_calendar::day_type day_type; typedef gregorian_calendar::day_of_year_type day_of_year_type; typedef gregorian_calendar::ymd_type ymd_type; diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_day.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_day.hpp index 4ea829f..4a2d5e7 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_day.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_day.hpp @@ -1,44 +1,44 @@ #ifndef GREG_DAY_HPP___ #define GREG_DAY_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" #include <stdexcept> #include <string> namespace boost { namespace gregorian { //! Exception type for gregorian day of month (1..31) struct bad_day_of_month : public std::out_of_range { bad_day_of_month() : std::out_of_range(std::string("Day of month value is out of range 1..31")) {} //! Allow other classes to throw with unique string for bad day like Feb 29 bad_day_of_month(const std::string& s) : std::out_of_range(s) {} }; //! Policy class that declares error handling and day of month ranges typedef CV::simple_exception_policy<unsigned short, 1, 31, bad_day_of_month> greg_day_policies; //! Generated represetation for gregorian day of month typedef CV::constrained_value<greg_day_policies> greg_day_rep; //! Represent a day of the month (range 1 - 31) /*! This small class allows for simple conversion an integer value into a day of the month for a standard gregorian calendar. The type is automatically range checked so values outside of the range 1-31 will cause a bad_day_of_month exception */ class greg_day : public greg_day_rep { public: greg_day(unsigned short day_of_month) : greg_day_rep(day_of_month) {} diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_day_of_year.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_day_of_year.hpp index 2f8874d..abf0c9e 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_day_of_year.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_day_of_year.hpp @@ -1,38 +1,38 @@ #ifndef GREG_DAY_OF_YEAR_HPP___ #define GREG_DAY_OF_YEAR_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" #include <stdexcept> #include <string> namespace boost { namespace gregorian { //! Exception type for day of year (1..366) struct bad_day_of_year : public std::out_of_range { bad_day_of_year() : std::out_of_range(std::string("Day of year value is out of range 1..366")) {} }; //! A day of the year range (1..366) typedef CV::simple_exception_policy<unsigned short,1,366,bad_day_of_year> greg_day_of_year_policies; //! Define a range representation type for the day of the year 1..366 typedef CV::constrained_value<greg_day_of_year_policies> greg_day_of_year_rep; } } //namespace gregorian #endif diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration.hpp index a9c0c17..dc6ad60 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration.hpp @@ -1,44 +1,44 @@ #ifndef GREG_DURATION_HPP___ #define GREG_DURATION_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <boost/date_time/date_duration.hpp> #include <boost/date_time/int_adapter.hpp> #include <boost/date_time/special_defs.hpp> namespace boost { namespace gregorian { //!An internal date representation that includes infinities, not a date typedef boost::date_time::duration_traits_adapted date_duration_rep; //! Durations in days for gregorian system /*! \ingroup date_basics */ class date_duration : public boost::date_time::date_duration< date_duration_rep > { typedef boost::date_time::date_duration< date_duration_rep > base_type; public: typedef base_type::duration_rep duration_rep; //! Construct from a day count explicit date_duration(duration_rep day_count = 0) : base_type(day_count) {} //! construct from special_values date_duration(date_time::special_values sv) : base_type(sv) {} //! Copy constructor date_duration(const date_duration& other) : base_type(static_cast< base_type const& >(other)) {} //! Construct from another date_duration date_duration(const base_type& other) : base_type(other) diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration_types.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration_types.hpp index 8328ca3..d1f9a65 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration_types.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_duration_types.hpp @@ -1,43 +1,43 @@ #ifndef GREG_DURATION_TYPES_HPP___ #define GREG_DURATION_TYPES_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * Subject to Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <boost/date_time/gregorian/greg_date.hpp> #include <boost/date_time/int_adapter.hpp> #include <boost/date_time/adjust_functors.hpp> #include <boost/date_time/date_duration_types.hpp> #include <boost/date_time/gregorian/greg_duration.hpp> namespace boost { namespace gregorian { //! config struct for additional duration types (ie months_duration<> & years_duration<>) struct greg_durations_config { typedef date date_type; typedef date_time::int_adapter<int> int_rep; typedef date_time::month_functor<date_type> month_adjustor_type; }; typedef date_time::months_duration<greg_durations_config> months; typedef date_time::years_duration<greg_durations_config> years; class weeks_duration : public date_duration { public: weeks_duration(duration_rep w) : date_duration(w * 7) {} weeks_duration(date_time::special_values sv) : date_duration(sv) {} }; typedef weeks_duration weeks; }} // namespace boost::gregorian #endif // GREG_DURATION_TYPES_HPP___ diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_facet.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_facet.hpp index 9efc619..b8c6d57 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_facet.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_facet.hpp @@ -1,44 +1,44 @@ #ifndef GREGORIAN_FACET_HPP___ #define GREGORIAN_FACET_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-23 03:13:35 -0800 (Sun, 23 Nov 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/date_formatting_locales.hpp" // sets BOOST_DATE_TIME_NO_LOCALE #include "boost/date_time/gregorian/parsers.hpp" //This file is basically commented out if locales are not supported #ifndef BOOST_DATE_TIME_NO_LOCALE #include <string> #include <memory> #include <locale> #include <iostream> #include <exception> namespace boost { namespace gregorian { //! Configuration of the output facet template struct greg_facet_config { typedef boost::gregorian::greg_month month_type; typedef boost::date_time::special_values special_value_enum; typedef boost::gregorian::months_of_year month_enum; typedef boost::date_time::weekdays weekday_enum; }; #if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) //! Create the base facet type for gregorian::date typedef boost::date_time::date_names_put<greg_facet_config> greg_base_facet; //! ostream operator for gregorian::date /*! Uses the date facet to determine various output parameters including: * - string values for the month (eg: Jan, Feb, Mar) (default: English) * - string values for special values (eg: not-a-date-time) (default: English) @@ -65,71 +65,71 @@ namespace gregorian { inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const greg_month& m) { typedef boost::date_time::date_names_put<greg_facet_config, charT> facet_def; typedef boost::date_time::ostream_month_formatter<facet_def, charT> greg_month_formatter; std::locale locale = os.getloc(); if (std::has_facet<facet_def>(locale)) { const facet_def& f = std::use_facet<facet_def>(locale); greg_month_formatter::format_month(m, os, f); } else { //default to numeric charT fill_char = '0'; os << std::setw(2) << std::setfill(fill_char) << m.as_number(); } return os; } //! operator<< for gregorian::greg_weekday typically streaming: Sun, Mon, Tue, ... /*! Uses the date facet to determine output string as well as selection of long or short string. * Default if no facet is installed is to output a 3 char english string for the * day of the week. */ template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const greg_weekday& wd) { typedef boost::date_time::date_names_put<greg_facet_config, charT> facet_def; typedef boost::date_time::ostream_weekday_formatter<greg_weekday, facet_def, charT> greg_weekday_formatter; std::locale locale = os.getloc(); if (std::has_facet<facet_def>(locale)) { const facet_def& f = std::use_facet<facet_def>(locale); - greg_weekday_formatter::format_weekday(wd.as_enum(), os, f, true); + greg_weekday_formatter::format_weekday(wd, os, f, true); } else { //default to short English string eg: Sun, Mon, Tue, Wed... os << wd.as_short_string(); } return os; } //! operator<< for gregorian::date_period typical output: [2002-Jan-01/2002-Jan-31] /*! Uses the date facet to determine output string as well as selection of long * or short string fr dates. * Default if no facet is installed is to output a 3 char english string for the * day of the week. */ template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const date_period& dp) { os << '['; //TODO: facet or manipulator for periods? os << dp.begin(); os << '/'; //TODO: facet or manipulator for periods? os << dp.last(); os << ']'; return os; } template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const date_duration& dd) { //os << dd.days(); os << dd.get_rep(); return os; @@ -182,72 +182,70 @@ namespace gregorian { << lkd.month().as_short_string() ; return os; } //! operator<< for gregorian::first_kday_after. Output: "first Mon after" template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const first_kday_after& fka) { os << fka.day_of_week() << " after"; return os; } //! operator<< for gregorian::first_kday_before. Output: "first Mon before" template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const first_kday_before& fkb) { os << fkb.day_of_week() << " before"; return os; } #endif // USE_DATE_TIME_PRE_1_33_FACET_IO /**************** Input Streaming ******************/ #if !defined(BOOST_NO_STD_ITERATOR_TRAITS) //! operator>> for gregorian::date template<class charT> inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, date& d) { std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos; - - typedef boost::date_time::all_date_names_put<greg_facet_config, charT> facet_def; d = from_stream(beg, eos); return is; } #endif // BOOST_NO_STD_ITERATOR_TRAITS //! operator>> for gregorian::date_duration template<class charT> inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, date_duration& dd) { long v; is >> v; dd = date_duration(v); return is; } //! operator>> for gregorian::date_period template<class charT> inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, date_period& dp) { std::basic_string<charT> s; is >> s; dp = date_time::from_simple_string_type<date>(s); return is; } //! generates a locale with the set of gregorian name-strings of type char* BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, char type); //! Returns a pointer to a facet with a default set of names (English) /* Necessary in the event an exception is thrown from op>> for * weekday or month. See comments in those functions for more info */ diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_month.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_month.hpp index b48a8a8..d483f77 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_month.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_month.hpp @@ -1,44 +1,44 @@ #ifndef GREG_MONTH_HPP___ #define GREG_MONTH_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" #include "boost/date_time/date_defs.hpp" #include "boost/shared_ptr.hpp" #include "boost/date_time/compiler_config.hpp" #include <stdexcept> #include <string> #include <map> #include <algorithm> #include <cctype> namespace boost { namespace gregorian { typedef date_time::months_of_year months_of_year; //bring enum values into the namespace using date_time::Jan; using date_time::Feb; using date_time::Mar; using date_time::Apr; using date_time::May; using date_time::Jun; using date_time::Jul; using date_time::Aug; using date_time::Sep; using date_time::Oct; using date_time::Nov; using date_time::Dec; using date_time::NotAMonth; using date_time::NumMonths; //! Exception thrown if a greg_month is constructed with a value out of range struct bad_month : public std::out_of_range diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_serialize.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_serialize.hpp index 2cfad93..a870c70 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_serialize.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_serialize.hpp @@ -1,44 +1,44 @@ #ifndef GREGORIAN_SERIALIZE_HPP___ #define GREGORIAN_SERIALIZE_HPP___ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/gregorian/parsers.hpp" #include "boost/serialization/split_free.hpp" #include "boost/serialization/nvp.hpp" // macros to split serialize functions into save & load functions // An expanded version is below for gregorian::date // NOTE: these macros define template functions in the boost::serialization namespace. // They must be expanded *outside* of any namespace BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_duration) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_duration::duration_rep) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_period) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_year) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_month) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_day) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_weekday) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::partial_date) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::nth_kday_of_month) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::first_kday_of_month) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::last_kday_of_month) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::first_kday_before) BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::first_kday_after) namespace boost { namespace serialization { /*! Method that does serialization for gregorian::date -- splits to load/save */ template<class Archive> inline void serialize(Archive & ar, ::boost::gregorian::date & d, const unsigned int file_version) diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_weekday.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_weekday.hpp index ab68fcd..60fec32 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_weekday.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_weekday.hpp @@ -1,44 +1,44 @@ #ifndef GREG_WEEKDAY_HPP___ #define GREG_WEEKDAY_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" #include "boost/date_time/date_defs.hpp" #include "boost/date_time/compiler_config.hpp" #include <stdexcept> #include <string> namespace boost { namespace gregorian { //bring enum values into the namespace using date_time::Sunday; using date_time::Monday; using date_time::Tuesday; using date_time::Wednesday; using date_time::Thursday; using date_time::Friday; using date_time::Saturday; //! Exception that flags that a weekday number is incorrect struct bad_weekday : public std::out_of_range { bad_weekday() : std::out_of_range(std::string("Weekday is out of range 0..6")) {} }; typedef CV::simple_exception_policy<unsigned short, 0, 6, bad_weekday> greg_weekday_policies; typedef CV::constrained_value<greg_weekday_policies> greg_weekday_rep; //! Represent a day within a week (range 0==Sun to 6==Sat) class BOOST_DATE_TIME_DECL greg_weekday : public greg_weekday_rep { public: typedef boost::date_time::weekdays weekday_enum; greg_weekday(unsigned short day_of_week_num) : diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_year.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_year.hpp index 322f40d..3d98fd0 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_year.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_year.hpp @@ -1,44 +1,44 @@ #ifndef GREG_YEAR_HPP___ #define GREG_YEAR_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" #include <stdexcept> #include <string> namespace boost { namespace gregorian { //! Exception type for gregorian year struct bad_year : public std::out_of_range { bad_year() : std::out_of_range(std::string("Year is out of valid range: 1400..10000")) {} }; //! Policy class that declares error handling gregorian year type typedef CV::simple_exception_policy<unsigned short, 1400, 10000, bad_year> greg_year_policies; //! Generated representation for gregorian year typedef CV::constrained_value<greg_year_policies> greg_year_rep; //! Represent a day of the month (range 1900 - 10000) /*! This small class allows for simple conversion an integer value into a year for the gregorian calendar. This currently only allows a range of 1900 to 10000. Both ends of the range are a bit arbitrary at the moment, but they are the limits of current testing of the library. As such they may be increased in the future. */ class greg_year : public greg_year_rep { public: greg_year(unsigned short year) : greg_year_rep(year) {} operator unsigned short() const {return value_;} private: diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_ymd.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_ymd.hpp index e7d441e..503666c 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_ymd.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_ymd.hpp @@ -1,33 +1,33 @@ #ifndef DATE_TIME_GREG_YMD_HPP__ #define DATE_TIME_GREG_YMD_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/year_month_day.hpp" #include "boost/date_time/special_defs.hpp" #include "boost/date_time/gregorian/greg_day.hpp" #include "boost/date_time/gregorian/greg_year.hpp" #include "boost/date_time/gregorian/greg_month.hpp" namespace boost { namespace gregorian { typedef date_time::year_month_day_base<greg_year, greg_month, greg_day> greg_year_month_day; } } //namespace gregorian #endif diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/gregorian.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/gregorian.hpp index becbc06..47d545e 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/gregorian.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/gregorian.hpp @@ -1,38 +1,38 @@ #ifndef GREGORIAN_HPP__ #define GREGORIAN_HPP__ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file gregorian.hpp Single file header that provides overall include for all elements of the gregorian date-time system. This includes the various types defined, but also other functions for formatting and parsing. */ #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/gregorian/conversion.hpp" #if defined(BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) #include "boost/date_time/gregorian/formatters_limited.hpp" #else #include "boost/date_time/gregorian/formatters.hpp" #endif #if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) #include "boost/date_time/gregorian/greg_facet.hpp" #else #include "boost/date_time/gregorian/gregorian_io.hpp" #endif // USE_DATE_TIME_PRE_1_33_FACET_IO #include "boost/date_time/gregorian/parsers.hpp" #endif diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_io.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_io.hpp index e6ba01f..e0a23f3 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_io.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_io.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_GREGORIAN_IO_HPP__ #define DATE_TIME_GREGORIAN_IO_HPP__ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <locale> #include <iostream> #include <iterator> // i/ostreambuf_iterator #include <boost/io/ios_state.hpp> #include <boost/date_time/date_facet.hpp> #include <boost/date_time/period_parser.hpp> #include <boost/date_time/period_formatter.hpp> #include <boost/date_time/special_values_parser.hpp> #include <boost/date_time/special_values_formatter.hpp> #include <boost/date_time/gregorian/gregorian_types.hpp> #include <boost/date_time/gregorian/conversion.hpp> // to_tm will be needed in the facets namespace boost { namespace gregorian { typedef boost::date_time::period_formatter<wchar_t> wperiod_formatter; typedef boost::date_time::period_formatter<char> period_formatter; typedef boost::date_time::date_facet<date,wchar_t> wdate_facet; typedef boost::date_time::date_facet<date,char> date_facet; typedef boost::date_time::period_parser<date,char> period_parser; typedef boost::date_time::period_parser<date,wchar_t> wperiod_parser; typedef boost::date_time::special_values_formatter<char> special_values_formatter; typedef boost::date_time::special_values_formatter<wchar_t> wspecial_values_formatter; typedef boost::date_time::special_values_parser<date,char> special_values_parser; typedef boost::date_time::special_values_parser<date,wchar_t> wspecial_values_parser; typedef boost::date_time::date_input_facet<date,char> date_input_facet; typedef boost::date_time::date_input_facet<date,wchar_t> wdate_input_facet; diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_types.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_types.hpp index 3f4b92f..d50e9cc 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_types.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/gregorian_types.hpp @@ -1,44 +1,44 @@ #ifndef _GREGORIAN_TYPES_HPP__ #define _GREGORIAN_TYPES_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file gregorian_types.hpp Single file header that defines most of the types for the gregorian date-time system. */ #include "boost/date_time/date.hpp" #include "boost/date_time/period.hpp" #include "boost/date_time/gregorian/greg_calendar.hpp" #include "boost/date_time/gregorian/greg_duration.hpp" #if defined(BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) #include "boost/date_time/gregorian/greg_duration_types.hpp" #endif #include "boost/date_time/gregorian/greg_date.hpp" #include "boost/date_time/date_generators.hpp" #include "boost/date_time/date_clock_device.hpp" #include "boost/date_time/date_iterator.hpp" #include "boost/date_time/adjust_functors.hpp" namespace boost { //! Gregorian date system based on date_time components /*! This date system defines a full complement of types including * a date, date_duration, date_period, day_clock, and a * day_iterator. */ namespace gregorian { //! Date periods for the gregorian system /*!\ingroup date_basics */ typedef date_time::period<date, date_duration> date_period; //! A unifying date_generator base type /*! A unifying date_generator base type for: diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/parsers.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/parsers.hpp index a2fa4e1..afc6537 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/parsers.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/parsers.hpp @@ -1,44 +1,44 @@ #ifndef GREGORIAN_PARSERS_HPP___ #define GREGORIAN_PARSERS_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/date_parsing.hpp" #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/parse_format_base.hpp" #include <string> #include <sstream> namespace boost { namespace gregorian { //! Return special_value from string argument /*! Return special_value from string argument. If argument is * not one of the special value names (defined in src/gregorian/names.hpp), * return 'not_special' */ BOOST_DATE_TIME_DECL special_values special_value_from_string(const std::string& s); //! Deprecated: Use from_simple_string inline date from_string(std::string s) { return date_time::parse_date<date>(s); } //! From delimited date string where with order year-month-day eg: 2002-1-25 or 2003-Jan-25 (full month name is also accepted) inline date from_simple_string(std::string s) { return date_time::parse_date<date>(s, date_time::ymd_order_iso); } //! From delimited date string where with order year-month-day eg: 1-25-2003 or Jan-25-2003 (full month name is also accepted) inline date from_us_string(std::string s) { return date_time::parse_date<date>(s, date_time::ymd_order_us); } //! From delimited date string where with order day-month-year eg: 25-1-2002 or 25-Jan-2003 (full month name is also accepted) inline date from_uk_string(std::string s) { diff --git a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp index b645aa4..dfe3771 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_GREGORIAN_CALENDAR_HPP__ #define DATE_TIME_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ namespace boost { namespace date_time { //! An implementation of the Gregorian calendar /*! This is a parameterized implementation of a proleptic Gregorian Calendar that can be used in the creation of date systems or just to perform calculations. All the methods of this class are static functions, so the intent is to never create instances of this class. @param ymd_type_ Struct type representing the year, month, day. The ymd_type must define a of types for the year, month, and day. These types need to be arithmetic types. @param date_int_type_ Underlying type for the date count. Must be an arithmetic type. */ template<typename ymd_type_, typename date_int_type_> class gregorian_calendar_base { public: //! define a type a date split into components typedef ymd_type_ ymd_type; //! define a type for representing months typedef typename ymd_type::month_type month_type; //! define a type for representing days typedef typename ymd_type::day_type day_type; //! Type to hold a stand alone year value (eg: 2002) typedef typename ymd_type::year_type year_type; //! Define the integer type to use for internal calculations typedef date_int_type_ date_int_type; static unsigned short day_of_week(const ymd_type& ymd); static int week_number(const ymd_type&ymd); //static unsigned short day_of_year(date_int_type); diff --git a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp index af19394..8a58c88 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp +++ b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp @@ -1,41 +1,41 @@ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #ifndef NO_BOOST_DATE_TIME_INLINE #undef BOOST_DATE_TIME_INLINE #define BOOST_DATE_TIME_INLINE inline #endif namespace boost { namespace date_time { //! Return the day of the week (0==Sunday, 1==Monday, etc) /*! Converts a year-month-day into a day of the week number */ template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE unsigned short gregorian_calendar_base<ymd_type_,date_int_type_>::day_of_week(const ymd_type& ymd) { unsigned short a = static_cast<unsigned short>((14-ymd.month)/12); unsigned short y = static_cast<unsigned short>(ymd.year - a); unsigned short m = static_cast<unsigned short>(ymd.month + 12*a - 2); unsigned short d = static_cast<unsigned short>((ymd.day + y + (y/4) - (y/100) + (y/400) + (31*m)/12) % 7); //std::cout << year << "-" << month << "-" << day << " is day: " << d << "\n"; return d; } //!Return the iso 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. */ template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE int gregorian_calendar_base<ymd_type_,date_int_type_>::week_number(const ymd_type& ymd) { unsigned long julianbegin = julian_day_number(ymd_type(ymd.year,1,1)); diff --git a/3rdParty/Boost/src/boost/date_time/int_adapter.hpp b/3rdParty/Boost/src/boost/date_time/int_adapter.hpp index d1246e7..81f68f6 100644 --- a/3rdParty/Boost/src/boost/date_time/int_adapter.hpp +++ b/3rdParty/Boost/src/boost/date_time/int_adapter.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_INT_ADAPTER_HPP__ #define _DATE_TIME_INT_ADAPTER_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include "boost/config.hpp" #include "boost/limits.hpp" //work around compilers without limits #include "boost/date_time/special_defs.hpp" #include "boost/date_time/locale_config.hpp" #ifndef BOOST_DATE_TIME_NO_LOCALE # include <ostream> #endif namespace boost { namespace date_time { //! Adapter to create integer types with +-infinity, and not a value /*! This class is used internally in counted date/time representations. * It adds the floating point like features of infinities and * not a number. It also provides mathmatical operations with * consideration to special values following these rules: *@code * +infinity - infinity == Not A Number (NAN) * infinity * non-zero == infinity * infinity * zero == NAN * +infinity * -integer == -infinity * infinity / infinity == NAN * infinity * infinity == infinity *@endcode */ template<typename int_type_> class int_adapter { public: typedef int_type_ int_type; int_adapter(int_type v) : value_(v) diff --git a/3rdParty/Boost/src/boost/date_time/iso_format.hpp b/3rdParty/Boost/src/boost/date_time/iso_format.hpp index 1f9e73d..2e7942d 100644 --- a/3rdParty/Boost/src/boost/date_time/iso_format.hpp +++ b/3rdParty/Boost/src/boost/date_time/iso_format.hpp @@ -1,44 +1,44 @@ #ifndef ISO_FORMAT_HPP___ #define ISO_FORMAT_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/parse_format_base.hpp" namespace boost { namespace date_time { //! Class to provide common iso formatting spec template<class charT> class iso_format_base { public: //! Describe month format -- its an integer in iso format static month_format_spec month_format() { return month_as_integer; } //! String used printed is date is invalid static const charT* not_a_date() { return "not-a-date-time"; } //! String used to for positive infinity value static const charT* pos_infinity() { return "+infinity"; } //! String used to for positive infinity value static const charT* neg_infinity() { return "-infinity"; } //! ISO char for a year -- used in durations static charT year_sep_char() diff --git a/3rdParty/Boost/src/boost/date_time/local_time/conversion.hpp b/3rdParty/Boost/src/boost/date_time/local_time/conversion.hpp index a530de4..aa0b72c 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/conversion.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/conversion.hpp @@ -1,34 +1,34 @@ #ifndef DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ #define DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ #include "boost/date_time/posix_time/conversion.hpp" #include "boost/date_time/c_time.hpp" #include "boost/date_time/local_time/local_date_time.hpp" namespace boost { namespace local_time { //! Function that creates a tm struct from a local_date_time inline std::tm to_tm(const local_date_time& lt) { std::tm lt_tm = posix_time::to_tm(lt.local_time()); if(lt.is_dst()){ lt_tm.tm_isdst = 1; } else{ lt_tm.tm_isdst = 0; } return lt_tm; } }} // namespaces #endif // DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ diff --git a/3rdParty/Boost/src/boost/date_time/local_time/custom_time_zone.hpp b/3rdParty/Boost/src/boost/date_time/local_time/custom_time_zone.hpp index 84c59a3..b89218a 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/custom_time_zone.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/custom_time_zone.hpp @@ -1,102 +1,102 @@ #ifndef LOCAL_TIME_CUSTOM_TIME_ZONE_HPP__ #define LOCAL_TIME_CUSTOM_TIME_ZONE_HPP__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include "boost/date_time/time_zone_base.hpp" #include "boost/date_time/time_zone_names.hpp" #include "boost/date_time/posix_time/posix_time.hpp" #include "boost/date_time/local_time/dst_transition_day_rules.hpp" #include "boost/date_time/string_convert.hpp" //#include "boost/date_time/special_defs.hpp" #include "boost/shared_ptr.hpp" namespace boost { namespace local_time { //typedef boost::date_time::time_zone_names time_zone_names; typedef boost::date_time::dst_adjustment_offsets<boost::posix_time::time_duration> dst_adjustment_offsets; //typedef boost::date_time::time_zone_base<boost::posix_time::ptime> time_zone; typedef boost::shared_ptr<dst_calc_rule> dst_calc_rule_ptr; //! A real time zone template<class CharT> class custom_time_zone_base : public date_time::time_zone_base<posix_time::ptime,CharT> { public: typedef boost::posix_time::time_duration time_duration_type; typedef date_time::time_zone_base<posix_time::ptime,CharT> base_type; typedef typename base_type::string_type string_type; typedef typename base_type::stringstream_type stringstream_type; typedef date_time::time_zone_names_base<CharT> time_zone_names; typedef CharT char_type; custom_time_zone_base(const time_zone_names& zone_names, const time_duration_type& utc_offset, const dst_adjustment_offsets& dst_shift, boost::shared_ptr<dst_calc_rule> calc_rule) : zone_names_(zone_names), base_utc_offset_(utc_offset), dst_offsets_(dst_shift), dst_calc_rules_(calc_rule) {} virtual ~custom_time_zone_base() {} virtual string_type dst_zone_abbrev() const { return zone_names_.dst_zone_abbrev(); } virtual string_type std_zone_abbrev() const { return zone_names_.std_zone_abbrev(); } virtual string_type dst_zone_name() const { return zone_names_.dst_zone_name(); } virtual string_type std_zone_name() const { return zone_names_.std_zone_name(); } //! True if zone uses daylight savings adjustments virtual bool has_dst() const { - return (dst_calc_rules_); //if calc_rule is set the tz has dst + return (bool) dst_calc_rules_; //if calc_rule is set the tz has dst } //! Local time that DST starts -- NADT if has_dst is false virtual posix_time::ptime dst_local_start_time(gregorian::greg_year y) const { gregorian::date d(gregorian::not_a_date_time); if (dst_calc_rules_) { d = dst_calc_rules_->start_day(y); } return posix_time::ptime(d, dst_offsets_.dst_start_offset_); } //! Local time that DST ends -- NADT if has_dst is false virtual posix_time::ptime dst_local_end_time(gregorian::greg_year y) const { gregorian::date d(gregorian::not_a_date_time); if (dst_calc_rules_) { d = dst_calc_rules_->end_day(y); } return posix_time::ptime(d, dst_offsets_.dst_end_offset_); } //! Base offset from UTC for zone (eg: -07:30:00) virtual time_duration_type base_utc_offset() const { return base_utc_offset_; } //! Adjustment forward or back made while DST is in effect virtual time_duration_type dst_offset() const { return dst_offsets_.dst_adjust_; } //! Returns a POSIX time_zone string for this object virtual string_type to_posix_string() const { // std offset dst [offset],start[/time],end[/time] - w/o spaces stringstream_type ss; ss.fill('0'); diff --git a/3rdParty/Boost/src/boost/date_time/local_time/date_duration_operators.hpp b/3rdParty/Boost/src/boost/date_time/local_time/date_duration_operators.hpp index b4c325d..e0f170f 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/date_duration_operators.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/date_duration_operators.hpp @@ -1,44 +1,44 @@ #ifndef LOCAL_TIME_DATE_DURATION_OPERATORS_HPP___ #define LOCAL_TIME_DATE_DURATION_OPERATORS_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/greg_duration_types.hpp" #include "boost/date_time/local_time/local_date_time.hpp" namespace boost { namespace local_time { /*!@file date_duration_operators.hpp Operators for local_date_time and * optional gregorian types. Operators use snap-to-end-of-month behavior. * Further details on this behavior can be found in reference for * date_time/date_duration_types.hpp and documentation for * month and year iterators. */ /*! Adds a months object and a local_date_time. Result will be same * day-of-month as local_date_time unless original day was the last day of month. * see date_time::months_duration for more details */ inline local_date_time operator+(const local_date_time& t, const boost::gregorian::months& m) { return t + m.get_offset(t.utc_time().date()); } /*! Adds a months object to a local_date_time. Result will be same * day-of-month as local_date_time unless original day was the last day of month. * see date_time::months_duration for more details */ inline local_date_time operator+=(local_date_time& t, const boost::gregorian::months& m) { return t += m.get_offset(t.utc_time().date()); } diff --git a/3rdParty/Boost/src/boost/date_time/local_time/dst_transition_day_rules.hpp b/3rdParty/Boost/src/boost/date_time/local_time/dst_transition_day_rules.hpp index d82731c..f372e44 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/dst_transition_day_rules.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/dst_transition_day_rules.hpp @@ -1,43 +1,43 @@ #ifndef LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__ #define LOCAL_TIME_DST_TRANSITION_DAY_RULES_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" #include "boost/date_time/dst_transition_generators.hpp" namespace boost { namespace local_time { //! Provides rule of the form starting Apr 30 ending Oct 21 typedef date_time::dst_day_calc_rule<gregorian::date> dst_calc_rule; struct partial_date_rule_spec { typedef gregorian::date date_type; typedef gregorian::partial_date start_rule; typedef gregorian::partial_date end_rule; }; //! Provides rule of the form first Sunday in April, last Saturday in Oct typedef date_time::day_calc_dst_rule<partial_date_rule_spec> partial_date_dst_rule; struct first_last_rule_spec { typedef gregorian::date date_type; typedef gregorian::first_kday_of_month start_rule; typedef gregorian::last_kday_of_month end_rule; }; //! Provides rule of the form first Sunday in April, last Saturday in Oct typedef date_time::day_calc_dst_rule<first_last_rule_spec> first_last_dst_rule; struct last_last_rule_spec { typedef gregorian::date date_type; diff --git a/3rdParty/Boost/src/boost/date_time/local_time/local_date_time.hpp b/3rdParty/Boost/src/boost/date_time/local_time/local_date_time.hpp index 96b2915..a3762d9 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/local_date_time.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/local_date_time.hpp @@ -1,43 +1,43 @@ #ifndef LOCAL_TIME_LOCAL_DATE_TIME_HPP__ #define LOCAL_TIME_LOCAL_DATE_TIME_HPP__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <string> #include <iomanip> #include <sstream> #include <stdexcept> #include <boost/shared_ptr.hpp> #include <boost/throw_exception.hpp> #include <boost/date_time/time.hpp> #include <boost/date_time/posix_time/posix_time.hpp> //todo remove? #include <boost/date_time/dst_rules.hpp> #include <boost/date_time/time_zone_base.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/time_resolution_traits.hpp> // absolute_value namespace boost { namespace local_time { //! simple exception for reporting when STD or DST cannot be determined struct ambiguous_result : public std::logic_error { ambiguous_result (std::string const& msg = std::string()) : std::logic_error(std::string("Daylight Savings Results are ambiguous: " + msg)) {} }; //! simple exception for when time label given cannot exist struct time_label_invalid : public std::logic_error { time_label_invalid (std::string const& msg = std::string()) : std::logic_error(std::string("Time label given is invalid: " + msg)) {} }; struct dst_not_valid: public std::logic_error { dst_not_valid(std::string const& msg = std::string()) : std::logic_error(std::string("is_dst flag does not match resulting dst for time label given: " + msg)) {} }; diff --git a/3rdParty/Boost/src/boost/date_time/local_time/local_time.hpp b/3rdParty/Boost/src/boost/date_time/local_time/local_time.hpp index 162cac5..880989b 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/local_time.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/local_time.hpp @@ -1,24 +1,24 @@ #ifndef LOCAL_TIME_LOCAL_TIME_HPP__ #define LOCAL_TIME_LOCAL_TIME_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time.hpp" #include "boost/date_time/local_time/local_date_time.hpp" #include "boost/date_time/local_time/local_time_types.hpp" #if !defined(USE_DATE_TIME_PRE_1_33_FACET_IO) #include "boost/date_time/local_time/local_time_io.hpp" #endif // USE_DATE_TIME_PRE_1_33_FACET_IO #include "boost/date_time/local_time/posix_time_zone.hpp" #include "boost/date_time/local_time/custom_time_zone.hpp" #include "boost/date_time/local_time/tz_database.hpp" #include "boost/date_time/local_time/conversion.hpp" #include "boost/date_time/time_zone_base.hpp" #endif diff --git a/3rdParty/Boost/src/boost/date_time/local_time/local_time_io.hpp b/3rdParty/Boost/src/boost/date_time/local_time/local_time_io.hpp index b5e3c3f..c32b81e 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/local_time_io.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/local_time_io.hpp @@ -1,74 +1,73 @@ #ifndef BOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ #define BOOST_DATE_TIME_LOCAL_TIME_IO_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <locale> #include <iostream> #include <iterator> // i/ostreambuf_iterator #include <boost/io/ios_state.hpp> #include <boost/date_time/time_facet.hpp> #include <boost/date_time/string_convert.hpp> #include <boost/date_time/local_time/local_date_time.hpp> #include <boost/date_time/local_time/posix_time_zone.hpp> #include <boost/date_time/local_time/conversion.hpp> // to_tm will be needed in the facets namespace boost { namespace local_time { typedef boost::date_time::time_facet<local_date_time, wchar_t> wlocal_time_facet; typedef boost::date_time::time_facet<local_date_time, char> local_time_facet; typedef boost::date_time::time_input_facet<local_date_time::utc_time_type,wchar_t> wlocal_time_input_facet; typedef boost::date_time::time_input_facet<local_date_time::utc_time_type,char> local_time_input_facet; //! operator<< for local_date_time - see local_time docs for formatting details template<class CharT, class TraitsT> inline std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& os, const local_date_time& ldt) { boost::io::ios_flags_saver iflags(os); typedef local_date_time time_type;//::utc_time_type typename typedef date_time::time_facet<time_type, CharT> custom_time_facet; - typedef std::time_put<CharT> std_time_facet; std::ostreambuf_iterator<CharT> oitr(os); if(std::has_facet<custom_time_facet>(os.getloc())) { std::use_facet<custom_time_facet>(os.getloc()).put(oitr, os, os.fill(), ldt); } else { custom_time_facet* f = new custom_time_facet(); std::locale l = std::locale(os.getloc(), f); os.imbue(l); f->put(oitr, os, os.fill(), ldt); } return os; } //! input operator for local_date_time template <class CharT, class Traits> inline std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, local_date_time& ldt) { boost::io::ios_flags_saver iflags(is); typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false); if (strm_sentry) { try { typedef typename local_date_time::utc_time_type utc_time_type; typedef typename date_time::time_input_facet<utc_time_type, CharT> time_input_facet; // intermediate objects std::basic_string<CharT> tz_str; utc_time_type pt(not_a_date_time); @@ -91,71 +90,70 @@ namespace local_time { else { time_zone_ptr tz_ptr(new posix_time_zone(date_time::convert_string_type<CharT,char>(tz_str))); // the "date & time" constructor expects the time label to *not* be utc. // a posix_tz_string also expects the time label to *not* be utc. ldt = local_date_time(pt.date(), pt.time_of_day(), tz_ptr, local_date_time::EXCEPTION_ON_ERROR); } } catch(...) { // mask tells us what exceptions are turned on std::ios_base::iostate exception_mask = is.exceptions(); // if the user wants exceptions on failbit, we'll rethrow our // date_time exception & set the failbit if(std::ios_base::failbit & exception_mask) { try { is.setstate(std::ios_base::failbit); } catch(std::ios_base::failure&) {} // ignore this one throw; // rethrow original exception } else { // if the user want's to fail quietly, we simply set the failbit is.setstate(std::ios_base::failbit); } } } return is; } //! output operator for local_time_period template <class CharT, class TraitsT> inline std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& os, const boost::local_time::local_time_period& p) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<local_date_time, CharT> custom_facet; - typedef std::time_put<CharT> std_time_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_facet>(os.getloc())) { std::use_facet<custom_facet>(os.getloc()).put(oitr, os, os.fill(), p); } else { //instantiate a custom facet for dealing with periods since the user //has not put one in the stream so far. This is for efficiency //since we would always need to reconstruct for every time period //if the local did not already exist. Of course this will be overridden //if the user imbues as some later point. custom_facet* f = new custom_facet(); std::locale l = std::locale(os.getloc(), f); os.imbue(l); f->put(oitr, os, os.fill(), p); } return os; } //! input operator for local_time_period template <class CharT, class Traits> inline std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, boost::local_time::local_time_period& tp) { boost::io::ios_flags_saver iflags(is); typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false); if (strm_sentry) { try { typedef typename date_time::time_input_facet<local_date_time, CharT> time_input_facet; std::istreambuf_iterator<CharT,Traits> sit(is), str_end; if(std::has_facet<time_input_facet>(is.getloc())) { std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, tp); } else { diff --git a/3rdParty/Boost/src/boost/date_time/local_time/local_time_types.hpp b/3rdParty/Boost/src/boost/date_time/local_time/local_time_types.hpp index 5e04422..df2d08c 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/local_time_types.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/local_time_types.hpp @@ -1,43 +1,43 @@ #ifndef LOCAL_TIME_LOCAL_TIME_TYPES_HPP__ #define LOCAL_TIME_LOCAL_TIME_TYPES_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/local_time/local_date_time.hpp" #include "boost/date_time/period.hpp" #include "boost/date_time/time_iterator.hpp" #include "boost/date_time/compiler_config.hpp" #if defined(BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) #include "boost/date_time/local_time/date_duration_operators.hpp" #endif //BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES #include "boost/date_time/local_time/custom_time_zone.hpp" namespace boost { namespace local_time { typedef boost::date_time::period<local_date_time, boost::posix_time::time_duration> local_time_period; typedef date_time::time_itr<local_date_time> local_time_iterator; typedef date_time::second_clock<local_date_time> local_sec_clock; typedef date_time::microsec_clock<local_date_time> local_microsec_clock; typedef date_time::time_zone_base<posix_time::ptime, char> time_zone; typedef date_time::time_zone_base<posix_time::ptime, wchar_t> wtime_zone; //! Shared Pointer for custom_time_zone and posix_time_zone objects typedef boost::shared_ptr<time_zone> time_zone_ptr; typedef boost::shared_ptr<wtime_zone> wtime_zone_ptr; typedef date_time::time_zone_names_base<char> time_zone_names; typedef date_time::time_zone_names_base<wchar_t> wtime_zone_names; //bring special enum values into the namespace using date_time::special_values; using date_time::not_special; diff --git a/3rdParty/Boost/src/boost/date_time/local_time/posix_time_zone.hpp b/3rdParty/Boost/src/boost/date_time/local_time/posix_time_zone.hpp index ee1b553..d0ef31d 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/posix_time_zone.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/posix_time_zone.hpp @@ -1,43 +1,43 @@ #ifndef _DATE_TIME_POSIX_TIME_ZONE__ #define _DATE_TIME_POSIX_TIME_ZONE__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <string> #include <sstream> #include <stdexcept> #include <boost/tokenizer.hpp> #include <boost/throw_exception.hpp> #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/time_zone_names.hpp> #include <boost/date_time/time_zone_base.hpp> #include <boost/date_time/local_time/dst_transition_day_rules.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/string_convert.hpp> #include <boost/date_time/time_parsing.hpp> namespace boost{ namespace local_time{ //! simple exception for UTC and Daylight savings start/end offsets struct bad_offset : public std::out_of_range { bad_offset(std::string const& msg = std::string()) : std::out_of_range(std::string("Offset out of range: " + msg)) {} }; //! simple exception for UTC daylight savings adjustment struct bad_adjustment : public std::out_of_range { bad_adjustment(std::string const& msg = std::string()) : std::out_of_range(std::string("Adjustment out of range: " + msg)) {} }; typedef boost::date_time::dst_adjustment_offsets<boost::posix_time::time_duration> dst_adjustment_offsets; //! A time zone class constructed from a POSIX time zone string /*! A POSIX time zone string takes the form of:<br> @@ -398,73 +398,73 @@ namespace local_time{ em = lexical_cast<unsigned short>(*it++); ew = lexical_cast<unsigned short>(*it++); ed = lexical_cast<unsigned short>(*it); dst_calc_rules_ = shared_ptr<dst_calc_rule>( new nth_kday_dst_rule( nth_last_dst_rule::start_rule( static_cast<nkday::week_num>(sw),sd,sm), nth_last_dst_rule::start_rule( static_cast<nkday::week_num>(ew),ed,em) ) ); } //! Julian day. Feb29 is never counted, even in leap years // expects range of 1-365 void julian_no_leap(const string_type& s, const string_type& e){ typedef gregorian::gregorian_calendar calendar; const unsigned short year = 2001; // Non-leap year unsigned short sm=1; int sd=0; sd = lexical_cast<int>(s.substr(1)); // skip 'J' while(sd >= calendar::end_of_month_day(year,sm)){ sd -= calendar::end_of_month_day(year,sm++); } unsigned short em=1; int ed=0; ed = lexical_cast<int>(e.substr(1)); // skip 'J' while(ed > calendar::end_of_month_day(year,em)){ ed -= calendar::end_of_month_day(year,em++); } dst_calc_rules_ = shared_ptr<dst_calc_rule>( new partial_date_dst_rule( partial_date_dst_rule::start_rule( - sd, static_cast<date_time::months_of_year>(sm)), + static_cast<unsigned short>(sd), static_cast<date_time::months_of_year>(sm)), partial_date_dst_rule::end_rule( - ed, static_cast<date_time::months_of_year>(em)) + static_cast<unsigned short>(ed), static_cast<date_time::months_of_year>(em)) ) ); } //! Julian day. Feb29 is always counted, but exception thrown in non-leap years // expects range of 0-365 void julian_day(const string_type& s, const string_type& e){ int sd=0, ed=0; sd = lexical_cast<int>(s); ed = lexical_cast<int>(e); dst_calc_rules_ = shared_ptr<dst_calc_rule>( new partial_date_dst_rule( partial_date_dst_rule::start_rule(++sd),// args are 0-365 partial_date_dst_rule::end_rule(++ed) // pd expects 1-366 ) ); } //! helper function used when throwing exceptions static std::string td_as_string(const time_duration_type& td) { std::string s; #if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) s = posix_time::to_simple_string(td); #else std::stringstream ss; ss << td; s = ss.str(); #endif return s; } }; typedef posix_time_zone_base<char> posix_time_zone; diff --git a/3rdParty/Boost/src/boost/date_time/local_time/tz_database.hpp b/3rdParty/Boost/src/boost/date_time/local_time/tz_database.hpp index aceda93..0c6fbbf 100644 --- a/3rdParty/Boost/src/boost/date_time/local_time/tz_database.hpp +++ b/3rdParty/Boost/src/boost/date_time/local_time/tz_database.hpp @@ -1,32 +1,32 @@ #ifndef BOOST_DATE_TIME_TZ_DATABASE_HPP__ #define BOOST_DATE_TIME_TZ_DATABASE_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <string> #include "boost/date_time/local_time/custom_time_zone.hpp" #include "boost/date_time/local_time/dst_transition_day_rules.hpp" #include "boost/date_time/tz_db_base.hpp" namespace boost { namespace local_time { using date_time::data_not_accessible; using date_time::bad_field_count; //! Object populated with boost::shared_ptr<time_zone_base> objects /*! Object populated with boost::shared_ptr<time_zone_base> objects * Database is populated from specs stored in external csv file. See * date_time::tz_db_base for greater detail */ typedef date_time::tz_db_base<custom_time_zone, nth_kday_dst_rule> tz_database; }} // namespace #endif // BOOST_DATE_TIME_TZ_DATABASE_HPP__ diff --git a/3rdParty/Boost/src/boost/date_time/locale_config.hpp b/3rdParty/Boost/src/boost/date_time/locale_config.hpp index 194d5dd..42a2b73 100644 --- a/3rdParty/Boost/src/boost/date_time/locale_config.hpp +++ b/3rdParty/Boost/src/boost/date_time/locale_config.hpp @@ -1,31 +1,31 @@ #ifndef DATE_TIME_LOCALE_CONFIG_HPP___ #define DATE_TIME_LOCALE_CONFIG_HPP___ /* Copyright (c) 2002-2006 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ // This file configures whether the library will support locales and hence // iostream based i/o. Even if a compiler has some support for locales, // any failure to be compatible gets the compiler on the exclusion list. // // At the moment this is defined for MSVC 6 and any compiler that // defines BOOST_NO_STD_LOCALE (gcc 2.95.x) #include "boost/config.hpp" //sets BOOST_NO_STD_LOCALE #include "boost/detail/workaround.hpp" //This file basically becomes a noop if locales are not properly supported #if (defined(BOOST_NO_STD_LOCALE) \ || (BOOST_WORKAROUND( BOOST_MSVC, < 1300)) \ || (BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x581 )) ) ) #define BOOST_DATE_TIME_NO_LOCALE #endif #endif diff --git a/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp b/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp index 177811e..bffc741 100644 --- a/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp +++ b/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ #define DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2010-05-10 02:15:48 -0700 (Mon, 10 May 2010) $ + * $Date$ */ /*! @file microsec_time_clock.hpp This file contains a high resolution time clock implementation. */ #include <boost/cstdint.hpp> #include <boost/shared_ptr.hpp> #include <boost/detail/workaround.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/c_time.hpp> #include <boost/date_time/time_clock.hpp> #include <boost/date_time/filetime_functions.hpp> #ifdef BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK namespace boost { namespace date_time { //! A clock providing microsecond level resolution /*! A high precision clock that measures the local time * at a resolution up to microseconds and adjusts to the * resolution of the time system. For example, for the * a library configuration with nano second resolution, * the last 3 places of the fractional seconds will always * be 000 since there are 1000 nano-seconds in a micro second. */ template<class time_type> class microsec_clock { private: //! Type for the function used to convert time_t to tm typedef std::tm* (*time_converter)(const std::time_t*, std::tm*); diff --git a/3rdParty/Boost/src/boost/date_time/parse_format_base.hpp b/3rdParty/Boost/src/boost/date_time/parse_format_base.hpp index 087baf9..d4b2f59 100644 --- a/3rdParty/Boost/src/boost/date_time/parse_format_base.hpp +++ b/3rdParty/Boost/src/boost/date_time/parse_format_base.hpp @@ -1,29 +1,29 @@ #ifndef DATE_TIME_PARSE_FORMAT_BASE__ #define DATE_TIME_PARSE_FORMAT_BASE__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { namespace date_time { //! Enum for distinguishing parsing and formatting options enum month_format_spec {month_as_integer, month_as_short_string, month_as_long_string}; //! Enum for distinguishing the order of Month, Day, & Year. /*! Enum for distinguishing the order in which Month, Day, & Year * will appear in a date string */ enum ymd_order_spec {ymd_order_iso, //order is year-month-day ymd_order_dmy, //day-month-year ymd_order_us}; //order is month-day-year } }//namespace date_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/period.hpp b/3rdParty/Boost/src/boost/date_time/period.hpp index 3e34def..1a88209 100644 --- a/3rdParty/Boost/src/boost/date_time/period.hpp +++ b/3rdParty/Boost/src/boost/date_time/period.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_PERIOD_HPP___ #define DATE_TIME_PERIOD_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! \file period.hpp This file contain the implementation of the period abstraction. This is basically the same idea as a range. Although this class is intended for use in the time library, it is pretty close to general enough for other numeric uses. */ #include "boost/operators.hpp" namespace boost { namespace date_time { //!Provides generalized period type useful in date-time systems /*!This template uses a class to represent a time point within the period and another class to represent a duration. As a result, this class is not appropriate for use when the number and duration representation are the same (eg: in the regular number domain). A period can be specified by providing either the begining point and a duration or the begining point and the end point( end is NOT part of the period but 1 unit past it. A period will be "invalid" if either end_point <= begin_point or the given duration is <= 0. Any valid period will return false for is_null(). Zero length periods are also considered invalid. Zero length periods are periods where the begining and end points are the same, or, the given duration is zero. For a zero length period, the last point will be one unit less than the begining point. In the case that the begin and last are the same, the period has a length of one unit. diff --git a/3rdParty/Boost/src/boost/date_time/period_formatter.hpp b/3rdParty/Boost/src/boost/date_time/period_formatter.hpp index b6ddc82..0cce32a 100644 --- a/3rdParty/Boost/src/boost/date_time/period_formatter.hpp +++ b/3rdParty/Boost/src/boost/date_time/period_formatter.hpp @@ -1,45 +1,45 @@ #ifndef DATETIME_PERIOD_FORMATTER_HPP___ #define DATETIME_PERIOD_FORMATTER_HPP___ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ namespace boost { namespace date_time { //! Not a facet, but a class used to specify and control period formats /*! Provides settings for the following: * - period_separator -- default '/' * - period_open_start_delimeter -- default '[' * - period_open_range_end_delimeter -- default ')' * - period_closed_range_end_delimeter -- default ']' * - display_as_open_range, display_as_closed_range -- default closed_range * * Thus the default formatting for a period is as follows: *@code * [period.start()/period.last()] *@endcode * So for a typical date_period this would be *@code * [2004-Jan-04/2004-Feb-01] *@endcode * where the date formatting is controlled by the date facet */ template <class CharT, class OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > class period_formatter { public: typedef std::basic_string<CharT> string_type; typedef CharT char_type; typedef typename std::basic_string<char_type>::const_iterator const_itr_type; typedef std::vector<std::basic_string<CharT> > collection_type; static const char_type default_period_separator[2]; static const char_type default_period_start_delimeter[2]; diff --git a/3rdParty/Boost/src/boost/date_time/period_parser.hpp b/3rdParty/Boost/src/boost/date_time/period_parser.hpp index 84b9d13..8374234 100644 --- a/3rdParty/Boost/src/boost/date_time/period_parser.hpp +++ b/3rdParty/Boost/src/boost/date_time/period_parser.hpp @@ -1,45 +1,45 @@ #ifndef DATETIME_PERIOD_PARSER_HPP___ #define DATETIME_PERIOD_PARSER_HPP___ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <boost/throw_exception.hpp> #include <boost/date_time/string_parse_tree.hpp> #include <boost/date_time/string_convert.hpp> namespace boost { namespace date_time { //! Not a facet, but a class used to specify and control period parsing /*! Provides settings for the following: * - period_separator -- default '/' * - period_open_start_delimeter -- default '[' * - period_open_range_end_delimeter -- default ')' * - period_closed_range_end_delimeter -- default ']' * - display_as_open_range, display_as_closed_range -- default closed_range * * For a typical date_period, the contents of the input stream would be *@code * [2004-Jan-04/2004-Feb-01] *@endcode * where the date format is controlled by the date facet */ template<class date_type, typename CharT> class period_parser { public: typedef std::basic_string<CharT> string_type; typedef CharT char_type; //typedef typename std::basic_string<char_type>::const_iterator const_itr_type; typedef std::istreambuf_iterator<CharT> stream_itr_type; typedef string_parse_tree<CharT> parse_tree_type; typedef typename parse_tree_type::parse_match_result_type match_results; typedef std::vector<std::basic_string<CharT> > collection_type; diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp index 83ccf60..59e5cb7 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_TIME_CONVERSION_HPP___ #define POSIX_TIME_CONVERSION_HPP___ /* Copyright (c) 2002-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $ + * $Date$ */ #include <cstring> #include <boost/date_time/posix_time/ptime.hpp> #include <boost/date_time/posix_time/posix_time_duration.hpp> #include <boost/date_time/filetime_functions.hpp> #include <boost/date_time/c_time.hpp> #include <boost/date_time/time_resolution_traits.hpp> // absolute_value #include <boost/date_time/gregorian/conversion.hpp> namespace boost { namespace posix_time { //! Function that converts a time_t into a ptime. inline ptime from_time_t(std::time_t t) { ptime start(gregorian::date(1970,1,1)); return start + seconds(static_cast<long>(t)); } //! Convert a time to a tm structure truncating any fractional seconds inline std::tm to_tm(const boost::posix_time::ptime& t) { std::tm timetm = boost::gregorian::to_tm(t.date()); boost::posix_time::time_duration td = t.time_of_day(); timetm.tm_hour = td.hours(); timetm.tm_min = td.minutes(); timetm.tm_sec = td.seconds(); timetm.tm_isdst = -1; // -1 used when dst info is unknown return timetm; } //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp index 6846a77..60821f0 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/date_duration_operators.hpp @@ -1,44 +1,44 @@ #ifndef DATE_DURATION_OPERATORS_HPP___ #define DATE_DURATION_OPERATORS_HPP___ /* Copyright (c) 2004 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/greg_duration_types.hpp" #include "boost/date_time/posix_time/ptime.hpp" namespace boost { namespace posix_time { /*!@file date_duration_operators.hpp Operators for ptime and * optional gregorian types. Operators use snap-to-end-of-month behavior. * Further details on this behavior can be found in reference for * date_time/date_duration_types.hpp and documentation for * month and year iterators. */ /*! 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 ptime operator+(const ptime& t, const boost::gregorian::months& m) { return t + m.get_offset(t.date()); } /*! 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 ptime operator+=(ptime& t, const boost::gregorian::months& m) { // get_neg_offset returns a negative duration, so we add return t += m.get_offset(t.date()); diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp index 3b85ff4..aecf8a8 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time.hpp @@ -1,39 +1,39 @@ #ifndef POSIX_TIME_HPP___ #define POSIX_TIME_HPP___ /* Copyright (c) 2002-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*!@file posix_time.hpp Global header file to get all of posix time types */ #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/posix_time/ptime.hpp" #if defined(BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES) #include "boost/date_time/posix_time/date_duration_operators.hpp" #endif // output functions #if defined(BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) #include "boost/date_time/posix_time/time_formatters_limited.hpp" #else #include "boost/date_time/posix_time/time_formatters.hpp" #endif // BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS // streaming operators #if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) #include "boost/date_time/posix_time/posix_time_legacy_io.hpp" #else #include "boost/date_time/posix_time/posix_time_io.hpp" #endif // USE_DATE_TIME_PRE_1_33_FACET_IO #include "boost/date_time/posix_time/time_parsers.hpp" #include "boost/date_time/posix_time/conversion.hpp" #endif diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp index d0b7653..60b3468 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_TIME_CONFIG_HPP___ #define POSIX_TIME_CONFIG_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-10-10 12:05:03 -0700 (Wed, 10 Oct 2012) $ + * $Date$ */ #include <cstdlib> //for MCW 7.2 std::abs(long long) #include <boost/limits.hpp> #include <boost/cstdint.hpp> #include <boost/config/no_tr1/cmath.hpp> #include <boost/date_time/time_duration.hpp> #include <boost/date_time/time_resolution_traits.hpp> #include <boost/date_time/gregorian/gregorian_types.hpp> #include <boost/date_time/wrapping_int.hpp> #include <boost/date_time/compiler_config.hpp> 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; diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp index 9778fd7..7e15df2 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_duration.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_TIME_DURATION_HPP___ #define POSIX_TIME_DURATION_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time_config.hpp" namespace boost { namespace posix_time { //! Allows expression of durations as an hour count /*! \ingroup time_basics */ class hours : public time_duration { public: explicit hours(long h) : time_duration(h,0,0) {} }; //! Allows expression of durations as a minute count /*! \ingroup time_basics */ class minutes : public time_duration { public: explicit minutes(long m) : time_duration(0,m,0) {} }; //! Allows expression of durations as a seconds count /*! \ingroup time_basics */ class seconds : public time_duration { public: diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp index fb63a91..45c338b 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_io.hpp @@ -1,218 +1,215 @@ #ifndef DATE_TIME_POSIX_TIME_IO_HPP__ #define DATE_TIME_POSIX_TIME_IO_HPP__ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <locale> #include <iostream> #include <iterator> // i/ostreambuf_iterator #include <boost/io/ios_state.hpp> #include <boost/date_time/time_facet.hpp> #include <boost/date_time/period_formatter.hpp> #include <boost/date_time/posix_time/ptime.hpp> #include <boost/date_time/posix_time/time_period.hpp> #include <boost/date_time/posix_time/posix_time_duration.hpp> #include <boost/date_time/posix_time/conversion.hpp> // to_tm will be needed in the facets namespace boost { namespace posix_time { //! wptime_facet is depricated and will be phased out. use wtime_facet instead //typedef boost::date_time::time_facet<ptime, wchar_t> wptime_facet; //! ptime_facet is depricated and will be phased out. use time_facet instead //typedef boost::date_time::time_facet<ptime, char> ptime_facet; //! wptime_input_facet is depricated and will be phased out. use wtime_input_facet instead //typedef boost::date_time::time_input_facet<ptime,wchar_t> wptime_input_facet; //! ptime_input_facet is depricated and will be phased out. use time_input_facet instead //typedef boost::date_time::time_input_facet<ptime,char> ptime_input_facet; typedef boost::date_time::time_facet<ptime, wchar_t> wtime_facet; typedef boost::date_time::time_facet<ptime, char> time_facet; typedef boost::date_time::time_input_facet<ptime, wchar_t> wtime_input_facet; typedef boost::date_time::time_input_facet<ptime, char> time_input_facet; template <class CharT, class TraitsT> inline std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& os, const ptime& p) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet; - typedef std::time_put<CharT> std_ptime_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_ptime_facet>(os.getloc())) std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), p); else { //instantiate a custom facet for dealing with times since the user //has not put one in the stream so far. This is for efficiency //since we would always need to reconstruct for every time period //if the locale did not already exist. Of course this will be overridden //if the user imbues as some later point. custom_ptime_facet* f = new custom_ptime_facet(); std::locale l = std::locale(os.getloc(), f); os.imbue(l); f->put(oitr, os, os.fill(), p); } return os; } //! input operator for ptime template <class CharT, class Traits> inline std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, ptime& pt) { boost::io::ios_flags_saver iflags(is); typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false); if (strm_sentry) { try { typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet; std::istreambuf_iterator<CharT,Traits> sit(is), str_end; if(std::has_facet<time_input_facet>(is.getloc())) { std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, pt); } else { time_input_facet* f = new time_input_facet(); std::locale l = std::locale(is.getloc(), f); is.imbue(l); f->get(sit, str_end, is, pt); } } catch(...) { // mask tells us what exceptions are turned on std::ios_base::iostate exception_mask = is.exceptions(); // if the user wants exceptions on failbit, we'll rethrow our // date_time exception & set the failbit if(std::ios_base::failbit & exception_mask) { try { is.setstate(std::ios_base::failbit); } catch(std::ios_base::failure&) {} // ignore this one throw; // rethrow original exception } else { // if the user want's to fail quietly, we simply set the failbit is.setstate(std::ios_base::failbit); } } } return is; } template <class CharT, class TraitsT> inline std::basic_ostream<CharT, TraitsT>& operator<<(std::basic_ostream<CharT, TraitsT>& os, const boost::posix_time::time_period& p) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet; - typedef std::time_put<CharT> std_time_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_ptime_facet>(os.getloc())) { std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), p); } else { //instantiate a custom facet for dealing with periods since the user //has not put one in the stream so far. This is for efficiency //since we would always need to reconstruct for every time period //if the local did not already exist. Of course this will be overridden //if the user imbues as some later point. custom_ptime_facet* f = new custom_ptime_facet(); std::locale l = std::locale(os.getloc(), f); os.imbue(l); f->put(oitr, os, os.fill(), p); } return os; } //! input operator for time_period template <class CharT, class Traits> inline std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, time_period& tp) { boost::io::ios_flags_saver iflags(is); typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false); if (strm_sentry) { try { typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet; std::istreambuf_iterator<CharT,Traits> sit(is), str_end; if(std::has_facet<time_input_facet>(is.getloc())) { std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, tp); } else { time_input_facet* f = new time_input_facet(); std::locale l = std::locale(is.getloc(), f); is.imbue(l); f->get(sit, str_end, is, tp); } } catch(...) { std::ios_base::iostate exception_mask = is.exceptions(); if(std::ios_base::failbit & exception_mask) { try { is.setstate(std::ios_base::failbit); } catch(std::ios_base::failure&) {} throw; // rethrow original exception } else { is.setstate(std::ios_base::failbit); } } } return is; } //! ostream operator for posix_time::time_duration // todo fix to use facet -- place holder for now... template <class CharT, class Traits> inline std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const time_duration& td) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet; - typedef std::time_put<CharT> std_ptime_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_ptime_facet>(os.getloc())) std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), td); else { //instantiate a custom facet for dealing with times since the user //has not put one in the stream so far. This is for efficiency //since we would always need to reconstruct for every time period //if the locale did not already exist. Of course this will be overridden //if the user imbues as some later point. custom_ptime_facet* f = new custom_ptime_facet(); std::locale l = std::locale(os.getloc(), f); os.imbue(l); f->put(oitr, os, os.fill(), td); } return os; } //! input operator for time_duration template <class CharT, class Traits> inline std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, time_duration& td) { boost::io::ios_flags_saver iflags(is); typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false); if (strm_sentry) { try { typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet; std::istreambuf_iterator<CharT,Traits> sit(is), str_end; if(std::has_facet<time_input_facet>(is.getloc())) { std::use_facet<time_input_facet>(is.getloc()).get(sit, str_end, is, td); } else { time_input_facet* f = new time_input_facet(); std::locale l = std::locale(is.getloc(), f); diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp index fcc3fac..b31fb98 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_legacy_io.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_TIME_PRE133_OPERATORS_HPP___ #define POSIX_TIME_PRE133_OPERATORS_HPP___ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file posix_time_pre133_operators.hpp * These input and output operators are for use with the * pre 1.33 version of the date_time libraries io facet code. * The operators used in version 1.33 and later can be found * in posix_time_io.hpp */ #include <iostream> #include <string> #include <sstream> #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/gregorian/gregorian.hpp" #include "boost/date_time/posix_time/posix_time_duration.hpp" #include "boost/date_time/posix_time/ptime.hpp" #include "boost/date_time/posix_time/time_period.hpp" #include "boost/date_time/time_parsing.hpp" namespace boost { namespace posix_time { //The following code is removed for configurations with poor std::locale support (eg: MSVC6, gcc 2.9x) #ifndef BOOST_DATE_TIME_NO_LOCALE #if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) //! ostream operator for posix_time::time_duration template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const time_duration& td) { typedef boost::date_time::ostream_time_duration_formatter<time_duration, charT> duration_formatter; duration_formatter::duration_put(td, os); return os; } @@ -48,71 +48,71 @@ namespace posix_time { inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const ptime& t) { typedef boost::date_time::ostream_time_formatter<ptime, charT> time_formatter; time_formatter::time_put(t, os); return os; } //! ostream operator for posix_time::time_period template <class charT, class traits> inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const time_period& tp) { typedef boost::date_time::ostream_time_period_formatter<time_period, charT> period_formatter; period_formatter::period_put(tp, os); return os; } #endif // USE_DATE_TIME_PRE_1_33_FACET_IO /******** input streaming ********/ template<class charT> inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, time_duration& td) { // need to create a std::string and parse it std::basic_string<charT> inp_s; std::stringstream out_ss; is >> inp_s; typename std::basic_string<charT>::iterator b = inp_s.begin(); // need to use both iterators because there is no requirement // for the data held by a std::basic_string<> be terminated with // any marker (such as '\0'). typename std::basic_string<charT>::iterator e = inp_s.end(); while(b != e){ - out_ss << out_ss.narrow(*b, 0); + out_ss << is.narrow(*b, 0); ++b; } td = date_time::parse_delimited_time_duration<time_duration>(out_ss.str()); return is; } template<class charT> inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, ptime& pt) { gregorian::date d(not_a_date_time); time_duration td(0,0,0); is >> d >> td; pt = ptime(d, td); return is; } /** operator>> for time_period. time_period must be in * "[date time_duration/date time_duration]" format. */ template<class charT> inline std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, time_period& tp) { gregorian::date d(not_a_date_time); time_duration td(0,0,0); ptime beg(d, td); ptime end(beg); std::basic_string<charT> s; // get first date string and remove leading '[' is >> s; { std::basic_stringstream<charT> ss; ss << s.substr(s.find('[')+1); diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp index 13626e9..84c21ca 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_system.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_TIME_SYSTEM_HPP___ #define POSIX_TIME_SYSTEM_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time_config.hpp" #include "boost/date_time/time_system_split.hpp" #include "boost/date_time/time_system_counted.hpp" #include "boost/date_time/compiler_config.hpp" namespace boost { namespace posix_time { #ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG #if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers typedef date_time::split_timedate_system<posix_time_system_config, 1000000000> posix_time_system; #else typedef date_time::split_timedate_system<posix_time_system_config> posix_time_system; #endif #else typedef date_time::counted_time_rep<millisec_posix_time_system_config> int64_time_rep; typedef date_time::counted_time_system<int64_time_rep> posix_time_system; #endif } }//namespace posix_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp index 3f1cb04..e4f9d02 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/ptime.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_PTIME_HPP___ #define POSIX_PTIME_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time_system.hpp" #include "boost/date_time/time.hpp" namespace boost { namespace posix_time { //bring special enum values into the namespace using date_time::special_values; using date_time::not_special; using date_time::neg_infin; using date_time::pos_infin; using date_time::not_a_date_time; using date_time::max_date_time; using date_time::min_date_time; //! Time type with no timezone or other adjustments /*! \ingroup time_basics */ class ptime : public date_time::base_time<ptime, posix_time_system> { public: typedef posix_time_system time_system_type; typedef time_system_type::time_rep_type time_rep_type; 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) {} //! 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)) {} //! Copy from time_rep diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp index 534b952..ce19568 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp @@ -1,44 +1,44 @@ #ifndef POSIXTIME_FORMATTERS_HPP___ #define POSIXTIME_FORMATTERS_HPP___ /* Copyright (c) 2002-2004 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) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/iso_format.hpp> #include <boost/date_time/date_format_simple.hpp> #include <boost/date_time/posix_time/posix_time_types.hpp> #include <boost/date_time/time_formatting_streams.hpp> #include <boost/date_time/time_resolution_traits.hpp> // absolute_value #include <boost/date_time/time_parsing.hpp> /* NOTE: The "to_*_string" code for older compilers, ones that define * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * formatters_limited.hpp */ namespace boost { namespace posix_time { // template function called by wrapper functions: // to_*_string(time_duration) & to_*_wstring(time_duration) template<class charT> inline std::basic_string<charT> to_simple_string_type(time_duration td) { std::basic_ostringstream<charT> ss; if(td.is_special()) { /* simply using 'ss << td.get_rep()' won't work on compilers * that don't support locales. This way does. */ // switch copied from date_names_put.hpp switch(td.get_rep().as_special()) { case not_a_date_time: //ss << "not-a-number"; ss << "not-a-date-time"; break; diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp index 8d2ebdc..c74fcfa 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp @@ -1,44 +1,44 @@ #ifndef POSIXTIME_FORMATTERS_LIMITED_HPP___ #define POSIXTIME_FORMATTERS_LIMITED_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/iso_format.hpp> #include <boost/date_time/date_format_simple.hpp> #include <boost/date_time/posix_time/posix_time_types.hpp> #include <boost/date_time/time_formatting_streams.hpp> #include <boost/date_time/time_resolution_traits.hpp> // absolute_value namespace boost { namespace posix_time { //! Time duration to string -hh::mm::ss.fffffff. Example: 10:09:03.0123456 /*!\ingroup time_format */ inline std::string to_simple_string(time_duration td) { std::ostringstream ss; if(td.is_special()) { /* simply using 'ss << td.get_rep()' won't work on compilers * that don't support locales. This way does. */ // switch copied from date_names_put.hpp switch(td.get_rep().as_special()) { case not_a_date_time: //ss << "not-a-number"; ss << "not-a-date-time"; break; case pos_infin: ss << "+infinity"; break; case neg_infin: ss << "-infinity"; break; diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp index 3dc02b1..55b6ccf 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_parsers.hpp @@ -1,44 +1,44 @@ #ifndef POSIXTIME_PARSERS_HPP___ #define POSIXTIME_PARSERS_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian.hpp" #include "boost/date_time/time_parsing.hpp" #include "boost/date_time/posix_time/posix_time_types.hpp" namespace boost { namespace posix_time { //! Creates a time_duration object from a delimited string /*! Expected format for string is "[-]h[h][:mm][:ss][.fff]". * A negative duration will be created if the first character in * string is a '-', all other '-' will be treated as delimiters. * Accepted delimiters are "-:,.". */ inline time_duration duration_from_string(const std::string& s) { return date_time::parse_delimited_time_duration<time_duration>(s); } inline ptime time_from_string(const std::string& s) { return date_time::parse_delimited_time<ptime>(s, ' '); } inline ptime from_iso_string(const std::string& s) { return date_time::parse_iso_time<ptime>(s, 'T'); } } } //namespace posix_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp index 11f8120..7c6095b 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_period.hpp @@ -1,29 +1,29 @@ #ifndef POSIX_TIME_PERIOD_HPP___ #define POSIX_TIME_PERIOD_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/period.hpp" #include "boost/date_time/posix_time/posix_time_duration.hpp" #include "boost/date_time/posix_time/ptime.hpp" namespace boost { namespace posix_time { //! Time period type /*! \ingroup time_basics */ typedef date_time::period<ptime, time_duration> time_period; } }//namespace posix_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp index c9038f1..8650ae1 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_serialize.hpp @@ -1,44 +1,44 @@ #ifndef POSIX_TIME_SERIALIZE_HPP___ #define POSIX_TIME_SERIALIZE_HPP___ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-30 16:25:22 -0700 (Sun, 30 Sep 2012) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time.hpp" #include "boost/date_time/gregorian/greg_serialize.hpp" #include "boost/serialization/split_free.hpp" #include "boost/serialization/nvp.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) namespace boost { namespace serialization { /*** time_duration ***/ //! Function to save posix_time::time_duration objects using serialization lib /*! time_duration objects are broken down into 4 parts for serialization: * types are hour_type, min_type, sec_type, and fractional_seconds_type * as defined in the time_duration class */ template<class Archive> void save(Archive & ar, const posix_time::time_duration& td, unsigned int /*version*/) { // serialize a bool so we know how to read this back in later bool is_special = td.is_special(); ar & make_nvp("is_special", is_special); if(is_special) { diff --git a/3rdParty/Boost/src/boost/date_time/special_defs.hpp b/3rdParty/Boost/src/boost/date_time/special_defs.hpp index 661814e..5a757be 100644 --- a/3rdParty/Boost/src/boost/date_time/special_defs.hpp +++ b/3rdParty/Boost/src/boost/date_time/special_defs.hpp @@ -1,25 +1,25 @@ #ifndef DATE_TIME_SPECIAL_DEFS_HPP__ #define DATE_TIME_SPECIAL_DEFS_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { namespace date_time { enum special_values {not_a_date_time, neg_infin, pos_infin, min_date_time, max_date_time, not_special, NumSpecialValues}; } } //namespace date_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/special_values_formatter.hpp b/3rdParty/Boost/src/boost/date_time/special_values_formatter.hpp index 53fe984..c8653c1 100644 --- a/3rdParty/Boost/src/boost/date_time/special_values_formatter.hpp +++ b/3rdParty/Boost/src/boost/date_time/special_values_formatter.hpp @@ -1,45 +1,45 @@ #ifndef DATETIME_SPECIAL_VALUE_FORMATTER_HPP___ #define DATETIME_SPECIAL_VALUE_FORMATTER_HPP___ /* Copyright (c) 2004 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <vector> #include <string> #include "boost/date_time/special_defs.hpp" namespace boost { namespace date_time { //! Class that provides generic formmatting ostream formatting for special values /*! This class provides for the formmating of special values to an output stream. * In particular, it produces strings for the values of negative and positive * infinity as well as not_a_date_time. * * While not a facet, this class is used by the date and time facets for formatting * special value types. * */ template <class CharT, class OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > class special_values_formatter { public: typedef std::basic_string<CharT> string_type; typedef CharT char_type; typedef std::vector<string_type> collection_type; static const char_type default_special_value_names[3][17]; //! Construct special values formatter using default strings. /*! Default strings are not-a-date-time -infinity +infinity */ special_values_formatter() { std::copy(&default_special_value_names[0], &default_special_value_names[3], std::back_inserter(m_special_value_names)); diff --git a/3rdParty/Boost/src/boost/date_time/string_convert.hpp b/3rdParty/Boost/src/boost/date_time/string_convert.hpp index a3cc86c..30be356 100644 --- a/3rdParty/Boost/src/boost/date_time/string_convert.hpp +++ b/3rdParty/Boost/src/boost/date_time/string_convert.hpp @@ -1,33 +1,32 @@ #ifndef _STRING_CONVERT_HPP___ #define _STRING_CONVERT_HPP___ /* Copyright (c) 2005 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/compiler_config.hpp" #include <string> namespace boost { namespace date_time { //! Converts a string from one value_type to another /*! Converts a wstring to a string (or a string to wstring). If both template parameters * are of same type, a copy of the input string is returned. */ template<class InputT, class OutputT> inline std::basic_string<OutputT> convert_string_type(const std::basic_string<InputT>& inp_str) { - typedef std::basic_string<InputT> input_type; typedef std::basic_string<OutputT> output_type; output_type result; result.insert(result.begin(), inp_str.begin(), inp_str.end()); return result; } }} // namespace boost::date_time #endif // _STRING_CONVERT_HPP___ diff --git a/3rdParty/Boost/src/boost/date_time/string_parse_tree.hpp b/3rdParty/Boost/src/boost/date_time/string_parse_tree.hpp index d67bf6b..9e97766 100644 --- a/3rdParty/Boost/src/boost/date_time/string_parse_tree.hpp +++ b/3rdParty/Boost/src/boost/date_time/string_parse_tree.hpp @@ -1,44 +1,44 @@ #ifndef BOOST_DATE_TIME_STRING_PARSE_TREE___HPP__ #define BOOST_DATE_TIME_STRING_PARSE_TREE___HPP__ /* Copyright (c) 2004-2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include "boost/lexical_cast.hpp" //error without? #include "boost/algorithm/string/case_conv.hpp" #include <map> #include <string> #include <vector> #include <algorithm> namespace boost { namespace date_time { template<typename charT> struct parse_match_result { parse_match_result() : match_depth(0), current_match(-1)// -1 is match_not-found value {} typedef std::basic_string<charT> string_type; string_type remaining() const { if (match_depth == cache.size()) { return string_type(); } if (current_match == -1) { return cache; } //some of the cache was used return the rest return string_type(cache, match_depth); } charT last_char() const { return cache[cache.size()-1]; diff --git a/3rdParty/Boost/src/boost/date_time/strings_from_facet.hpp b/3rdParty/Boost/src/boost/date_time/strings_from_facet.hpp index 7c0765b..800919a 100644 --- a/3rdParty/Boost/src/boost/date_time/strings_from_facet.hpp +++ b/3rdParty/Boost/src/boost/date_time/strings_from_facet.hpp @@ -1,125 +1,125 @@ #ifndef DATE_TIME_STRINGS_FROM_FACET__HPP___ #define DATE_TIME_STRINGS_FROM_FACET__HPP___ /* Copyright (c) 2004 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) * Author: Jeff Garland - * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <sstream> #include <string> #include <vector> #include <locale> namespace boost { namespace date_time { //! This function gathers up all the month strings from a std::locale /*! Using the time_put facet, this function creates a collection of * all the month strings from a locale. This is handy when building * custom date parsers or formatters that need to be localized. * *@param charT The type of char to use when gathering typically char * or wchar_t. *@param locale The locale to use when gathering the strings *@param short_strings True(default) to gather short strings, * false for long strings. *@return A vector of strings containing the strings in order. eg: * Jan, Feb, Mar, etc. */ template<typename charT> std::vector<std::basic_string<charT> > gather_month_strings(const std::locale& locale, bool short_strings=true) { typedef std::basic_string<charT> string_type; typedef std::vector<string_type> collection_type; - typedef std::basic_ostringstream<charT> ostream_type; typedef std::ostreambuf_iterator<charT> ostream_iter_type; typedef std::basic_ostringstream<charT> stringstream_type; typedef std::time_put<charT> time_put_facet_type; charT short_fmt[3] = { '%', 'b' }; charT long_fmt[3] = { '%', 'B' }; collection_type months; string_type outfmt(short_fmt); if (!short_strings) { outfmt = long_fmt; } { //grab the needed strings by using the locale to //output each month const charT* p_outfmt = outfmt.c_str(), *p_outfmt_end = p_outfmt + outfmt.size(); - tm tm_value = {}; + tm tm_value; + memset(&tm_value, 0, sizeof(tm_value)); for (int m=0; m < 12; m++) { tm_value.tm_mon = m; stringstream_type ss; ostream_iter_type oitr(ss); std::use_facet<time_put_facet_type>(locale).put(oitr, ss, ss.fill(), &tm_value, p_outfmt, p_outfmt_end); months.push_back(ss.str()); } } return months; } //! This function gathers up all the weekday strings from a std::locale /*! Using the time_put facet, this function creates a collection of * all the weekday strings from a locale starting with the string for * 'Sunday'. This is handy when building custom date parsers or * formatters that need to be localized. * *@param charT The type of char to use when gathering typically char * or wchar_t. *@param locale The locale to use when gathering the strings *@param short_strings True(default) to gather short strings, * false for long strings. *@return A vector of strings containing the weekdays in order. eg: * Sun, Mon, Tue, Wed, Thu, Fri, Sat */ template<typename charT> std::vector<std::basic_string<charT> > gather_weekday_strings(const std::locale& locale, bool short_strings=true) { typedef std::basic_string<charT> string_type; typedef std::vector<string_type> collection_type; - typedef std::basic_ostringstream<charT> ostream_type; typedef std::ostreambuf_iterator<charT> ostream_iter_type; typedef std::basic_ostringstream<charT> stringstream_type; typedef std::time_put<charT> time_put_facet_type; charT short_fmt[3] = { '%', 'a' }; charT long_fmt[3] = { '%', 'A' }; collection_type weekdays; string_type outfmt(short_fmt); if (!short_strings) { outfmt = long_fmt; } { //grab the needed strings by using the locale to //output each month / weekday const charT* p_outfmt = outfmt.c_str(), *p_outfmt_end = p_outfmt + outfmt.size(); - tm tm_value = {}; + tm tm_value; + memset(&tm_value, 0, sizeof(tm_value)); for (int i=0; i < 7; i++) { tm_value.tm_wday = i; stringstream_type ss; ostream_iter_type oitr(ss); std::use_facet<time_put_facet_type>(locale).put(oitr, ss, ss.fill(), &tm_value, p_outfmt, p_outfmt_end); weekdays.push_back(ss.str()); } } return weekdays; } } } //namespace #endif diff --git a/3rdParty/Boost/src/boost/date_time/time.hpp b/3rdParty/Boost/src/boost/date_time/time.hpp index 8b21144..0a7810a 100644 --- a/3rdParty/Boost/src/boost/date_time/time.hpp +++ b/3rdParty/Boost/src/boost/date_time/time.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_HPP___ #define DATE_TIME_TIME_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ /*! @file time.hpp This file contains the interface for the time associated classes. */ #include <string> #include <boost/operators.hpp> #include <boost/date_time/time_defs.hpp> #include <boost/date_time/special_defs.hpp> namespace boost { namespace date_time { //! Representation of a precise moment in time, including the date. /*! This class is a skeleton for the interface of a temporal type with a resolution that is higher than a day. It is intended that this class be the base class and that the actual time class be derived using the BN pattern. In this way, the derived class can make decisions such as 'should there be a default constructor' and what should it set its value to, should there be optional constructors say allowing only an time_durations that generate a time from a clock,etc. So, in fact multiple time types can be created for a time_system with different construction policies, and all of them can perform basic operations by only writing a copy constructor. Finally, compiler errors are also shorter. The real behavior of the time class is provided by the time_system template parameter. This class must provide all the logic for addition, subtraction, as well as define all the interface types. */ diff --git a/3rdParty/Boost/src/boost/date_time/time_clock.hpp b/3rdParty/Boost/src/boost/date_time/time_clock.hpp index 9aa2ff0..a64a5b8 100644 --- a/3rdParty/Boost/src/boost/date_time/time_clock.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_clock.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_CLOCK_HPP___ #define DATE_TIME_TIME_CLOCK_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file time_clock.hpp This file contains the interface for clock devices. */ #include "boost/date_time/c_time.hpp" #include "boost/shared_ptr.hpp" namespace boost { namespace date_time { //! A clock providing time level services based on C time_t capabilities /*! This clock provides resolution to the 1 second level */ template<class time_type> class second_clock { public: typedef typename time_type::date_type date_type; typedef typename time_type::time_duration_type time_duration_type; static time_type local_time() { ::std::time_t t; ::std::time(&t); ::std::tm curr, *curr_ptr; //curr_ptr = ::std::localtime(&t); curr_ptr = c_time::localtime(&t, &curr); return create_time(curr_ptr); } //! Get the current day in universal date as a ymd_type diff --git a/3rdParty/Boost/src/boost/date_time/time_defs.hpp b/3rdParty/Boost/src/boost/date_time/time_defs.hpp index d74631d..852207e 100644 --- a/3rdParty/Boost/src/boost/date_time/time_defs.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_defs.hpp @@ -1,43 +1,43 @@ #ifndef DATE_TIME_TIME_PRECISION_LIMITS_HPP #define DATE_TIME_TIME_PRECISION_LIMITS_HPP /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ /*! \file time_defs.hpp This file contains nice definitions for handling the resoluion of various time reprsentations. */ namespace boost { namespace date_time { //!Defines some nice types for handling time level resolutions enum time_resolutions { sec, tenth, hundreth, // deprecated misspelled version of hundredth hundredth = hundreth, milli, ten_thousandth, micro, nano, NumResolutions }; //! Flags for daylight savings or summer time enum dst_flags {not_dst, is_dst, calculate}; } } //namespace date_time #endif diff --git a/3rdParty/Boost/src/boost/date_time/time_duration.hpp b/3rdParty/Boost/src/boost/date_time/time_duration.hpp index fc3660b..92a0e2d 100644 --- a/3rdParty/Boost/src/boost/date_time/time_duration.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_duration.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_DURATION_HPP___ #define DATE_TIME_TIME_DURATION_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-10-10 12:05:03 -0700 (Wed, 10 Oct 2012) $ + * $Date$ */ #include <boost/cstdint.hpp> #include <boost/operators.hpp> #include <boost/static_assert.hpp> #include <boost/date_time/time_defs.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/compiler_config.hpp> namespace boost { namespace date_time { //! Represents some amount of elapsed time measure to a given resolution /*! This class represents a standard set of capabilities for all counted time durations. Time duration implementations should derive from this class passing their type as the first template parameter. This design allows the subclass duration types to provide custom construction policies or other custom features not provided here. @param T The subclass type @param rep_type The time resolution traits for this duration type. */ template<class T, typename rep_type> class time_duration : private boost::less_than_comparable<T , boost::equality_comparable<T > > /* dividable, addable, and subtractable operator templates * won't work with this class (MSVC++ 6.0). return type * from '+=' is different than expected return type * from '+'. multipliable probably wont work * either (haven't tried) */ { public: diff --git a/3rdParty/Boost/src/boost/date_time/time_facet.hpp b/3rdParty/Boost/src/boost/date_time/time_facet.hpp index 8346ca3..b9abedf 100644 --- a/3rdParty/Boost/src/boost/date_time/time_facet.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_facet.hpp @@ -1,45 +1,45 @@ #ifndef _DATE_TIME_FACET__HPP__ #define _DATE_TIME_FACET__HPP__ /* Copyright (c) 2004-2005 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) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <cctype> #include <locale> #include <limits> #include <string> #include <sstream> #include <iomanip> #include <iterator> // i/ostreambuf_iterator #include <exception> #include <boost/assert.hpp> #include <boost/lexical_cast.hpp> #include <boost/throw_exception.hpp> #include <boost/range/as_literal.hpp> #include <boost/algorithm/string/erase.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/date_facet.hpp> #include <boost/date_time/string_convert.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/time_resolution_traits.hpp> // absolute_value namespace boost { namespace date_time { template <class CharT> struct time_formats { public: typedef CharT char_type; static const char_type fractional_seconds_format[3]; // f static const char_type fractional_seconds_or_none_format[3]; // F static const char_type seconds_with_fractional_seconds_format[3]; // s static const char_type seconds_format[3]; // S static const char_type hours_format[3]; // H static const char_type unrestricted_hours_format[3]; // O @@ -790,71 +790,71 @@ namespace date_time { InItrT get(InItrT& sitr, InItrT& stream_end, std::ios_base& ios_arg, time_duration_type& td) const { // skip leading whitespace while((sitr != stream_end) && std::isspace(*sitr)) { ++sitr; } bool use_current_char = false; // num_get will consume the +/-, we may need a copy if special_value char_type c = '\0'; if((sitr != stream_end) && (*sitr == '-' || *sitr == '+')) { c = *sitr; } typedef typename time_duration_type::hour_type hour_type; typedef typename time_duration_type::min_type min_type; typedef typename time_duration_type::sec_type sec_type; hour_type hour = 0; min_type min = 0; sec_type sec = 0; typename time_duration_type::fractional_seconds_type frac(0); typedef std::num_get<CharT, InItrT> num_get; if(!std::has_facet<num_get>(ios_arg.getloc())) { num_get* ng = new num_get(); std::locale loc = std::locale(ios_arg.getloc(), ng); ios_arg.imbue(loc); } const_itr itr(m_time_duration_format.begin()); while (itr != m_time_duration_format.end() && (sitr != stream_end)) { if (*itr == '%') { - ++itr; + if (++itr == m_time_duration_format.end()) break; if (*itr != '%') { switch(*itr) { case 'O': { // A period may span more than 24 hours. In that case the format // string should be composed with the unrestricted hours specifier. hour = var_string_to_int<hour_type, CharT>(sitr, stream_end, std::numeric_limits<hour_type>::digits10 + 1); if(hour == -1){ return check_special_value(sitr, stream_end, td, c); } break; } case 'H': { match_results mr; hour = fixed_string_to_int<hour_type, CharT>(sitr, stream_end, mr, 2); if(hour == -1){ return check_special_value(sitr, stream_end, td, c); } break; } case 'M': { match_results mr; min = fixed_string_to_int<min_type, CharT>(sitr, stream_end, mr, 2); if(min == -1){ return check_special_value(sitr, stream_end, td, c); } break; } case 's': case 'S': { match_results mr; @@ -962,71 +962,71 @@ namespace date_time { // num_get will consume the +/-, we may need a copy if special_value char_type c = '\0'; if((sitr != stream_end) && (*sitr == '-' || *sitr == '+')) { c = *sitr; } typedef typename time_duration_type::hour_type hour_type; typedef typename time_duration_type::min_type min_type; typedef typename time_duration_type::sec_type sec_type; // time elements hour_type hour = 0; min_type min = 0; sec_type sec = 0; typename time_duration_type::fractional_seconds_type frac(0); // date elements short day_of_year(0); /* Initialized the following to their minimum values. These intermediate * objects are used so we get specific exceptions when part of the input * is unparsable. * Ex: "205-Jan-15" will throw a bad_year, "2005-Jsn-15"- bad_month, etc.*/ year_type t_year(1400); month_type t_month(1); day_type t_day(1); typedef std::num_get<CharT, InItrT> num_get; if(!std::has_facet<num_get>(ios_arg.getloc())) { num_get* ng = new num_get(); std::locale loc = std::locale(ios_arg.getloc(), ng); ios_arg.imbue(loc); } const_itr itr(this->m_format.begin()); while (itr != this->m_format.end() && (sitr != stream_end)) { if (*itr == '%') { - ++itr; + if (++itr == this->m_format.end()) break; if (*itr != '%') { // the cases are grouped by date & time flags - not alphabetical order switch(*itr) { // date flags case 'Y': case 'y': { char_type cs[3] = { '%', *itr }; string_type s(cs); match_results mr; try { t_year = this->m_parser.parse_year(sitr, stream_end, s, mr); } catch(std::out_of_range&) { // base class for bad_year exception if(this->m_sv_parser.match(sitr, stream_end, mr)) { t = time_type(static_cast<special_values>(mr.current_match)); return sitr; } else { throw; // rethrow bad_year } } break; } case 'B': case 'b': case 'm': { char_type cs[3] = { '%', *itr }; string_type s(cs); match_results mr; try { t_month = this->m_parser.parse_month(sitr, stream_end, s, mr); } catch(std::out_of_range&) { // base class for bad_month exception diff --git a/3rdParty/Boost/src/boost/date_time/time_formatting_streams.hpp b/3rdParty/Boost/src/boost/date_time/time_formatting_streams.hpp index 2d07d34..f69f87a 100644 --- a/3rdParty/Boost/src/boost/date_time/time_formatting_streams.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_formatting_streams.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_FORMATTING_STREAMS_HPP___ #define DATE_TIME_TIME_FORMATTING_STREAMS_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <boost/date_time/compiler_config.hpp> #ifndef BOOST_DATE_TIME_NO_LOCALE #include <locale> #include <iomanip> #include <iostream> #include <boost/date_time/date_formatting_locales.hpp> #include <boost/date_time/time_resolution_traits.hpp> namespace boost { namespace date_time { //! Put a time type into a stream using appropriate facets template<class time_duration_type, class charT = char> class ostream_time_duration_formatter { public: typedef std::basic_ostream<charT> ostream_type; typedef typename time_duration_type::fractional_seconds_type fractional_seconds_type; //! Put time into an ostream static void duration_put(const time_duration_type& td, ostream_type& os) { if(td.is_special()) { os << td.get_rep(); } else { charT fill_char = '0'; if(td.is_negative()) { diff --git a/3rdParty/Boost/src/boost/date_time/time_iterator.hpp b/3rdParty/Boost/src/boost/date_time/time_iterator.hpp index 4c33f39..6443936 100644 --- a/3rdParty/Boost/src/boost/date_time/time_iterator.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_iterator.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_ITERATOR_HPP___ #define DATE_TIME_TIME_ITERATOR_HPP___ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ namespace boost { namespace date_time { //! Simple time iterator skeleton class template<class time_type> class time_itr { public: typedef typename time_type::time_duration_type time_duration_type; time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {} time_itr& operator++() { current_ = current_ + offset_; return *this; } time_itr& operator--() { current_ = current_ - offset_; return *this; } time_type operator*() {return current_;} time_type* operator->() {return ¤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;} bool operator>= (const time_type& t) {return current_ >= t;} private: time_type current_; time_duration_type offset_; diff --git a/3rdParty/Boost/src/boost/date_time/time_parsing.hpp b/3rdParty/Boost/src/boost/date_time/time_parsing.hpp index 7b71de0..6de4b7d 100644 --- a/3rdParty/Boost/src/boost/date_time/time_parsing.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_parsing.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_TIME_PARSING_HPP___ #define _DATE_TIME_TIME_PARSING_HPP___ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-10-10 12:05:03 -0700 (Wed, 10 Oct 2012) $ + * $Date$ */ #include "boost/tokenizer.hpp" #include "boost/lexical_cast.hpp" #include "boost/date_time/date_parsing.hpp" #include "boost/cstdint.hpp" #include <iostream> namespace boost { namespace date_time { //! computes exponential math like 2^8 => 256, only works with positive integers //Not general purpose, but needed b/c std::pow is not available //everywehere. Hasn't been tested with negatives and zeros template<class int_type> inline int_type power(int_type base, int_type exponent) { int_type result = 1; for(int i = 0; i < exponent; ++i){ result *= base; } return result; } //! Creates a time_duration object from a delimited string /*! Expected format for string is "[-]h[h][:mm][:ss][.fff]". * If the number of fractional digits provided is greater than the * precision of the time duration type then the extra digits are * truncated. * * A negative duration will be created if the first character in * string is a '-', all other '-' will be treated as delimiters. * Accepted delimiters are "-:,.". */ diff --git a/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp b/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp index 903830c..37785d0 100644 --- a/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_RESOLUTION_TRAITS_HPP #define DATE_TIME_TIME_RESOLUTION_TRAITS_HPP /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-06 04:25:55 -0700 (Sat, 06 Jun 2009) $ + * $Date$ */ #include <boost/cstdint.hpp> #include <boost/date_time/time_defs.hpp> #include <boost/date_time/int_adapter.hpp> #include <boost/date_time/compiler_config.hpp> namespace boost { namespace date_time { //! Simple function to calculate absolute value of a numeric type template <typename T> // JDG [7/6/02 made a template], // moved here from time_duration.hpp 2003-Sept-4. inline T absolute_value(T x) { return x < 0 ? -x : x; } //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_bi32_impl { typedef boost::int32_t int_type; typedef boost::int32_t impl_type; static int_type as_number(impl_type i){ return i;} //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return false;} }; //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_adapted32_impl { typedef boost::int32_t int_type; typedef boost::date_time::int_adapter<boost::int32_t> impl_type; static int_type as_number(impl_type i){ return i.as_number();} //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return true;} diff --git a/3rdParty/Boost/src/boost/date_time/time_system_counted.hpp b/3rdParty/Boost/src/boost/date_time/time_system_counted.hpp index 5425f62..e5ed20b 100644 --- a/3rdParty/Boost/src/boost/date_time/time_system_counted.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_system_counted.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_SYSTEM_COUNTED_HPP #define DATE_TIME_TIME_SYSTEM_COUNTED_HPP /* Copyright (c) 2002,2003 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/time_defs.hpp" #include <string> namespace boost { namespace date_time { //! Time representation that uses a single integer count template<class config> struct counted_time_rep { typedef typename config::int_type int_type; typedef typename config::date_type date_type; typedef typename config::impl_type impl_type; typedef typename date_type::duration_type date_duration_type; typedef typename date_type::calendar_type calendar_type; typedef typename date_type::ymd_type ymd_type; typedef typename config::time_duration_type time_duration_type; typedef typename config::resolution_traits resolution_traits; counted_time_rep(const date_type& d, const time_duration_type& time_of_day) : time_count_(1) { if(d.is_infinity() || d.is_not_a_date() || time_of_day.is_special()) { time_count_ = time_of_day.get_rep() + d.day_count(); //std::cout << time_count_ << std::endl; } else { time_count_ = (d.day_number() * frac_sec_per_day()) + time_of_day.ticks(); } } diff --git a/3rdParty/Boost/src/boost/date_time/time_system_split.hpp b/3rdParty/Boost/src/boost/date_time/time_system_split.hpp index 6fc4a33..cf5931a 100644 --- a/3rdParty/Boost/src/boost/date_time/time_system_split.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_system_split.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_SYSTEM_SPLIT_HPP #define DATE_TIME_TIME_SYSTEM_SPLIT_HPP /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <string> #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/special_defs.hpp" namespace boost { namespace date_time { //! An unadjusted time system implementation. #if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) template<typename config, boost::int32_t ticks_per_second> #else template<typename config> #endif class split_timedate_system { public: typedef typename config::time_rep_type time_rep_type; typedef typename config::date_type date_type; typedef typename config::time_duration_type time_duration_type; typedef typename config::date_duration_type date_duration_type; typedef typename config::int_type int_type; typedef typename config::resolution_traits resolution_traits; //86400 is number of seconds in a day... #if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) typedef date_time::wrapping_int<int_type, INT64_C(86400) * ticks_per_second > wrap_int_type; #else private: BOOST_STATIC_CONSTANT(int_type, ticks_per_day = INT64_C(86400) * config::tick_per_second); public: # if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0X581) ) typedef date_time::wrapping_int< split_timedate_system::int_type, split_timedate_system::ticks_per_day> wrap_int_type; diff --git a/3rdParty/Boost/src/boost/date_time/time_zone_base.hpp b/3rdParty/Boost/src/boost/date_time/time_zone_base.hpp index f239d54..576c77a 100644 --- a/3rdParty/Boost/src/boost/date_time/time_zone_base.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_zone_base.hpp @@ -1,43 +1,43 @@ #ifndef _DATE_TIME_TIME_ZONE_BASE__ #define _DATE_TIME_TIME_ZONE_BASE__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <string> #include <sstream> namespace boost { namespace date_time { //! Interface class for dynamic time zones. /*! This class represents the base interface for all timezone * representations. Subclasses may provide different systems * for identifying a particular zone. For example some may * provide a geographical based zone construction while others * may specify the offset from GMT. Another possible implementation * would be to convert from POSIX timezone strings. Regardless of * the construction technique, this is the interface that these * time zone types must provide. * * Note that this class is intended to be used as a shared * resource (hence the derivation from boost::counted_base. */ template<typename time_type, typename CharT> class time_zone_base { public: typedef CharT char_type; typedef std::basic_string<CharT> string_type; typedef std::basic_ostringstream<CharT> stringstream_type; typedef typename time_type::date_type::year_type year_type; typedef typename time_type::time_duration_type time_duration_type; time_zone_base() {} virtual ~time_zone_base() {} diff --git a/3rdParty/Boost/src/boost/date_time/time_zone_names.hpp b/3rdParty/Boost/src/boost/date_time/time_zone_names.hpp index a565027..405e7e0 100644 --- a/3rdParty/Boost/src/boost/date_time/time_zone_names.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_zone_names.hpp @@ -1,44 +1,44 @@ #ifndef DATE_TIME_TIME_ZONE_NAMES_HPP__ #define DATE_TIME_TIME_ZONE_NAMES_HPP__ /* Copyright (c) 2002-2003,2005 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <string> namespace boost { namespace date_time { template<class CharT> struct default_zone_names { public: typedef CharT char_type; static const char_type standard_name[9]; static const char_type standard_abbrev[11]; static const char_type non_dst_identifier[7]; }; template <class CharT> const typename default_zone_names<CharT>::char_type default_zone_names<CharT>::standard_name[9] = {'s','t','d','_','n','a','m','e'}; template <class CharT> const typename default_zone_names<CharT>::char_type default_zone_names<CharT>::standard_abbrev[11] = {'s','t','d','_','a','b','b','r','e','v'}; template <class CharT> const typename default_zone_names<CharT>::char_type default_zone_names<CharT>::non_dst_identifier[7] = {'n','o','-','d','s','t'}; //! Base type that holds various string names for timezone output. /*! Class that holds various types of strings used for timezones. * For example, for the western United States there is the full * name: Pacific Standard Time and the abbreviated name: PST. * During daylight savings there are additional names: diff --git a/3rdParty/Boost/src/boost/date_time/tz_db_base.hpp b/3rdParty/Boost/src/boost/date_time/tz_db_base.hpp index a6d8ea9..29d6006 100644 --- a/3rdParty/Boost/src/boost/date_time/tz_db_base.hpp +++ b/3rdParty/Boost/src/boost/date_time/tz_db_base.hpp @@ -1,43 +1,43 @@ #ifndef DATE_TIME_TZ_DB_BASE_HPP__ #define DATE_TIME_TZ_DB_BASE_HPP__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. * 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ #include <map> #include <vector> #include <string> #include <sstream> #include <fstream> #include <stdexcept> #include <boost/tokenizer.hpp> #include <boost/shared_ptr.hpp> #include <boost/throw_exception.hpp> #include <boost/date_time/compiler_config.hpp> #include <boost/date_time/time_zone_names.hpp> #include <boost/date_time/time_zone_base.hpp> #include <boost/date_time/time_parsing.hpp> namespace boost { namespace date_time { //! Exception thrown when tz database cannot locate requested data file class data_not_accessible : public std::logic_error { public: data_not_accessible() : std::logic_error(std::string("Unable to locate or access the required datafile.")) {} data_not_accessible(const std::string& filespec) : std::logic_error(std::string("Unable to locate or access the required datafile. Filespec: " + filespec)) {} }; //! Exception thrown when tz database locates incorrect field structure in data file class bad_field_count : public std::out_of_range { public: @@ -148,71 +148,70 @@ namespace boost { class tz_db_base { public: /* Having CharT as a template parameter created problems * with posix_time::duration_from_string. Templatizing * duration_from_string was not possible at this time, however, * it should be possible in the future (when poor compilers get * fixed or stop being used). * Since this class was designed to use CharT as a parameter it * is simply typedef'd here to ease converting in back to a * parameter the future */ typedef char char_type; typedef typename time_zone_type::base_type time_zone_base_type; typedef typename time_zone_type::time_duration_type time_duration_type; typedef time_zone_names_base<char_type> time_zone_names; typedef boost::date_time::dst_adjustment_offsets<time_duration_type> dst_adjustment_offsets; typedef std::basic_string<char_type> string_type; //! Constructs an empty database tz_db_base() {} //! Process csv data file, may throw exceptions /*! May throw bad_field_count exceptions */ void load_from_stream(std::istream &in) { std::string buff; while( std::getline(in, buff)) { parse_string(buff); } } //! Process csv data file, may throw exceptions /*! May throw data_not_accessible, or bad_field_count exceptions */ void load_from_file(const std::string& pathspec) { - string_type in_str; std::string buff; std::ifstream ifs(pathspec.c_str()); if(!ifs){ boost::throw_exception(data_not_accessible(pathspec)); } std::getline(ifs, buff); // first line is column headings this->load_from_stream(ifs); } //! returns true if record successfully added to map /*! Takes a region name in the form of "America/Phoenix", and a * time_zone object for that region. The id string must be a unique * name that does not already exist in the database. */ bool add_record(const string_type& region, boost::shared_ptr<time_zone_base_type> tz) { typename map_type::value_type p(region, tz); return (m_zone_map.insert(p)).second; } //! Returns a time_zone object built from the specs for the given region /*! Returns a time_zone object built from the specs for the given * region. If region does not exist a local_time::record_not_found * exception will be thrown */ boost::shared_ptr<time_zone_base_type> time_zone_from_region(const string_type& region) const { // get the record typename map_type::const_iterator record = m_zone_map.find(region); if(record == m_zone_map.end()){ return boost::shared_ptr<time_zone_base_type>(); //null pointer } return record->second; } @@ -229,111 +228,123 @@ namespace boost { } return regions; } private: typedef std::map<string_type, boost::shared_ptr<time_zone_base_type> > map_type; map_type m_zone_map; // start and end rule are of the same type typedef typename rule_type::start_rule::week_num week_num; /* TODO: mechanisms need to be put in place to handle different * types of rule specs. parse_rules() only handles nth_kday * rule types. */ //! parses rule specs for transition day rules rule_type* parse_rules(const string_type& sr, const string_type& er) const { using namespace gregorian; // start and end rule are of the same type, // both are included here for readability typedef typename rule_type::start_rule start_rule; typedef typename rule_type::end_rule end_rule; // these are: [start|end] nth, day, month int s_nth = 0, s_d = 0, s_m = 0; int e_nth = 0, e_d = 0, e_m = 0; split_rule_spec(s_nth, s_d, s_m, sr); split_rule_spec(e_nth, e_d, e_m, er); typename start_rule::week_num s_wn, e_wn; s_wn = get_week_num(s_nth); e_wn = get_week_num(e_nth); - return new rule_type(start_rule(s_wn, s_d, s_m), - end_rule(e_wn, e_d, e_m)); + return new rule_type(start_rule(s_wn, + static_cast<unsigned short>(s_d), + static_cast<unsigned short>(s_m)), + end_rule(e_wn, + static_cast<unsigned short>(e_d), + static_cast<unsigned short>(e_m))); } //! helper function for parse_rules() week_num get_week_num(int nth) const { typedef typename rule_type::start_rule start_rule; switch(nth){ case 1: return start_rule::first; case 2: return start_rule::second; case 3: return start_rule::third; case 4: return start_rule::fourth; case 5: case -1: return start_rule::fifth; default: // shouldn't get here - add error handling later break; } return start_rule::fifth; // silence warnings } //! splits the [start|end]_date_rule string into 3 ints void split_rule_spec(int& nth, int& d, int& m, string_type rule) const { typedef boost::char_separator<char_type, std::char_traits<char_type> > char_separator_type; typedef boost::tokenizer<char_separator_type, std::basic_string<char_type>::const_iterator, std::basic_string<char_type> > tokenizer; typedef boost::tokenizer<char_separator_type, std::basic_string<char_type>::const_iterator, std::basic_string<char_type> >::iterator tokenizer_iterator; const char_type sep_char[] = { ';', '\0'}; char_separator_type sep(sep_char); tokenizer tokens(rule, sep); // 3 fields - + + if ( std::distance ( tokens.begin(), tokens.end ()) != 3 ) { + std::ostringstream msg; + msg << "Expecting 3 fields, got " + << std::distance ( tokens.begin(), tokens.end ()) + << " fields in line: " << rule; + boost::throw_exception(bad_field_count(msg.str())); + } + tokenizer_iterator tok_iter = tokens.begin(); nth = std::atoi(tok_iter->c_str()); ++tok_iter; d = std::atoi(tok_iter->c_str()); ++tok_iter; m = std::atoi(tok_iter->c_str()); } //! Take a line from the csv, turn it into a time_zone_type. /*! Take a line from the csv, turn it into a time_zone_type, * and add it to the map. Zone_specs in csv file are expected to * have eleven fields that describe the time zone. Returns true if * zone_spec successfully added to database */ bool parse_string(string_type& s) { std::vector<string_type> result; typedef boost::token_iterator_generator<boost::escaped_list_separator<char_type>, string_type::const_iterator, string_type >::type token_iter_type; token_iter_type i = boost::make_token_iterator<string_type>(s.begin(), s.end(),boost::escaped_list_separator<char_type>()); token_iter_type end; while (i != end) { result.push_back(*i); i++; } enum db_fields { ID, STDABBR, STDNAME, DSTABBR, DSTNAME, GMTOFFSET, DSTADJUST, START_DATE_RULE, START_TIME, END_DATE_RULE, END_TIME, FIELD_COUNT }; //take a shot at fixing gcc 4.x error const unsigned int expected_fields = static_cast<unsigned int>(FIELD_COUNT); if (result.size() != expected_fields) { std::ostringstream msg; msg << "Expecting " << FIELD_COUNT << " fields, got " << result.size() << " fields in line: " << s; diff --git a/3rdParty/Boost/src/boost/date_time/wrapping_int.hpp b/3rdParty/Boost/src/boost/date_time/wrapping_int.hpp index e6f87d5..6f869d3 100644 --- a/3rdParty/Boost/src/boost/date_time/wrapping_int.hpp +++ b/3rdParty/Boost/src/boost/date_time/wrapping_int.hpp @@ -1,44 +1,44 @@ #ifndef _DATE_TIME_WRAPPING_INT_HPP__ #define _DATE_TIME_WRAPPING_INT_HPP__ /* Copyright (c) 2002,2003,2005 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) * Author: Jeff Garland, Bart Garst - * $Date: 2012-09-22 15:33:33 -0700 (Sat, 22 Sep 2012) $ + * $Date$ */ namespace boost { namespace date_time { //! A wrapping integer used to support time durations (WARNING: only instantiate with a signed type) /*! In composite date and time types this type is used to * wrap at the day boundary. * Ex: * A wrapping_int<short, 10> will roll over after nine, and * roll under below zero. This gives a range of [0,9] * * NOTE: it is strongly recommended that wrapping_int2 be used * instead of wrapping_int as wrapping_int is to be depricated * at some point soon. * * Also Note that warnings will occur if instantiated with an * unsigned type. Only a signed type should be used! */ template<typename int_type_, int_type_ wrap_val> class wrapping_int { public: typedef int_type_ int_type; //typedef overflow_type_ overflow_type; static int_type wrap_value() {return wrap_val;} //!Add, return true if wrapped wrapping_int(int_type v) : value_(v) {} //! Explicit converion method int_type as_int() const {return value_;} operator int_type() const {return value_;} //!Add, return number of wraps performed /*! The sign of the returned value will indicate which direction the * wraps went. Ex: add a negative number and wrapping under could occur, * this would be indicated by a negative return value. If wrapping over diff --git a/3rdParty/Boost/src/boost/date_time/year_month_day.hpp b/3rdParty/Boost/src/boost/date_time/year_month_day.hpp index 9340e53..e1bf2c7 100644 --- a/3rdParty/Boost/src/boost/date_time/year_month_day.hpp +++ b/3rdParty/Boost/src/boost/date_time/year_month_day.hpp @@ -1,44 +1,44 @@ #ifndef YearMonthDayBase_HPP__ #define YearMonthDayBase_HPP__ /* Copyright (c) 2002,2003 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) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { namespace date_time { //! Allow rapid creation of ymd triples of different types template<typename YearType, typename MonthType, typename DayType> struct year_month_day_base { year_month_day_base(YearType year, MonthType month, DayType day); YearType year; MonthType month; DayType day; typedef YearType year_type; typedef MonthType month_type; typedef DayType day_type; }; //! A basic constructor template<typename YearType, typename MonthType, typename DayType> inline year_month_day_base<YearType,MonthType,DayType>::year_month_day_base(YearType y, MonthType m, DayType d) : year(y), month(m), day(d) {} } }//namespace date_time #endif |