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