Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreDuration.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_DURATION__
8 #define __HDI_CORE_DURATION__
9 
10 #include "hdicoreTypes.h"
11 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class Duration;
17  }
18 
19  namespace core
20  {
24  class Duration
25  {
26  public:
32  Duration();
33 
41  Duration(const Duration& d_);
42 
51  Duration(const int64_t secs_, const int32_t us_ = 0);
52 
61  static Duration Years(const int64_t years_);
62 
71  static Duration Days(const int64_t days_);
72 
81  static Duration Hours(const int64_t hours_);
82 
91  static Duration Minutes(const int64_t mins_);
92 
103  static Duration TimeZoneOffset();
104 
110  virtual ~Duration();
111 
120  virtual Duration& operator=(const Duration& rhs_);
121 
130  virtual bool operator==(const Duration& rhs_) const;
131 
140  virtual bool operator!=(const Duration& rhs_) const;
141 
151  virtual bool operator<(const Duration& rhs_) const;
152 
163  virtual bool operator<=(const Duration& rhs_) const;
164 
175  virtual bool operator>(const Duration& rhs_) const;
176 
188  virtual bool operator>=(const Duration& rhs_) const;
189 
197  virtual Duration operator-() const;
198 
208  virtual Duration operator-(const Duration& rhs_) const;
209 
220  virtual Duration& operator-=(const Duration& rhs_);
221 
230  virtual Duration operator+(const Duration& rhs_) const;
231 
241  virtual Duration& operator+=(const Duration& rhs_);
242 
251  virtual Duration operator*(const double rhs_) const;
252 
263  virtual Duration& operator*=(const double rhs_);
264 
273  virtual Duration operator/(const double rhs_) const;
274 
284  virtual Duration& operator/=(const double rhs_);
285 
293  virtual double years() const;
294 
302  virtual double days() const;
303 
311  virtual double hours() const;
312 
320  virtual double minutes() const;
321 
329  virtual double seconds() const;
330 
331 
332  private:
333  friend class Date;
334  friend class DateTime;
335  friend class Time;
336 
340  plugin::Duration* __impl;
341 
347  Duration(const plugin::Duration&);
348  };
349 
350  typedef std::auto_ptr<Duration> DurationAP;
351  }
352 }
353 
363 hdi::core::Duration operator*(const double lhs_, const hdi::core::Duration& rhs_);
364 
365 #endif
366 // __HDI_CORE_DURATION__
virtual Duration & operator=(const Duration &rhs_)
Overloaded assignment operator to copy values from one Duration object to another.
virtual bool operator<=(const Duration &rhs_) const
Overloaded less-than-or-equal operator to determine if one Duration object is less than...
virtual bool operator<(const Duration &rhs_) const
Overloaded less-than operator to determine if one Duration object is less than the other...
Duration()
Constructs a Duration object with a default duration (0 seconds)
Allows for acquisition and manipulation of a time (of day)
Definition: hdicoreTime.h:24
virtual Duration operator*(const double rhs_) const
Overloaded multiplication operator to multiply a duration by a constant.
Allows for acquisition and manipulation of a date (day of year) and time (of day) ...
Definition: hdicoreDateTime.h:25
virtual double hours() const
Number of hours in the duration.
virtual bool operator==(const Duration &rhs_) const
Overloaded equality operator to determine if two Duration objects are equal.
virtual bool operator!=(const Duration &rhs_) const
Overloaded inequality operator to determine if two Duration objects differ.
static Duration Minutes(const int64_t mins_)
Creates a Duration object for a given number of minutes.
virtual Duration operator+(const Duration &rhs_) const
Overloaded addition operator to add one duration to another.
virtual double minutes() const
Number of minutes in the duration.
hdi::core::Duration operator*(const double lhs_, const hdi::core::Duration &rhs_)
Multiplies a duration by a constant.
virtual double seconds() const
Number of seconds in the duration.
virtual Duration & operator+=(const Duration &rhs_)
Overloaded addition-assignment operator to add and assign the resultant Duration. ...
static Duration Days(const int64_t days_)
Creates a Duration object for a given number of days.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual double days() const
Number of days in the duration.
virtual Duration operator-() const
Overloaded unary minus operator, to flip the sign of the target Duration object.
Definition: hdicoreaiArray.h:12
virtual Duration operator/(const double rhs_) const
Overloaded division operator to divide a duration by a constant.
virtual double years() const
Number of years in the duration.
virtual bool operator>(const Duration &rhs_) const
Overloaded greater-than operator to determine if one Duration object is greater than the other...
Allows for acquisition and manipulation of a duration of time.
Definition: hdicoreDuration.h:24
virtual bool operator>=(const Duration &rhs_) const
Overloaded greater-than-or-equal operator to determine if one Duration object is greater than...
static Duration Hours(const int64_t hours_)
Creates a Duration object for a given number of hours.
virtual Duration & operator*=(const double rhs_)
Overloaded multiplication-assignment operator to multiply and assign the resultant Duration...
Allows for acquisition and manipulation of a date (day of year)
Definition: hdicoreDate.h:24
virtual Duration & operator/=(const double rhs_)
Overloaded division-assignment operator to divide and assign the resultant Duration.
static Duration TimeZoneOffset()
Creates a Duration object for the system's time zone offset.
virtual ~Duration()
Destructs a Duration object.
virtual Duration & operator-=(const Duration &rhs_)
Overloaded subtraction-assignment operator to subtract and assign the resultant Duration.
static Duration Years(const int64_t years_)
Creates a Duration object for a given number of years.