Chris@16: #ifndef POSIX_PTIME_HPP___ Chris@16: #define POSIX_PTIME_HPP___ Chris@16: Chris@16: /* Copyright (c) 2002,2003 CrystalClear Software, Inc. Chris@16: * Use, modification and distribution is subject to the Chris@16: * Boost Software License, Version 1.0. (See accompanying Chris@16: * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Author: Jeff Garland Chris@101: * $Date$ Chris@16: */ Chris@16: Chris@16: #include "boost/date_time/posix_time/posix_time_system.hpp" Chris@16: #include "boost/date_time/time.hpp" Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: namespace posix_time { Chris@16: Chris@16: //bring special enum values into the namespace Chris@16: using date_time::special_values; Chris@16: using date_time::not_special; Chris@16: using date_time::neg_infin; Chris@16: using date_time::pos_infin; Chris@16: using date_time::not_a_date_time; Chris@16: using date_time::max_date_time; Chris@16: using date_time::min_date_time; Chris@16: Chris@16: //! Time type with no timezone or other adjustments Chris@16: /*! \ingroup time_basics Chris@16: */ Chris@16: class ptime : public date_time::base_time Chris@16: { Chris@16: public: Chris@16: typedef posix_time_system time_system_type; Chris@16: typedef time_system_type::time_rep_type time_rep_type; Chris@16: typedef time_system_type::time_duration_type time_duration_type; Chris@16: typedef ptime time_type; Chris@16: //! Construct with date and offset in day Chris@16: ptime(gregorian::date d,time_duration_type td) : date_time::base_time(d,td) Chris@16: {} Chris@16: //! Construct a time at start of the given day (midnight) Chris@16: explicit ptime(gregorian::date d) : date_time::base_time(d,time_duration_type(0,0,0)) Chris@16: {} Chris@16: //! Copy from time_rep Chris@16: ptime(const time_rep_type& rhs): Chris@16: date_time::base_time(rhs) Chris@16: {} Chris@16: //! Construct from special value Chris@16: ptime(const special_values sv) : date_time::base_time(sv) Chris@16: {} Chris@16: #if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR) Chris@16: // Default constructor constructs to not_a_date_time Chris@16: ptime() : date_time::base_time(gregorian::date(not_a_date_time), time_duration_type(not_a_date_time)) Chris@16: {} Chris@16: #endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR Chris@16: Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: } }//namespace posix_time Chris@16: Chris@16: Chris@16: #endif Chris@16: