Stores time interval for date/time manipulation.
More...
#include <temporal_interval.h>
|
| | TemporalInterval (uint32_t in_year, uint32_t in_month, uint32_t in_day, uint32_t in_hour, uint64_t in_minute, uint64_t in_second, uint64_t in_second_part, bool in_neg) |
| void | setNegative (bool in_neg=true) |
| void | toggleNegative () |
| bool | getNegative () const |
| uint32_t | get_year () const |
| void | set_year (uint32_t new_year) |
| uint32_t | get_month () const |
| void | set_month (uint32_t new_month) |
| uint32_t | get_day () const |
| void | set_day (uint32_t new_day) |
| uint32_t | get_hour () const |
| void | set_hour (uint32_t new_hour) |
| uint64_t | get_minute () const |
| void | set_minute (uint32_t new_minute) |
| uint64_t | get_second () const |
| void | set_second (uint32_t new_second) |
| uint64_t | get_second_part () const |
| void | set_second_part (uint32_t new_second_part) |
| bool | initFromItem (Item *args, interval_type int_type, String *str_value) |
| bool | addDate (type::Time *ltime, interval_type int_type) |
Stores time interval for date/time manipulation.
Definition at line 36 of file temporal_interval.h.
◆ TemporalInterval() [1/2]
| drizzled::TemporalInterval::TemporalInterval |
( |
uint32_t | in_year, |
|
|
uint32_t | in_month, |
|
|
uint32_t | in_day, |
|
|
uint32_t | in_hour, |
|
|
uint64_t | in_minute, |
|
|
uint64_t | in_second, |
|
|
uint64_t | in_second_part, |
|
|
bool | in_neg ) |
|
inline |
◆ TemporalInterval() [2/2]
| drizzled::TemporalInterval::TemporalInterval |
( |
| ) |
|
|
inline |
◆ addDate()
| bool drizzled::TemporalInterval::addDate |
( |
type::Time * | ltime, |
|
|
interval_type | int_type ) |
Adds this interval to a DRIZZLE_LTIME structure
- Parameters
-
| [in,out] | ltime | the interval will be added to ltime directly in the ltime structure |
| [in] | int_type | the type of interval requested |
- Return values
-
| true | date was added and value stored properly |
| false | result of addition is a null value |
Definition at line 190 of file temporal_interval.cc.
◆ get_day()
| uint32_t drizzled::TemporalInterval::get_day |
( |
| ) |
const |
|
inline |
◆ get_hour()
| uint32_t drizzled::TemporalInterval::get_hour |
( |
| ) |
const |
|
inline |
◆ get_minute()
| uint64_t drizzled::TemporalInterval::get_minute |
( |
| ) |
const |
|
inline |
◆ get_month()
| uint32_t drizzled::TemporalInterval::get_month |
( |
| ) |
const |
|
inline |
◆ get_second()
| uint64_t drizzled::TemporalInterval::get_second |
( |
| ) |
const |
|
inline |
◆ get_second_part()
| uint64_t drizzled::TemporalInterval::get_second_part |
( |
| ) |
const |
|
inline |
◆ get_year()
| uint32_t drizzled::TemporalInterval::get_year |
( |
| ) |
const |
|
inline |
◆ getIntervalFromString()
| bool drizzled::TemporalInterval::getIntervalFromString |
( |
const char * | str, |
|
|
uint32_t | length, |
|
|
const charset_info_st *const | cs, |
|
|
uint32_t | count, |
|
|
uint64_t * | values, |
|
|
bool | transform_msec ) |
|
private |
Get a array of positive numbers from a string object. Each number is separated by 1 non digit character Return error if there is too many numbers. If there is too few numbers, assume that the numbers are left out from the high end. This allows one to give: DAY_TO_SECOND as "D MM:HH:SS", "MM:HH:SS" "HH:SS" or as seconds.
- Parameters
-
| [in] | length | length of str |
| [in] | cs | charset of str |
| [out] | values | array of results |
| [out] | count | count of elements in result array |
| transform_msec | if value is true we suppose that the last part of string value is microseconds and we should transform value to six digit value. For example, '1.1' -> '1.100000' |
Definition at line 296 of file temporal_interval.cc.
◆ getNegative()
| bool drizzled::TemporalInterval::getNegative |
( |
| ) |
const |
|
inline |
- Return values
-
| true | this is a negative temporal interval |
| false | this is a positive temporal interval |
Definition at line 90 of file temporal_interval.h.
◆ initFromItem()
| bool drizzled::TemporalInterval::initFromItem |
( |
Item * | args, |
|
|
interval_type | int_type, |
|
|
String * | str_value ) |
Populate this TemporalInterval from a string value
To make code easy, allow interval objects without separators.
- Parameters
-
| args | argument Item structure |
| int_type | type of interval to create |
| str_value | String pointer to the input value |
- Returns
- true if the string would result in a null interval
Definition at line 33 of file temporal_interval.cc.
◆ set_day()
| void drizzled::TemporalInterval::set_day |
( |
uint32_t | new_day | ) |
|
|
inline |
◆ set_hour()
| void drizzled::TemporalInterval::set_hour |
( |
uint32_t | new_hour | ) |
|
|
inline |
◆ set_minute()
| void drizzled::TemporalInterval::set_minute |
( |
uint32_t | new_minute | ) |
|
|
inline |
◆ set_month()
| void drizzled::TemporalInterval::set_month |
( |
uint32_t | new_month | ) |
|
|
inline |
◆ set_second()
| void drizzled::TemporalInterval::set_second |
( |
uint32_t | new_second | ) |
|
|
inline |
◆ set_second_part()
| void drizzled::TemporalInterval::set_second_part |
( |
uint32_t | new_second_part | ) |
|
|
inline |
◆ set_year()
| void drizzled::TemporalInterval::set_year |
( |
uint32_t | new_year | ) |
|
|
inline |
◆ setNegative()
| void drizzled::TemporalInterval::setNegative |
( |
bool | in_neg = true | ) |
|
|
inline |
Sets whether or not this object specifies a negative interval
- Parameters
-
| [in] | in_neg | true if this is a negative interval, false if not |
Definition at line 73 of file temporal_interval.h.
◆ toggleNegative()
| void drizzled::TemporalInterval::toggleNegative |
( |
| ) |
|
|
inline |
◆ day
| uint32_t drizzled::TemporalInterval::day |
|
private |
◆ hour
| uint32_t drizzled::TemporalInterval::hour |
|
private |
◆ MAX_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::MAX_STRING_ELEMENTS = 5 |
|
staticprivate |
The maximum number of text elements to extract into a temporal interval
Definition at line 144 of file temporal_interval.h.
◆ minute
| uint64_t drizzled::TemporalInterval::minute |
|
private |
◆ month
| uint32_t drizzled::TemporalInterval::month |
|
private |
◆ neg
| bool drizzled::TemporalInterval::neg |
|
private |
◆ NUM_DAY_HOUR_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_DAY_HOUR_STRING_ELEMENTS = 2 |
|
staticprivate |
◆ NUM_DAY_MICROSECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_DAY_MICROSECOND_STRING_ELEMENTS = 5 |
|
staticprivate |
◆ NUM_DAY_MINUTE_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_DAY_MINUTE_STRING_ELEMENTS = 3 |
|
staticprivate |
◆ NUM_DAY_SECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_DAY_SECOND_STRING_ELEMENTS = 4 |
|
staticprivate |
◆ NUM_HOUR_MICROSECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_HOUR_MICROSECOND_STRING_ELEMENTS = 4 |
|
staticprivate |
◆ NUM_HOUR_MINUTE_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_HOUR_MINUTE_STRING_ELEMENTS = 2 |
|
staticprivate |
◆ NUM_HOUR_SECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_HOUR_SECOND_STRING_ELEMENTS = 3 |
|
staticprivate |
◆ NUM_MINUTE_MICROSECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_MINUTE_MICROSECOND_STRING_ELEMENTS = 3 |
|
staticprivate |
◆ NUM_MINUTE_SECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_MINUTE_SECOND_STRING_ELEMENTS = 2 |
|
staticprivate |
◆ NUM_SECOND_MICROSECOND_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_SECOND_MICROSECOND_STRING_ELEMENTS = 2 |
|
staticprivate |
◆ NUM_YEAR_MONTH_STRING_ELEMENTS
| const uint32_t drizzled::TemporalInterval::NUM_YEAR_MONTH_STRING_ELEMENTS = 2 |
|
staticprivate |
◆ second
| uint64_t drizzled::TemporalInterval::second |
|
private |
◆ second_part
| uint64_t drizzled::TemporalInterval::second_part |
|
private |
◆ year
| uint32_t drizzled::TemporalInterval::year |
|
private |
The documentation for this class was generated from the following files: