Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreDateTime.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_DATETIME__
8 #define __HDI_CORE_DATETIME__
9 
10 #include "hdicoreDate.h"
11 #include "hdicoreTime.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class DateTime;
18  }
19 
20  namespace core
21  {
25  class DateTime
26  {
27  public:
33  DateTime();
34 
42  DateTime(const DateTime& dt_);
43 
52  DateTime(const Date& d_, const Time& t_);
53 
61  explicit DateTime(const int32_t ts_);
62 
70  explicit DateTime(const int64_t ts_);
71 
79  explicit DateTime(const double ts_);
80 
92  DateTime(const std::string& dt_);
93 
111  DateTime(
112  const int16_t year_,
113  const int16_t month_,
114  const int16_t day_,
115  const int16_t hour_,
116  const int16_t min_,
117  const int16_t sec_ = 0,
118  const int32_t us_ = 0
119  );
120 
129  static DateTime Current(const bool us_ = false);
130 
136  virtual ~DateTime();
137 
146  virtual DateTime& operator=(const DateTime& rhs_);
147 
156  virtual bool operator==(const DateTime& rhs_) const;
157 
166  virtual bool operator!=(const DateTime& rhs_) const;
167 
178  virtual bool operator<(const DateTime& rhs_) const;
179 
190  virtual bool operator<=(const DateTime& rhs_) const;
191 
202  virtual bool operator>(const DateTime& rhs_) const;
203 
214  virtual bool operator>=(const DateTime& rhs_) const;
215 
225  virtual Duration operator-(const DateTime& rhs_) const;
226 
237  virtual DateTime operator-(const Duration& rhs_) const;
238 
250  virtual DateTime& operator-=(const Duration& rhs_);
251 
260  virtual DateTime operator+(const Duration& rhs_) const;
261 
272  virtual DateTime& operator+=(const Duration& rhs_);
273 
285  Date date() const;
286 
294  void setDate(const Date& d_);
295 
307  Time time() const;
308 
316  void setTime(const Time& t_);
317 
329  virtual std::string format(const std::string& format_ = "Y-m-d H:i:s") const;
330 
331 
332  private:
336  plugin::DateTime* __impl;
337  };
338 
339  typedef std::auto_ptr<DateTime> DateTimeAP;
340  }
341 }
342 
353 
354 #endif
355 // __HDI_CORE_DATETIME__
virtual Duration operator-(const DateTime &rhs_) const
Overloaded subtraction operator to determine the duration between two DateTime objects.
Allows for acquisition and manipulation of a time (of day)
Definition: hdicoreTime.h:24
Header file for handling a day of the year.
Allows for acquisition and manipulation of a date (day of year) and time (of day) ...
Definition: hdicoreDateTime.h:25
hdi::core::DateTime operator+(const hdi::core::Duration &lhs_, const hdi::core::DateTime &rhs_)
Adds a duration to a date and time.
Time time() const
Gets the time for the DateTime object.
virtual DateTime operator+(const Duration &rhs_) const
Overloaded addition operator to determine the resultant date and time after the target.
Header file for handling a time of day.
void setTime(const Time &t_)
Sets the time for the DateTime object.
virtual bool operator<=(const DateTime &rhs_) const
Overloaded less-than-or-equal operator to determine if one DateTime object is earlier in time than...
virtual bool operator>=(const DateTime &rhs_) const
Overloaded greater-than-or-equal operator to determine if one DateTime object is later in time than...
static DateTime Current(const bool us_=false)
Constructs a DateTime object from the current system time.
Date date() const
Gets the date for the DateTime object.
void setDate(const Date &d_)
Sets the date for the DateTime object.
DateTime()
Constructs a DateTime object with a default value (1970-01-01 00:00:00)
virtual bool operator>(const DateTime &rhs_) const
Overloaded greater-than operator to determine if one DateTime object is later in time than the other...
virtual bool operator!=(const DateTime &rhs_) const
Overloaded inequality operator to determine if two DateTime objects differ.
virtual ~DateTime()
Destructs a DateTime object.
Definition: hdicoreaiArray.h:12
virtual DateTime & operator-=(const Duration &rhs_)
Overloaded subtraction-assignment operator to determine and assign the resultant date and time before...
virtual DateTime & operator=(const DateTime &rhs_)
Overloaded assignment operator to copy values from one DateTime object to another.
Allows for acquisition and manipulation of a duration of time.
Definition: hdicoreDuration.h:24
virtual std::string format(const std::string &format_="Y-m-d H:i:s") const
Formats the target DateTime object into a string representation.
virtual bool operator<(const DateTime &rhs_) const
Overloaded less-than operator to determine if one DateTime object is earlier in time than the other...
virtual bool operator==(const DateTime &rhs_) const
Overloaded equality operator to determine if two DateTime objects are equal.
virtual DateTime & operator+=(const Duration &rhs_)
Overloaded addition-assignment operator to determine and assign the resultant date and time after the...
Allows for acquisition and manipulation of a date (day of year)
Definition: hdicoreDate.h:24