Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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
12namespace hdi
13{
14 namespace plat
15 {
16 class Date;
17 }
18
19 namespace core
20 {
24 class Date
25 {
26 public:
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 plat::Date* __impl;
372
378 Date(const plat::Date&);
379 };
380
381 typedef std::unique_ptr<Date> DateUP;
382 typedef std::shared_ptr<Date> DateSP;
383 typedef std::weak_ptr<Date> DateWP;
384 }
385}
386
397
398#endif
399// __HDI_CORE_DATE__
Allows for acquisition and manipulation of a date (day of year)
Definition: hdicoreDate.h:25
virtual int16_t year() const
Gets the year represented by the target.
virtual int16_t dayOfYear() const
Gets the day number of the year, from 1 to 366.
virtual bool operator>=(const Date &rhs_) const
Overloaded greater-than-or-equal operator to determine if one Date object is later in time than,...
virtual bool operator==(const Date &rhs_) const
Overloaded equality operator to determine if two Date objects are equal.
virtual bool operator<=(const Date &rhs_) const
Overloaded less-than-or-equal operator to determine if one Date object is earlier in time than,...
static Date Current()
Constructs a Date object from the current system date.
virtual void setMonth(const int16_t month_)
Sets the month of the year represented by the target.
virtual ~Date()
Destructs a Date object.
virtual int16_t month() const
Gets the month of the year represented by the target.
virtual Duration operator-(const Date &rhs_) const
Overloaded subtraction operator to determine the duration between two Date objects.
virtual int16_t day() const
Gets the day of the month represented by the target.
virtual bool operator!=(const Date &rhs_) const
Overloaded inequality operator to determine if two Date objects differ.
virtual Date operator-(const Duration &rhs_) const
Overloaded substraction operator to determine the resultant date before the target.
virtual Date & operator+=(const Duration &rhs_)
Overloaded addition-assignment operator to determine and assign the resultant date after the initial ...
virtual int16_t weekNumber() const
Gets the ISO-8601 week number of the year represented by the target, from 1 to 53.
virtual void setDay(const int16_t day_)
Sets the day of the month represented by the target.
virtual int16_t endOfMonth() const
Gets the last day of the month represented by the target, from 28 to 31.
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 bool operator<(const Date &rhs_) const
Overloaded less-than operator to determine if one Date object is earlier in time than the other.
virtual Date & operator-=(const Duration &rhs_)
Overloaded subtraction-assignment operator to determine and assign the resultant date before the init...
virtual Date & operator=(const Date &rhs_)
Overloaded assignment operator to copy values from one Date object to another.
virtual std::string format(const std::string &format_="Y-m-d") const
Formats the target Date object into a string representation.
Date(const Date &d_)
Constructs a Date object from another existing Date object.
Date(const int16_t year_, const int16_t month_, const int16_t day_)
Constructs a Date object from a given year, month, and day.
virtual int16_t dayOfWeek() const
Gets the day number of the week, from 0 to 6.
Date()
Constructs a Date object with a default value (1970-01-01)
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.
Date(const std::string &date_)
Constructs a Date object from a string representation of a date.
Allows for acquisition and manipulation of a date (day of year) and time (of day)
Definition: hdicoreDateTime.h:26
Allows for acquisition and manipulation of a duration of time.
Definition: hdicoreDuration.h:25
hdi::core::Date operator+(const hdi::core::Duration &lhs_, const hdi::core::Date &rhs_)
Adds a duration to a date.
Header file for handling a duration of time.