|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <temporal.h>
Public Member Functions | |
| bool | in_unix_epoch () const |
| virtual bool | is_valid () const |
| void | to_int32_t (int32_t *) const |
| bool | from_int32_t (int32_t) |
| virtual int | to_string (char *to, size_t to_len) const |
| bool | from_string (const char *from, size_t from_len) |
| void | to_int64_t (int64_t *to) const |
| bool | from_time_t (const time_t from) |
| bool | from_timeval (struct timeval &_timeval) |
| bool | from_int64_t (const int64_t from, bool convert) |
| bool | from_int64_t (const int64_t from) |
| void | to_tm (struct tm *to) const |
| void | to_decimal (type::Decimal *to) const |
| Public Member Functions inherited from drizzled::Date | |
| 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 |
| void | to_julian_day_number (int64_t *to) const |
| bool | from_julian_day_number (const int64_t from) |
| virtual bool | from_tm (const struct tm *from) |
| virtual void | to_time_t (time_t &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 = 27 |
| Static Public Attributes inherited from drizzled::Date | |
| 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 datetime range, including a time component
Definition at line 570 of file temporal.h.
|
inline |
Definition at line 573 of file temporal.h.
|
inlinevirtual |
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 from drizzled::Date.
Definition at line 589 of file temporal.h.
|
inline |
Definition at line 656 of file temporal.h.
| bool drizzled::DateTime::from_int64_t | ( | const int64_t | from, |
| bool | convert ) |
Attempts to populate the DateTime instance based on the contents of a supplied 8-byte integer.
Returns whether the conversion was successful.
| Integer | to convert from |
| convert | if conversion to canonical representation should be attempted |
We try to intepret the incoming number as a datetime "string". This is pretty much a hack for usability, but keeps us compatible with MySQL.
Definition at line 1106 of file temporal.cc.
|
virtual |
Attempts to populate the DateTime instance based on the contents of a supplied string.
Returns whether the conversion was successful.
| String | to convert from |
| Length | of supplied string |
Reimplemented from drizzled::Date.
Definition at line 122 of file temporal.cc.
|
virtual |
Attempts to populate the DateTime instance based on the contents of a supplied time_t
Returns whether the conversion was successful.
| time_t | to convert from |
Reimplemented from drizzled::Date.
Definition at line 1260 of file temporal.cc.
| bool drizzled::DateTime::from_timeval | ( | struct timeval & | _timeval | ) |
Definition at line 1234 of file temporal.cc.
|
virtual |
Returns whether the DateTime (or subclass) instance is in the Unix Epoch.
Reimplemented from drizzled::Date.
Definition at line 1161 of file temporal.cc.
|
virtual |
Returns whether the temporal value is valid datetime.
Reimplemented from drizzled::Date.
Reimplemented in drizzled::MicroTimestamp, drizzled::NanoTimestamp, and drizzled::Timestamp.
Definition at line 1345 of file temporal.cc.
|
virtual |
Fills a supplied type::Decimal with a representation of the DateTime value.
| Pointer | to the type::Decimal to fill |
Reimplemented from drizzled::Date.
Definition at line 1002 of file temporal.cc.
|
inlinevirtual |
It's not possible to convert to and from a DateTime and a 4-byte integer, so let us know if we try and do it!
Reimplemented from drizzled::Date.
Definition at line 588 of file temporal.h.
|
virtual |
Fills a supplied 8-byte integer pointer with an integer representation of the DateTime value.
| Integer | to fill. |
Reimplemented from drizzled::Date.
Definition at line 1035 of file temporal.cc.
|
virtual |
Fills a supplied char string with a string representation of the DateTime value.
| C-String | to fill |
| Length | of to C-String |
Reimplemented from drizzled::Date.
Reimplemented in drizzled::MicroTimestamp.
Definition at line 961 of file temporal.cc.
|
virtual |
Fills a supplied tm pointer with an representation of the DateTime value.
| tm | to fill. |
Reimplemented from drizzled::Date.
Definition at line 1059 of file temporal.cc.
|
friend |
Definition at line 575 of file temporal.h.
|
friend |
Definition at line 677 of file temporal.h.
|
static |
Maximum length of C-String needed to represent type (including '\0').
Definition at line 608 of file temporal.h.