/usr/include/boost/date_time
NameSizeModeActions
gregorian/-0755rm
local_time/-0755rm
posix_time/-0755rm
adjust_functors.hpp54670644editdlrm
compiler_config.hpp56400644editdlrm
constrained_value.hpp42240644editdlrm
c_local_time_adjustor.hpp26310644editdlrm
c_time.hpp44960644editdlrm
date.hpp73570644editdlrm
date_clock_device.hpp22990644editdlrm
date_defs.hpp7010644editdlrm
date_duration.hpp46690644editdlrm
date_duration_types.hpp91860644editdlrm
date_facet.hpp293140644editdlrm
date_formatting.hpp42080644editdlrm
date_formatting_limited.hpp34610644editdlrm
date_formatting_locales.hpp67480644editdlrm
date_format_simple.hpp31280644editdlrm
date_generators.hpp165080644editdlrm
date_generator_formatter.hpp117150644editdlrm
date_generator_parser.hpp130640644editdlrm
date_iterator.hpp33050644editdlrm
date_names_put.hpp107540644editdlrm
date_parsing.hpp141460644editdlrm
dst_rules.hpp154010644editdlrm
dst_transition_generators.hpp22930644editdlrm
filetime_functions.hpp31630644editdlrm
find_match.hpp13550644editdlrm
format_date_parser.hpp239090644editdlrm
gregorian_calendar.hpp27140644editdlrm
gregorian_calendar.ipp79470644editdlrm
int_adapter.hpp144630644editdlrm
iso_format.hpp56400644editdlrm
locale_config.hpp12060644editdlrm
local_timezone_defs.hpp76180644editdlrm
local_time_adjustor.hpp85780644editdlrm
microsec_time_clock.hpp62570644editdlrm
parse_format_base.hpp9610644editdlrm
period.hpp119360644editdlrm
period_formatter.hpp72370644editdlrm
period_parser.hpp79320644editdlrm
special_defs.hpp6330644editdlrm
special_values_formatter.hpp36570644editdlrm
special_values_parser.hpp61610644editdlrm
strings_from_facet.hpp45050644editdlrm
string_convert.hpp10020644editdlrm
string_parse_tree.hpp84050644editdlrm
time.hpp67880644editdlrm
time_clock.hpp22450644editdlrm
time_defs.hpp9420644editdlrm
time_duration.hpp105690644editdlrm
time_facet.hpp589880644editdlrm
time_formatting_streams.hpp37520644editdlrm
time_iterator.hpp14380644editdlrm
time_parsing.hpp118460644editdlrm
time_resolution_traits.hpp67600644editdlrm
time_system_counted.hpp90510644editdlrm
time_system_split.hpp80770644editdlrm
time_zone_base.hpp37110644editdlrm
time_zone_names.hpp31030644editdlrm
tz_db_base.hpp159150644editdlrm
wrapping_int.hpp58240644editdlrm
year_month_day.hpp13750644editdlrm
Edit: /usr/include/boost/date_time/time_resolution_traits.hpp (6760B)
#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$ */ #include #include #include #include #include namespace boost { namespace date_time { //! Simple function to calculate absolute value of a numeric type template // JDG [7/6/02 made a template], // moved here from time_duration.hpp 2003-Sept-4. inline BOOST_CXX14_CONSTEXPR 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 BOOST_CXX14_CONSTEXPR int_type as_number(impl_type i){ return i;} //! Used to determine if implemented type is int_adapter or int static BOOST_CXX14_CONSTEXPR 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 impl_type; static BOOST_CXX14_CONSTEXPR int_type as_number(impl_type i){ return i.as_number();} //! Used to determine if implemented type is int_adapter or int static BOOST_CXX14_CONSTEXPR bool is_adapted() { return true;} }; //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_bi64_impl { typedef boost::int64_t int_type; typedef boost::int64_t impl_type; static BOOST_CXX14_CONSTEXPR int_type as_number(impl_type i){ return i;} //! Used to determine if implemented type is int_adapter or int static BOOST_CXX14_CONSTEXPR bool is_adapted() { return false;} }; //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_adapted64_impl { typedef boost::int64_t int_type; typedef boost::date_time::int_adapter impl_type; static BOOST_CXX14_CONSTEXPR int_type as_number(impl_type i){ return i.as_number();} //! Used to determine if implemented type is int_adapter or int static BOOST_CXX14_CONSTEXPR bool is_adapted() { return true;} }; // // Note about var_type, which is used to define the variable that // stores hours, minutes, and seconds values: // // In Boost 1.65.1 and earlier var_type was boost::int32_t which suffers // the year 2038 problem. Binary serialization of posix_time uses // 32-bit values, and uses serialization version 0. // // In Boost 1.66.0 the var_type changed to std::time_t, however // binary serialization was not properly versioned, so on platforms // where std::time_t is 32-bits, it remains compatible, however on // platforms where std::time_t is 64-bits, binary serialization ingest // will be incompatible with previous versions. Furthermore, binary // serialized output from 1.66.0 will not be compatible with future // versions. Yes, it's a mess. Static assertions were not present // in the serialization code to protect against this possibility. // // In Boost 1.67.0 the var_type was changed to boost::int64_t, // ensuring the output size is 64 bits, and the serialization version // was bumped. Static assertions were added as well, protecting // future changes in this area. // template // see note above class time_resolution_traits { public: typedef typename frac_sec_type::int_type fractional_seconds_type; typedef typename frac_sec_type::int_type tick_type; typedef typename frac_sec_type::impl_type impl_type; typedef var_type day_type; typedef var_type hour_type; typedef var_type min_type; typedef var_type sec_type; // bring in function from frac_sec_type traits structs static BOOST_CXX14_CONSTEXPR fractional_seconds_type as_number(impl_type i) { return frac_sec_type::as_number(i); } static BOOST_CXX14_CONSTEXPR bool is_adapted() { return frac_sec_type::is_adapted(); } //Would like this to be frac_sec_type, but some compilers complain #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) BOOST_STATIC_CONSTANT(boost::int64_t, ticks_per_second = resolution_adjust); #else BOOST_STATIC_CONSTANT(fractional_seconds_type, ticks_per_second = resolution_adjust); #endif static BOOST_CXX14_CONSTEXPR time_resolutions resolution() { return res; } static BOOST_CXX14_CONSTEXPR unsigned short num_fractional_digits() { return frac_digits; } static BOOST_CXX14_CONSTEXPR fractional_seconds_type res_adjust() { return resolution_adjust; } //! Any negative argument results in a negative tick_count static BOOST_CXX14_CONSTEXPR tick_type to_tick_count(hour_type hours, min_type minutes, sec_type seconds, fractional_seconds_type fs) { if(hours < 0 || minutes < 0 || seconds < 0 || fs < 0) { hours = absolute_value(hours); minutes = absolute_value(minutes); seconds = absolute_value(seconds); fs = absolute_value(fs); return static_cast(((((fractional_seconds_type(hours)*3600) + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs) * -1); } return static_cast((((fractional_seconds_type(hours)*3600) + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs); } }; typedef time_resolution_traits milli_res; typedef time_resolution_traits micro_res; typedef time_resolution_traits nano_res; } } //namespace date_time #endif