Line data Source code
1 : #ifndef POSIX_PTIME_HPP___ 2 : #define POSIX_PTIME_HPP___ 3 : 4 : /* Copyright (c) 2002,2003 CrystalClear Software, Inc. 5 : * Use, modification and distribution is subject to the 6 : * Boost Software License, Version 1.0. (See accompanying 7 : * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 8 : * Author: Jeff Garland 9 : * $Date$ 10 : */ 11 : 12 : #include <boost/date_time/posix_time/posix_time_system.hpp> 13 : #include <boost/date_time/time.hpp> 14 : #include <boost/date_time/compiler_config.hpp> 15 : 16 : namespace boost { 17 : 18 : namespace posix_time { 19 : 20 : //bring special enum values into the namespace 21 : using date_time::special_values; 22 : using date_time::not_special; 23 : using date_time::neg_infin; 24 : using date_time::pos_infin; 25 : using date_time::not_a_date_time; 26 : using date_time::max_date_time; 27 : using date_time::min_date_time; 28 : 29 : //! Time type with no timezone or other adjustments 30 : /*! \ingroup time_basics 31 : */ 32 : class BOOST_SYMBOL_VISIBLE ptime : public date_time::base_time<ptime, posix_time_system> 33 : { 34 : public: 35 : typedef posix_time_system time_system_type; 36 : typedef time_system_type::time_rep_type time_rep_type; 37 : typedef time_system_type::time_duration_type time_duration_type; 38 : typedef ptime time_type; 39 : //! Construct with date and offset in day 40 0 : ptime(gregorian::date d,time_duration_type td) : date_time::base_time<time_type,time_system_type>(d,td) 41 : {} 42 : //! Construct a time at start of the given day (midnight) 43 : explicit ptime(gregorian::date d) : date_time::base_time<time_type,time_system_type>(d,time_duration_type(0,0,0)) 44 : {} 45 : //! Copy from time_rep 46 : ptime(const time_rep_type& rhs): 47 : date_time::base_time<time_type,time_system_type>(rhs) 48 : {} 49 : //! Construct from special value 50 : ptime(const special_values sv) : date_time::base_time<time_type,time_system_type>(sv) 51 : {} 52 : #if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR) 53 : // Default constructor constructs to not_a_date_time 54 : ptime() : date_time::base_time<time_type,time_system_type>(gregorian::date(not_a_date_time), time_duration_type(not_a_date_time)) 55 : {} 56 : #endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR 57 : 58 : }; 59 : 60 : 61 : 62 : } }//namespace posix_time 63 : 64 : 65 : #endif 66 :