|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <temporal.h>
Public Member Functions | |
| bool | operator== (const Time &rhs) |
| bool | operator!= (const Time &rhs) |
| bool | operator> (const Time &rhs) |
| bool | operator>= (const Time &rhs) |
| bool | operator< (const Time &rhs) |
| bool | operator<= (const Time &rhs) |
| const Time | operator- (const Time &rhs) |
| const Time | operator+ (const Time &rhs) |
| Time & | operator-= (const Time &rhs) |
| Time & | operator+= (const Time &rhs) |
| bool | is_valid_date () const |
| bool | is_valid_datetime () const |
| bool | is_valid_time () const |
| bool | is_valid_timestamp () const |
| bool | is_valid () const |
| bool | is_fuzzy_valid () const |
| int | to_string (char *to, size_t to_len) const |
| bool | from_string (const char *from, size_t from_len) |
| void | to_int32_t (int32_t *to) const |
| void | to_uint64_t (uint64_t &to) const |
| bool | from_int32_t (const int32_t from) |
| bool | from_time_t (const time_t from) |
| 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 uint32_t | MAX_CUMULATIVE_SECONDS = 86400L |
| static const int | MAX_STRING_LENGTH = 9 |
Friends | |
| class | Date |
| class | DateTime |
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 having only a time component, with no date structure
Definition at line 438 of file temporal.h.
|
inline |
Definition at line 441 of file temporal.h.
| bool drizzled::Time::from_int32_t | ( | const int32_t | from | ) |
Attempts to populate the Time instance based on the contents of a supplied 4-byte integer.
Returns whether the conversion was successful.
| Integer | to convert from |
Attempt to interpret the supplied 4-byte integer as a TIME value in the format HHmmSS
Definition at line 1092 of file temporal.cc.
| bool drizzled::Time::from_string | ( | const char * | from, |
| size_t | from_len ) |
Attempts to populate the Time instance based on the contents of a supplied string.
Returns whether the conversion was successful.
| String | to convert from |
| Length | of supplied string |
Definition at line 940 of file temporal.cc.
| bool drizzled::Time::from_time_t | ( | const time_t | from | ) |
Attempts to populate the Time instance based on the contents of a supplied time_t
Returns whether the conversion was successful.
We can only convert from a time_t, not back to a time_t since it would be a lossy conversion.
| time_t | to convert from |
Definition at line 1186 of file temporal.cc.
| bool drizzled::Time::is_fuzzy_valid | ( | ) | const |
Definition at line 1332 of file temporal.cc.
|
virtual |
Returns whether the temporal value is valid date.
Implements drizzled::Temporal.
Definition at line 1322 of file temporal.cc.
|
inlinevirtual |
Returns whether the temporal value is valid as a date.
Implements drizzled::Temporal.
Definition at line 468 of file temporal.h.
|
inlinevirtual |
Returns whether the temporal value is valid as a datetime.
Implements drizzled::Temporal.
Definition at line 469 of file temporal.h.
|
inlinevirtual |
Returns whether the temporal value is valid as a time.
Implements drizzled::Temporal.
Definition at line 470 of file temporal.h.
|
inlinevirtual |
Returns whether the temporal value is valid as a UNIX timestamp.
Implements drizzled::Temporal.
Definition at line 471 of file temporal.h.
| bool drizzled::Time::operator!= | ( | const Time & | rhs | ) |
Definition at line 150 of file temporal.cc.
| const Time drizzled::Time::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 206 of file temporal.cc.
| Time & drizzled::Time::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 226 of file temporal.cc.
| const Time drizzled::Time::operator- | ( | const Time & | rhs | ) |
Operator to add/subtract a Time from a Time. We can return a Time new temporal instance.
| Temporal | instance to add/subtract to/from |
Subtracting one Time value from another can yield a new Time instance.
This operator is called in the following situation:
Subtracting a larger time value from a smaller one should throw an exception at some point. The result of such an operator should be a TemporalInterval, not a Time instance, since a negative time is not possible.
Definition at line 193 of file temporal.cc.
| Time & drizzled::Time::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 240 of file temporal.cc.
| bool drizzled::Time::operator< | ( | const Time & | rhs | ) |
Definition at line 154 of file temporal.cc.
| bool drizzled::Time::operator<= | ( | const Time & | rhs | ) |
Definition at line 158 of file temporal.cc.
| bool drizzled::Time::operator== | ( | const Time & | rhs | ) |
Comparison operator overloads to compare a Time against another Time value.
| Time | to compare against. |
Definition at line 140 of file temporal.cc.
| bool drizzled::Time::operator> | ( | const Time & | rhs | ) |
Definition at line 162 of file temporal.cc.
| bool drizzled::Time::operator>= | ( | const Time & | rhs | ) |
Definition at line 166 of file temporal.cc.
| void drizzled::Time::to_decimal | ( | type::Decimal * | to | ) | const |
Fills a supplied type::Decimal with a representation of the Time value.
| Pointer | to the type::Decimal to fill |
Definition at line 985 of file temporal.cc.
| void drizzled::Time::to_int32_t | ( | int32_t * | to | ) | const |
Fills a supplied 4-byte integer pointer with an integer representation of the Time value.
| Integer | to fill. |
Definition at line 1024 of file temporal.cc.
| int drizzled::Time::to_string | ( | char * | to, |
| size_t | to_len ) const |
Fills a supplied char string with a string representation of the Time value.
| C-String | to fill |
| Length | of to C-String |
Definition at line 951 of file temporal.cc.
| void drizzled::Time::to_uint64_t | ( | uint64_t & | to | ) | const |
Fills a supplied 8-byte integer pointer with an integer representation of the Time value. It is assume seconds past unix epoch
| Integer | to fill. |
Definition at line 1030 of file temporal.cc.
|
friend |
Definition at line 562 of file temporal.h.
|
friend |
Definition at line 563 of file temporal.h.
|
static |
Definition at line 443 of file temporal.h.
|
static |
Maximum length of C-String needed to represent type (including '\0').
Definition at line 494 of file temporal.h.