Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
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
12namespace hdi
13{
14 namespace plat
15 {
16 class Time;
17 }
18
19 namespace core
20 {
24 class Time
25 {
26 public:
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 plat::Time* __impl;
382
388 Time(const plat::Time&);
389 };
390
391 typedef std::unique_ptr<Time> TimeUP;
392 typedef std::shared_ptr<Time> TimeSP;
393 typedef std::weak_ptr<Time> TimeWP;
394 }
395}
396
407
408#endif
409// __HDI_CORE_TIME__
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
Allows for acquisition and manipulation of a time (of day)
Definition: hdicoreTime.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 ~Time()
Destructs a Time object.
virtual bool operator==(const Time &rhs_) const
Overloaded equality operator to determine if two Time objects are equal.
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.
virtual double secondsSinceMidnight() const
Gets 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 Time operator-(const Duration &rhs_) const
Overloaded substraction operator to determine the resultant time before the target.
virtual void setHour(const int16_t hour_)
Sets the hour that the target should represent.
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 greater-than-or-equal operator to determine if one Time object is later in the day than,...
virtual bool operator!=(const Time &rhs_) const
Overloaded inequality operator to determine if two Time objects differ.
virtual int16_t hour() const
Gets the hour represented by the target.
static Time Current(const bool us_=false)
Constructs a Time object from the current system time.
virtual int32_t microsecond() const
Gets the microsecond of the second represented by the target.
virtual int16_t minute() const
Gets 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.
Time(const double secsSinceMN_)
Constructs a Time object with an offset from midnight in seconds.
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 Time & operator=(const Time &rhs_)
Overloaded assignment operator to copy values from one Time object to another.
virtual Time operator+(const Duration &rhs_) const
Overloaded addition operator to determine the resultant time after the target.
virtual Duration operator-(const Time &rhs_) const
Overloaded subtraction operator to determine the duration between two Time objects.
Time()
Constructs a Time object with a default value (midnight, 0:00)
Time(const std::string &time_)
Constructs a Time object from a string representation of time.
Time(const Time &t_)
Constructs a Time object from another existing Time object.
virtual std::string format(const std::string &format_="H:i:s") const
Formats the target Time object into a string representation.
virtual Time & operator-=(const Duration &rhs_)
Overloaded subtraction-assignment operator to determine and assign the resultant time before the init...
Time(const int16_t hour_, const int16_t min_, const int16_t sec_=0, const int32_t us_=0)
Constructs a Time object from a given hour, minute, second, and microsecond.
Time(const int32_t secsSinceMN_)
Constructs a Time object with an offset from midnight in seconds.
virtual void setMinute(const int16_t min_)
Sets the minute of the hour represented by the target.
virtual void setSecond(const int16_t sec_)
Sets the second of the minute represented by the target.
virtual Time & operator+=(const Duration &rhs_)
Overloaded addition-assignment operator to determine and assign the resultant time after the initial ...
Header file for handling a duration of time.
hdi::core::Time operator+(const hdi::core::Duration &lhs_, const hdi::core::Time &rhs_)
Adds a duration to a time of day.