Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreTime.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_TIME__
8 #define __HDI_CORE_TIME__
9 
10 #include "hdicoreDuration.h"
11 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class Time;
17  }
18 
19  namespace core
20  {
24  class Time
25  {
26  public:
32  Time();
33 
41  Time(const Time& t_);
42 
53  explicit Time(const int32_t secsSinceMN_);
54 
55 
66  explicit Time(const double secsSinceMN_);
67 
79  Time(const std::string& time_);
80 
94  Time(const int16_t hour_, const int16_t min_, const int16_t sec_ = 0, const int32_t us_ = 0);
95 
104  static Time Current(const bool us_ = false);
105 
111  virtual ~Time();
112 
121  virtual Time& operator=(const Time& rhs_);
122 
131  virtual bool operator==(const Time& rhs_) const;
132 
141  virtual bool operator!=(const Time& rhs_) const;
142 
153  virtual bool operator<(const Time& rhs_) const;
154 
165  virtual bool operator<=(const Time& rhs_) const;
166 
177  virtual bool operator>(const Time& rhs_) const;
178 
189  virtual bool operator>=(const Time& rhs_) const;
190 
199  virtual Duration operator-(const Time& rhs_) const;
200 
210  virtual Time operator-(const Duration& rhs_) const;
211 
223  virtual Time& operator-=(const Duration& rhs_);
224 
233  virtual Time operator+(const Duration& rhs_) const;
234 
245  virtual Time& operator+=(const Duration& rhs_);
246 
267  virtual std::string format(const std::string& format_ = "H:i:s") const;
268 
276  virtual int16_t hour() const;
277 
288  virtual void setHour(const int16_t hour_);
289 
297  virtual int16_t minute() const;
298 
309  virtual void setMinute(const int16_t min_);
310 
318  virtual int16_t second() const;
319 
330  virtual void setSecond(const int16_t sec_);
331 
339  virtual int32_t microsecond() const;
340 
351  virtual void setMicrosecond(const int32_t us_);
352 
360  virtual double secondsSinceMidnight() const;
361 
372  virtual void setSecondsSinceMidnight(const double secsSinceMN_);
373 
374 
375  private:
376  friend class DateTime;
377 
381  plugin::Time* __impl;
382 
388  Time(const plugin::Time&);
389  };
390 
391  typedef std::auto_ptr<Time> TimeAP;
392  }
393 }
394 
405 
406 #endif
407 // __HDI_CORE_TIME__
virtual int16_t minute() const
Gets the minute of the hour represented by the target.
static Time Current(const bool us_=false)
Constructs a Time object from the current system time.
Allows for acquisition and manipulation of a time (of day)
Definition: hdicoreTime.h:24
Allows for acquisition and manipulation of a date (day of year) and time (of day) ...
Definition: hdicoreDateTime.h:25
virtual bool operator<=(const Time &rhs_) const
Overloaded less-than-or-equal operator to determine if one Time object is earlier in the day than...
virtual bool operator>=(const Time &rhs_) const
Overloaded greater-than-or-equal operator to determine if one Time object is later in the day than...
virtual Time & operator+=(const Duration &rhs_)
Overloaded addition-assignment operator to determine and assign the resultant time after the initial ...
hdi::core::Time operator+(const hdi::core::Duration &lhs_, const hdi::core::Time &rhs_)
Adds a duration to a time of day.
virtual bool operator>(const Time &rhs_) const
Overloaded greater-than operator to determine if one Time object is later in the day than the other...
Time()
Constructs a Time object with a default value (midnight, 0:00)
virtual Time & operator-=(const Duration &rhs_)
Overloaded subtraction-assignment operator to determine and assign the resultant time before the init...
virtual Time operator+(const Duration &rhs_) const
Overloaded addition operator to determine the resultant time after the target.
virtual double secondsSinceMidnight() const
Gets the number of seconds, since midnight, represented by the target.
virtual void setMinute(const int16_t min_)
Sets the minute of the hour represented by the target.
virtual void setSecondsSinceMidnight(const double secsSinceMN_)
Sets the number of seconds, since midnight, represented by the target.
virtual int16_t second() const
Gets the second of the minute represented by the target.
virtual bool operator!=(const Time &rhs_) const
Overloaded inequality operator to determine if two Time objects differ.
Header file for handling a duration of time.
virtual int16_t hour() const
Gets the hour represented by the target.
virtual Time & operator=(const Time &rhs_)
Overloaded assignment operator to copy values from one Time object to another.
virtual std::string format(const std::string &format_="H:i:s") const
Formats the target Time object into a string representation.
Definition: hdicoreaiArray.h:12
virtual void setSecond(const int16_t sec_)
Sets the second of the minute represented by the target.
Allows for acquisition and manipulation of a duration of time.
Definition: hdicoreDuration.h:24
virtual int32_t microsecond() const
Gets the microsecond of the second represented by the target.
virtual void setMicrosecond(const int32_t us_)
Sets the microsecond of the second represented by the target.
virtual bool operator==(const Time &rhs_) const
Overloaded equality operator to determine if two Time objects are equal.
virtual void setHour(const int16_t hour_)
Sets the hour that the target should represent.
virtual bool operator<(const Time &rhs_) const
Overloaded less-than operator to determine if one Time object is earlier in the day than the other...
virtual Duration operator-(const Time &rhs_) const
Overloaded subtraction operator to determine the duration between two Time objects.
virtual ~Time()
Destructs a Time object.