/
usr
/
include
/
boost
/
date_time
/
/usr/include/boost/date_time
mkdir
upload
Name
Size
Mode
Actions
gregorian/
-
0755
rm
local_time/
-
0755
rm
posix_time/
-
0755
rm
adjust_functors.hpp
5467
0644
edit
dl
rm
compiler_config.hpp
5640
0644
edit
dl
rm
constrained_value.hpp
4224
0644
edit
dl
rm
c_local_time_adjustor.hpp
2631
0644
edit
dl
rm
c_time.hpp
4496
0644
edit
dl
rm
date.hpp
7357
0644
edit
dl
rm
date_clock_device.hpp
2299
0644
edit
dl
rm
date_defs.hpp
701
0644
edit
dl
rm
date_duration.hpp
4669
0644
edit
dl
rm
date_duration_types.hpp
9186
0644
edit
dl
rm
date_facet.hpp
29314
0644
edit
dl
rm
date_formatting.hpp
4208
0644
edit
dl
rm
date_formatting_limited.hpp
3461
0644
edit
dl
rm
date_formatting_locales.hpp
6748
0644
edit
dl
rm
date_format_simple.hpp
3128
0644
edit
dl
rm
date_generators.hpp
16508
0644
edit
dl
rm
date_generator_formatter.hpp
11715
0644
edit
dl
rm
date_generator_parser.hpp
13064
0644
edit
dl
rm
date_iterator.hpp
3305
0644
edit
dl
rm
date_names_put.hpp
10754
0644
edit
dl
rm
date_parsing.hpp
14146
0644
edit
dl
rm
dst_rules.hpp
15401
0644
edit
dl
rm
dst_transition_generators.hpp
2293
0644
edit
dl
rm
filetime_functions.hpp
3163
0644
edit
dl
rm
find_match.hpp
1355
0644
edit
dl
rm
format_date_parser.hpp
23909
0644
edit
dl
rm
gregorian_calendar.hpp
2714
0644
edit
dl
rm
gregorian_calendar.ipp
7947
0644
edit
dl
rm
int_adapter.hpp
14463
0644
edit
dl
rm
iso_format.hpp
5640
0644
edit
dl
rm
locale_config.hpp
1206
0644
edit
dl
rm
local_timezone_defs.hpp
7618
0644
edit
dl
rm
local_time_adjustor.hpp
8578
0644
edit
dl
rm
microsec_time_clock.hpp
6257
0644
edit
dl
rm
parse_format_base.hpp
961
0644
edit
dl
rm
period.hpp
11936
0644
edit
dl
rm
period_formatter.hpp
7237
0644
edit
dl
rm
period_parser.hpp
7932
0644
edit
dl
rm
special_defs.hpp
633
0644
edit
dl
rm
special_values_formatter.hpp
3657
0644
edit
dl
rm
special_values_parser.hpp
6161
0644
edit
dl
rm
strings_from_facet.hpp
4505
0644
edit
dl
rm
string_convert.hpp
1002
0644
edit
dl
rm
string_parse_tree.hpp
8405
0644
edit
dl
rm
time.hpp
6788
0644
edit
dl
rm
time_clock.hpp
2245
0644
edit
dl
rm
time_defs.hpp
942
0644
edit
dl
rm
time_duration.hpp
10569
0644
edit
dl
rm
time_facet.hpp
58988
0644
edit
dl
rm
time_formatting_streams.hpp
3752
0644
edit
dl
rm
time_iterator.hpp
1438
0644
edit
dl
rm
time_parsing.hpp
11846
0644
edit
dl
rm
time_resolution_traits.hpp
6760
0644
edit
dl
rm
time_system_counted.hpp
9051
0644
edit
dl
rm
time_system_split.hpp
8077
0644
edit
dl
rm
time_zone_base.hpp
3711
0644
edit
dl
rm
time_zone_names.hpp
3103
0644
edit
dl
rm
tz_db_base.hpp
15915
0644
edit
dl
rm
wrapping_int.hpp
5824
0644
edit
dl
rm
year_month_day.hpp
1375
0644
edit
dl
rm
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 <ctime> #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 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<boost::int32_t> 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<boost::int64_t> 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<typename frac_sec_type, time_resolutions res, #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) boost::int64_t resolution_adjust, #else typename frac_sec_type::int_type resolution_adjust, #endif unsigned short frac_digits, typename var_type = boost::int64_t > // 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<tick_type>(((((fractional_seconds_type(hours)*3600) + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs) * -1); } return static_cast<tick_type>((((fractional_seconds_type(hours)*3600) + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs); } }; typedef time_resolution_traits<time_resolution_traits_adapted32_impl, milli, 1000, 3 > milli_res; typedef time_resolution_traits<time_resolution_traits_adapted64_impl, micro, 1000000, 6 > micro_res; typedef time_resolution_traits<time_resolution_traits_adapted64_impl, nano, 1000000000, 9 > nano_res; } } //namespace date_time #endif
Save
cmd:
run