Public Member Functions | |
TemporalFormat (const char *pattern) | |
bool | is_valid () const |
void | set_year_part_index (int32_t index) |
void | set_month_part_index (int32_t index) |
void | set_day_part_index (int32_t index) |
void | set_hour_part_index (int32_t index) |
void | set_minute_part_index (int32_t index) |
void | set_second_part_index (int32_t index) |
void | set_usecond_part_index (int32_t index) |
void | set_nsecond_part_index (int32_t index) |
bool | matches (const char *data, size_t data_len, Temporal *to) |
Protected Attributes | |
const char * | _pattern |
pcre * | _re |
int32_t | _error_offset |
const char * | _error |
uint32_t | _year_part_index |
uint32_t | _month_part_index |
uint32_t | _day_part_index |
uint32_t | _hour_part_index |
uint32_t | _minute_part_index |
uint32_t | _second_part_index |
uint32_t | _usecond_part_index |
uint32_t | _nsecond_part_index |
Definition at line 42 of file temporal_format.h.
drizzled::TemporalFormat::TemporalFormat | ( | const char * | pattern | ) |
Constructor which takes a regex string as it's only parameter.
Pattern | to use in matching |
Definition at line 47 of file temporal_format.cc.
References _error_offset, and _re.
|
inline |
Returns whether the instance is compiled and contains a valid regular expression.
Definition at line 73 of file temporal_format.h.
References _re.
Referenced by matches().
bool drizzled::TemporalFormat::matches | ( | const char * | data, |
size_t | data_len, | ||
Temporal * | to | ||
) |
Returns true or false whether a supplied string matches the internal pattern for this temporal format string.
Subject | to match |
Length | of subject string |
< Stores match substring indexes
Definition at line 74 of file temporal_format.cc.
References _re, and is_valid().
Referenced by drizzled::Date::from_string(), drizzled::Time::from_string(), and drizzled::DateTime::from_string().
|
inline |
Sets the index for the day part of the pattern.
index | of the temporal part |
Definition at line 91 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the hour part of the pattern.
index | of the temporal part |
Definition at line 97 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the minute part of the pattern.
index | of the temporal part |
Definition at line 103 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the month part of the pattern.
index | of the temporal part |
Definition at line 85 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the nanosecond part of the pattern.
index | of the temporal part |
Definition at line 121 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the second part of the pattern.
index | of the temporal part |
Definition at line 109 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the microsecond part of the pattern.
index | of the temporal part |
Definition at line 115 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
inline |
Sets the index for the year part of the pattern.
index | of the temporal part |
Definition at line 79 of file temporal_format.h.
Referenced by drizzled::init_temporal_formats().
|
protected |
Any error encountered during compilation or matching
Definition at line 47 of file temporal_format.h.
Referenced by TemporalFormat().
|
protected |
The regular expression string to match
Definition at line 45 of file temporal_format.h.
|
protected |
The compiled regular expression struct
Definition at line 46 of file temporal_format.h.
Referenced by is_valid(), matches(), and TemporalFormat().