Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreDate.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_DATE__
8 #define __HDI_CORE_DATE__
9 
10 #include "hdicoreDuration.h"
11 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class Date;
17  }
18 
19  namespace core
20  {
24  class Date
25  {
26  public:
32  Date();
33 
41  Date(const Date& d_);
42 
54  Date(const std::string& date_);
55 
68  Date(const int16_t year_, const int16_t month_, const int16_t day_);
69 
77  static Date Current();
78 
84  virtual ~Date();
85 
94  virtual Date& operator=(const Date& rhs_);
95 
104  virtual bool operator==(const Date& rhs_) const;
105 
114  virtual bool operator!=(const Date& rhs_) const;
115 
126  virtual bool operator<(const Date& rhs_) const;
127 
138  virtual bool operator<=(const Date& rhs_) const;
139 
150  virtual bool operator>(const Date& rhs_) const;
151 
162  virtual bool operator>=(const Date& rhs_) const;
163 
172  virtual Duration operator-(const Date& rhs_) const;
173 
187  virtual Date operator-(const Duration& rhs_) const;
188 
204  virtual Date& operator-=(const Duration& rhs_);
205 
218  virtual Date operator+(const Duration& rhs_) const;
219 
234  virtual Date& operator+=(const Duration& rhs_);
235 
263  virtual std::string format(const std::string& format_ = "Y-m-d") const;
264 
272  virtual int16_t year() const;
273 
284  virtual void setYear(const int16_t year_);
285 
293  virtual int16_t month() const;
294 
305  virtual void setMonth(const int16_t month_);
306 
314  virtual int16_t day() const;
315 
326  virtual void setDay(const int16_t day_);
327 
335  virtual int16_t dayOfWeek() const;
336 
344  virtual int16_t weekNumber() const;
345 
353  virtual int16_t endOfMonth() const;
354 
362  virtual int16_t dayOfYear() const;
363 
364 
365  private:
366  friend class DateTime;
367 
371  plugin::Date* __impl;
372 
378  Date(const plugin::Date&);
379  };
380 
381  typedef std::auto_ptr<Date> DateAP;
382  }
383 }
384 
395 
396 #endif
397 // __HDI_CORE_DATE__
virtual bool operator>=(const Date &rhs_) const
Overloaded greater-than-or-equal operator to determine if one Date object is later in time than...
Allows for acquisition and manipulation of a date (day of year) and time (of day) ...
Definition: hdicoreDateTime.h:25
hdi::core::Date operator+(const hdi::core::Duration &lhs_, const hdi::core::Date &rhs_)
Adds a duration to a date.
virtual int16_t year() const
Gets the year represented by the target.
virtual bool operator==(const Date &rhs_) const
Overloaded equality operator to determine if two Date objects are equal.
virtual Date & operator+=(const Duration &rhs_)
Overloaded addition-assignment operator to determine and assign the resultant date after the initial ...
virtual std::string format(const std::string &format_="Y-m-d") const
Formats the target Date object into a string representation.
Date()
Constructs a Date object with a default value (1970-01-01)
virtual bool operator<=(const Date &rhs_) const
Overloaded less-than-or-equal operator to determine if one Date object is earlier in time than...
virtual bool operator>(const Date &rhs_) const
Overloaded greater-than operator to determine if one Date object is later in time than the other...
virtual Date & operator=(const Date &rhs_)
Overloaded assignment operator to copy values from one Date object to another.
virtual Date & operator-=(const Duration &rhs_)
Overloaded subtraction-assignment operator to determine and assign the resultant date before the init...
static Date Current()
Constructs a Date object from the current system date.
virtual ~Date()
Destructs a Date object.
virtual void setDay(const int16_t day_)
Sets the day of the month represented by the target.
virtual int16_t day() const
Gets the day of the month represented by the target.
Header file for handling a duration of time.
virtual int16_t dayOfYear() const
Gets the day number of the year, from 1 to 366.
virtual bool operator<(const Date &rhs_) const
Overloaded less-than operator to determine if one Date object is earlier in time than the other...
virtual int16_t month() const
Gets the month of the year represented by the target.
Definition: hdicoreaiArray.h:12
virtual int16_t weekNumber() const
Gets the ISO-8601 week number of the year represented by the target, from 1 to 53.
Allows for acquisition and manipulation of a duration of time.
Definition: hdicoreDuration.h:24
virtual Duration operator-(const Date &rhs_) const
Overloaded subtraction operator to determine the duration between two Date objects.
virtual int16_t dayOfWeek() const
Gets the day number of the week, from 0 to 6.
virtual Date operator+(const Duration &rhs_) const
Overloaded addition operator to determine the resultant date after the target.
virtual void setYear(const int16_t year_)
Sets the year that the target should represent.
Allows for acquisition and manipulation of a date (day of year)
Definition: hdicoreDate.h:24
virtual void setMonth(const int16_t month_)
Sets the month of the year represented by the target.
virtual bool operator!=(const Date &rhs_) const
Overloaded inequality operator to determine if two Date objects differ.
virtual int16_t endOfMonth() const
Gets the last day of the month represented by the target, from 28 to 31.