Drizzled Public API Documentation

drizzled::TemporalFormat Class Reference

List of all members.

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

Detailed Description

Definition at line 44 of file temporal_format.h.


Constructor & Destructor Documentation

drizzled::TemporalFormat::TemporalFormat ( const char *  pattern)

Constructor which takes a regex string as it's only parameter.

Parameters:
Patternto use in matching

Definition at line 47 of file temporal_format.cc.

References _error_offset, and _re.


Member Function Documentation

bool drizzled::TemporalFormat::is_valid ( ) const [inline]

Returns whether the instance is compiled and contains a valid regular expression.

Definition at line 72 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.

Parameters:
Subjectto match
Lengthof subject string

< Stores match substring indexes

Definition at line 69 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().

void drizzled::TemporalFormat::set_day_part_index ( int32_t  index) [inline]

Sets the index for the day part of the pattern.

Parameters:
indexof the temporal part

Definition at line 90 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_hour_part_index ( int32_t  index) [inline]

Sets the index for the hour part of the pattern.

Parameters:
indexof the temporal part

Definition at line 96 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_minute_part_index ( int32_t  index) [inline]

Sets the index for the minute part of the pattern.

Parameters:
indexof the temporal part

Definition at line 102 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_month_part_index ( int32_t  index) [inline]

Sets the index for the month part of the pattern.

Parameters:
indexof the temporal part

Definition at line 84 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_nsecond_part_index ( int32_t  index) [inline]

Sets the index for the nanosecond part of the pattern.

Parameters:
indexof the temporal part

Definition at line 120 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_second_part_index ( int32_t  index) [inline]

Sets the index for the second part of the pattern.

Parameters:
indexof the temporal part

Definition at line 108 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_usecond_part_index ( int32_t  index) [inline]

Sets the index for the microsecond part of the pattern.

Parameters:
indexof the temporal part

Definition at line 114 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().

void drizzled::TemporalFormat::set_year_part_index ( int32_t  index) [inline]

Sets the index for the year part of the pattern.

Parameters:
indexof the temporal part

Definition at line 78 of file temporal_format.h.

Referenced by drizzled::init_temporal_formats().


Member Data Documentation

Any error encountered during compilation or matching

Definition at line 49 of file temporal_format.h.

Referenced by TemporalFormat().

const char* drizzled::TemporalFormat::_pattern [protected]

The regular expression string to match

Definition at line 47 of file temporal_format.h.

pcre* drizzled::TemporalFormat::_re [protected]

The compiled regular expression struct

Definition at line 48 of file temporal_format.h.

Referenced by is_valid(), matches(), and TemporalFormat().


The documentation for this class was generated from the following files: