|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <temporal.h>
Public Member Functions | |
| virtual bool | operator== (const Date &rhs) |
| virtual bool | operator!= (const Date &rhs) |
| virtual bool | operator> (const Date &rhs) |
| virtual bool | operator>= (const Date &rhs) |
| virtual bool | operator< (const Date &rhs) |
| virtual bool | operator<= (const Date &rhs) |
| virtual bool | operator== (const DateTime &rhs) |
| virtual bool | operator!= (const DateTime &rhs) |
| virtual bool | operator> (const DateTime &rhs) |
| virtual bool | operator>= (const DateTime &rhs) |
| virtual bool | operator< (const DateTime &rhs) |
| virtual bool | operator<= (const DateTime &rhs) |
| virtual bool | operator== (const Timestamp &rhs) |
| virtual bool | operator!= (const Timestamp &rhs) |
| virtual bool | operator> (const Timestamp &rhs) |
| virtual bool | operator>= (const Timestamp &rhs) |
| virtual bool | operator< (const Timestamp &rhs) |
| virtual bool | operator<= (const Timestamp &rhs) |
| const Date | operator- (const Date &rhs) |
| const Date | operator+ (const Date &rhs) |
| Date & | operator+= (const Date &rhs) |
| Date & | operator-= (const Date &rhs) |
| const Date | operator- (const Time &rhs) |
| const Date | operator+ (const Time &rhs) |
| Date & | operator-= (const Time &rhs) |
| Date & | operator+= (const Time &rhs) |
| const Date | operator- (const DateTime &rhs) |
| const Date | operator+ (const DateTime &rhs) |
| Date & | operator+= (const DateTime &rhs) |
| Date & | operator-= (const DateTime &rhs) |
| Date & | operator= (const DateTime &rhs) |
| virtual bool | is_valid_date () const |
| virtual bool | is_valid_datetime () const |
| virtual bool | is_valid_time () const |
| virtual bool | is_valid_timestamp () const |
| virtual bool | is_valid () const |
| virtual bool | in_unix_epoch () const |
| virtual int | to_string (char *to, size_t to_len) const |
| virtual bool | from_string (const char *from, size_t from_len) |
| virtual void | to_int64_t (int64_t *to) const |
| virtual void | to_int32_t (int32_t *to) const |
| virtual bool | from_int32_t (const int32_t from) |
| void | to_julian_day_number (int64_t *to) const |
| bool | from_julian_day_number (const int64_t from) |
| virtual void | to_tm (struct tm *to) const |
| virtual bool | from_tm (const struct tm *from) |
| virtual void | to_time_t (time_t &to) const |
| virtual bool | from_time_t (const time_t from) |
| virtual void | to_decimal (type::Decimal *to) const |
| Public Member Functions inherited from drizzled::Temporal | |
| enum calendar | calendar () const |
| void | set_nseconds (const uint32_t nsecond) |
| uint32_t | nseconds () const |
| void | set_useconds (const uint32_t usecond) |
| uint32_t | useconds () const |
| void | set_epoch_seconds () |
| void | set_epoch_seconds (const uint32_t epoch_second) |
| time_t | epoch_seconds () const |
| void | set_seconds (const uint32_t second) |
| uint32_t | seconds () const |
| void | set_minutes (const uint32_t minute) |
| uint32_t | minutes () const |
| void | set_hours (const uint32_t hour) |
| uint32_t | hours () const |
| void | set_days (const uint32_t day) |
| uint32_t | days () const |
| void | set_months (const uint32_t month) |
| uint32_t | months () const |
| void | set_years (const uint32_t year) |
| uint32_t | years () const |
| bool | overflow () const |
Static Public Attributes | |
| static const int | MAX_STRING_LENGTH = 11 |
Friends | |
| class | TemporalInterval |
| class | Timestamp |
Additional Inherited Members | |
| Protected Member Functions inherited from drizzled::Temporal | |
| uint64_t | _cumulative_seconds_in_time () const |
| void | _reset () |
| Protected Attributes inherited from drizzled::Temporal | |
| enum calendar | _calendar |
| uint32_t | _years |
| uint32_t | _months |
| uint32_t | _days |
| uint32_t | _hours |
| uint32_t | _minutes |
| uint32_t | _seconds |
| time_t | _epoch_seconds |
| uint32_t | _useconds |
| uint32_t | _nseconds |
| bool | _overflow |
Class representing temporal components in a valid SQL date range, with no time component
Definition at line 191 of file temporal.h.
|
inline |
Definition at line 194 of file temporal.h.
|
virtual |
Attempts to populate the Date instance based on the contents of a supplied 4-byte integer.
Returns whether the conversion was successful.
| Integer | to convert from |
Ignore overflow and pass-through to DateTime::from_int64_t()
Reimplemented in drizzled::DateTime.
Definition at line 1083 of file temporal.cc.
| bool drizzled::Date::from_julian_day_number | ( | const int64_t | from | ) |
Attempts to populate the Date instance based on the contents of a supplied Julian Day Number
Returns whether the conversion was successful.
| Integer | to convert from |
Definition at line 1069 of file temporal.cc.
|
virtual |
Attempts to populate the Date instance based on the contents of a supplied string.
Returns whether the conversion was successful.
| String | to convert from |
| Length | of supplied string (not including trailing '\0'). |
Reimplemented in drizzled::DateTime.
Definition at line 109 of file temporal.cc.
|
virtual |
Attempts to populate the Date instance based on the contents of a supplied time_t
Returns whether the conversion was successful.
| time_t | to convert from |
Reimplemented in drizzled::DateTime.
Definition at line 1210 of file temporal.cc.
|
virtual |
Attempts to populate the Date instance based on the contents of a supplied pointer to struct tm (broken time).
Returns whether the conversion was successful.
| Pointe | rto the struct tm to convert from |
Definition at line 1166 of file temporal.cc.
|
virtual |
Reimplemented in drizzled::DateTime.
Definition at line 1156 of file temporal.cc.
|
virtual |
Returns whether the temporal value is valid date.
Implements drizzled::Temporal.
Reimplemented in drizzled::DateTime, drizzled::MicroTimestamp, drizzled::NanoTimestamp, and drizzled::Timestamp.
Definition at line 1315 of file temporal.cc.
|
inlinevirtual |
Returns whether the temporal value is valid as a date.
Implements drizzled::Temporal.
Definition at line 280 of file temporal.h.
|
inlinevirtual |
Returns whether the temporal value is valid as a datetime.
Implements drizzled::Temporal.
Definition at line 281 of file temporal.h.
|
inlinevirtual |
Returns whether the temporal value is valid as a time.
Implements drizzled::Temporal.
Definition at line 282 of file temporal.h.
|
inlinevirtual |
Returns whether the temporal value is valid as a UNIX timestamp.
Implements drizzled::Temporal.
Reimplemented in drizzled::Timestamp.
Definition at line 283 of file temporal.h.
|
virtual |
Definition at line 268 of file temporal.cc.
|
virtual |
Definition at line 311 of file temporal.cc.
|
virtual |
Definition at line 775 of file temporal.cc.
| const Date drizzled::Date::operator+ | ( | const Date & | rhs | ) |
@TODO Need an exception check here for bounds of JDN...
Definition at line 528 of file temporal.cc.
| const Date drizzled::Date::operator+ | ( | const DateTime & | rhs | ) |
@TODO Need an exception check here for bounds of JDN...
Definition at line 632 of file temporal.cc.
| const Date drizzled::Date::operator+ | ( | const Time & | rhs | ) |
Definition at line 394 of file temporal.cc.
| Date & drizzled::Date::operator+= | ( | const Date & | rhs | ) |
@TODO Need an exception check here for bounds of JDN...
Definition at line 556 of file temporal.cc.
| Date & drizzled::Date::operator+= | ( | const DateTime & | rhs | ) |
@TODO Need an exception check here for bounds of JDN...
Definition at line 722 of file temporal.cc.
| Date & drizzled::Date::operator+= | ( | const Time & | rhs | ) |
@TODO Once exceptions are supported, we should raise an error here if the result Time is not valid?
Definition at line 441 of file temporal.cc.
| const Date drizzled::Date::operator- | ( | const Date & | rhs | ) |
Operator overload for adding/subtracting another Date (or subclass) to/from this temporal. When subtracting or adding two Dates, we return a new Date instance.
| Date | instance to add/subtract to/from |
We can add/subtract two Dates to/from each other. The result is always another Date instance.
Definition at line 516 of file temporal.cc.
| const Date drizzled::Date::operator- | ( | const DateTime & | rhs | ) |
Operator overload for adding/subtracting a DateTime (or subclass) to/from this temporal. When subtracting or adding two Dates, we return a new Date instance.
| DateTime | instance to add/subtract to/from |
We can add/subtract two DateTimes to/from each other. The result is always another DateTime instance.
Definition at line 588 of file temporal.cc.
| const Date drizzled::Date::operator- | ( | const Time & | rhs | ) |
| Date & drizzled::Date::operator-= | ( | const Date & | rhs | ) |
Definition at line 546 of file temporal.cc.
| Date & drizzled::Date::operator-= | ( | const DateTime & | rhs | ) |
Definition at line 679 of file temporal.cc.
| Date & drizzled::Date::operator-= | ( | const Time & | rhs | ) |
@TODO Once exceptions are supported, we should raise an error here if the result Time is not valid?
Definition at line 474 of file temporal.cc.
|
virtual |
Definition at line 272 of file temporal.cc.
|
virtual |
Definition at line 315 of file temporal.cc.
|
virtual |
Definition at line 779 of file temporal.cc.
|
virtual |
Definition at line 278 of file temporal.cc.
|
virtual |
Definition at line 326 of file temporal.cc.
|
virtual |
Definition at line 793 of file temporal.cc.
| Date & drizzled::Date::operator= | ( | const DateTime & | rhs | ) |
|
virtual |
Comparison operator overloads to compare a Date against another Date value.
| Date | to compare against. |
Reimplemented in drizzled::Timestamp.
Definition at line 260 of file temporal.cc.
|
virtual |
Comparison operator overloads to compare a Date against a DateTime value.
| DateTime | to compare against. |
Reimplemented in drizzled::Timestamp.
Definition at line 298 of file temporal.cc.
|
virtual |
Comparison operator overloads to compare this against a Timestamp value.
| Timestamp | to compare against. |
Reimplemented in drizzled::Timestamp.
Definition at line 771 of file temporal.cc.
|
virtual |
Definition at line 284 of file temporal.cc.
|
virtual |
Definition at line 337 of file temporal.cc.
|
virtual |
Definition at line 797 of file temporal.cc.
|
virtual |
Definition at line 288 of file temporal.cc.
|
virtual |
Definition at line 341 of file temporal.cc.
|
virtual |
Definition at line 801 of file temporal.cc.
|
virtual |
Fills a supplied type::Decimal with a representation of the Date value.
| Pointer | to the type::Decimal to fill |
Reimplemented in drizzled::DateTime.
Definition at line 996 of file temporal.cc.
|
virtual |
Fills a supplied 4-byte integer pointer with an integer representation of the Date value.
| Integer | to fill. |
Reimplemented in drizzled::DateTime.
Definition at line 1019 of file temporal.cc.
|
virtual |
Fills a supplied 8-byte integer pointer with an integer representation of the Date value.
| Integer | to fill. |
Reimplemented in drizzled::DateTime.
Definition at line 1014 of file temporal.cc.
| void drizzled::Date::to_julian_day_number | ( | int64_t * | to | ) | const |
Fills a supplied int64_t with the Julian Day Number representation of this Date.
Julian Day Number is the monotonically increasing number of days from the start of the Julian calendar (~4713 B.C.)
julian day is the ordinal day number of a day in a year.
| int64_t | to fill |
Definition at line 1075 of file temporal.cc.
|
virtual |
Fills a supplied char string with a string representation of the Date value.
| C-String | to fill. |
| Length | of to C-String |
Reimplemented in drizzled::DateTime, and drizzled::MicroTimestamp.
Definition at line 956 of file temporal.cc.
|
virtual |
Attempts to convert the Date value into a supplied time_t.
| Pointer | to a time_t to convert to |
Reimplemented in drizzled::Timestamp.
Definition at line 1286 of file temporal.cc.
|
virtual |
Fills a supplied tm pointer with an representation of the Date value.
| tm | to fill. |
Reimplemented in drizzled::DateTime.
Definition at line 1049 of file temporal.cc.
|
friend |
Definition at line 427 of file temporal.h.
|
friend |
Definition at line 428 of file temporal.h.
|
static |
Maximum length of C-String needed to represent type (including '\0').
Definition at line 310 of file temporal.h.