drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::type::Time Class Reference

Public Member Functions

 Time (uint32_t year_arg, uint32_t month_arg, uint32_t day_arg, uint32_t hour_arg, uint32_t minute_arg, uint32_t second_arg, usec_t second_part_arg, timestamp_t type_arg)
 Time (uint32_t hour_arg, uint32_t minute_arg, uint32_t second_arg, usec_t second_part_arg, bool neg_arg)
void reset ()
timestamp_t type () const
void convert (drizzled::String &str, timestamp_t arg=type::DRIZZLE_TIMESTAMP_DATETIME)
void convert (char *str, size_t &to_length, timestamp_t arg=type::DRIZZLE_TIMESTAMP_DATETIME)
void convert (datetime_t &datetime, timestamp_t arg=type::DRIZZLE_TIMESTAMP_DATETIME)
void convert (datetime_t &ret, int64_t nr, uint32_t flags)
void convert (datetime_t &ret, int64_t nr, uint32_t flags, type::cut_t &was_cut)
void convert (type::epoch_t &epoch, long *my_timezone) const
void truncate (const timestamp_t arg)
bool store (const char *str, uint32_t length, int &warning, type::timestamp_t arg=DRIZZLE_TIMESTAMP_TIME)
type::timestamp_t store (const char *str, uint32_t length, uint32_t flags, type::cut_t &was_cut)
type::timestamp_t store (const char *str, uint32_t length, uint32_t flags)
void store (type::epoch_t from)
void store (type::epoch_t from, usec_t from_fractional_seconds)
void store (const tm &)
void store (const timeval &)
bool check (bool not_zero_date, uint32_t flags, type::cut_t &was_cut) const
 Check datetime value for validity according to flags.
bool isValidEpoch () const

Public Attributes

uint32_t year
uint32_t month
uint32_t day
uint32_t hour
uint32_t minute
uint32_t second
usec_t second_part
bool neg
timestamp_t time_type

Static Public Attributes

static const uint32_t FRACTIONAL_DIGITS = 1000000
static const size_t MAX_STRING_LENGTH = 32

Detailed Description

Definition at line 98 of file type/time.h.

Constructor & Destructor Documentation

◆ Time() [1/3]

drizzled::type::Time::Time ( )
inline

Definition at line 101 of file type/time.h.

◆ Time() [2/3]

drizzled::type::Time::Time ( uint32_t year_arg,
uint32_t month_arg,
uint32_t day_arg,
uint32_t hour_arg,
uint32_t minute_arg,
uint32_t second_arg,
usec_t second_part_arg,
timestamp_t type_arg )
inline

Definition at line 106 of file type/time.h.

◆ Time() [3/3]

drizzled::type::Time::Time ( uint32_t hour_arg,
uint32_t minute_arg,
uint32_t second_arg,
usec_t second_part_arg,
bool neg_arg )
inline

Definition at line 126 of file type/time.h.

Member Function Documentation

◆ check()

bool drizzled::type::Time::check ( bool not_zero_date,
uint32_t flags,
type::cut_t & was_cut ) const

Check datetime value for validity according to flags.

Parameters
[in]ltimeDate to check.
[in]not_zero_dateltime is not the zero date
[in]flagsflags to check (see store() flags in drizzle_time.h)
[out]was_cutset to 2 if value was invalid according to flags. (Feb 29 in non-leap etc.) This remains unchanged if value is not invalid.

Here we assume that year and month is ok! If month is 0 we allow any date. (This only happens if we allow zero date parts in store()) Disallow dates with zero year and non-zero month and/or day.

Returns
0 OK 1 error

Definition at line 97 of file type/time.cc.

◆ convert() [1/6]

void drizzled::type::Time::convert ( char * str,
size_t & to_length,
timestamp_t arg = type::DRIZZLE_TIMESTAMP_DATETIME )

Definition at line 1071 of file type/time.cc.

◆ convert() [2/6]

void drizzled::type::Time::convert ( datetime_t & datetime,
timestamp_t arg = type::DRIZZLE_TIMESTAMP_DATETIME )

Definition at line 1249 of file type/time.cc.

◆ convert() [3/6]

void drizzled::type::Time::convert ( datetime_t & ret,
int64_t nr,
uint32_t flags )

Definition at line 1231 of file type/time.cc.

◆ convert() [4/6]

void drizzled::type::Time::convert ( datetime_t & ret,
int64_t nr,
uint32_t flags,
type::cut_t & was_cut )

Definition at line 1237 of file type/time.cc.

◆ convert() [5/6]

void drizzled::type::Time::convert ( drizzled::String & str,
timestamp_t arg = type::DRIZZLE_TIMESTAMP_DATETIME )

Definition at line 1060 of file type/time.cc.

◆ convert() [6/6]

void drizzled::type::Time::convert ( type::epoch_t & epoch,
long * my_timezone ) const

Definition at line 841 of file type/time.cc.

◆ isValidEpoch()

bool drizzled::type::Time::isValidEpoch ( ) const
inline

Definition at line 183 of file type/time.h.

◆ reset()

void drizzled::type::Time::reset ( )
inline

Definition at line 148 of file type/time.h.

◆ store() [1/5]

bool drizzled::type::Time::store ( const char * str,
uint32_t length,
int & warning,
type::timestamp_t arg = DRIZZLE_TIMESTAMP_TIME )

Definition at line 495 of file type/time.cc.

◆ store() [2/5]

type::timestamp_t drizzled::type::Time::store ( const char * str,
uint32_t length,
uint32_t flags )

Definition at line 464 of file type/time.cc.

◆ store() [3/5]

type::timestamp_t drizzled::type::Time::store ( const char * str,
uint32_t length,
uint32_t flags,
type::cut_t & was_cut )

Definition at line 176 of file type/time.cc.

◆ store() [4/5]

void drizzled::type::Time::store ( type::epoch_t from)

Definition at line 1035 of file type/time.cc.

◆ store() [5/5]

void drizzled::type::Time::store ( type::epoch_t from,
usec_t from_fractional_seconds )

Definition at line 1040 of file type/time.cc.

◆ truncate()

void drizzled::type::Time::truncate ( const timestamp_t arg)

Definition at line 1052 of file type/time.cc.

◆ type()

timestamp_t drizzled::type::Time::type ( ) const
inline

Definition at line 155 of file type/time.h.

Member Data Documentation

◆ day

uint32_t drizzled::type::Time::day

Definition at line 143 of file type/time.h.

◆ FRACTIONAL_DIGITS

const uint32_t drizzled::type::Time::FRACTIONAL_DIGITS = 1000000
static

Definition at line 178 of file type/time.h.

◆ hour

uint32_t drizzled::type::Time::hour

Definition at line 143 of file type/time.h.

◆ MAX_STRING_LENGTH

const size_t drizzled::type::Time::MAX_STRING_LENGTH = 32
static

Definition at line 179 of file type/time.h.

◆ minute

uint32_t drizzled::type::Time::minute

Definition at line 143 of file type/time.h.

◆ month

uint32_t drizzled::type::Time::month

Definition at line 143 of file type/time.h.

◆ neg

bool drizzled::type::Time::neg

Definition at line 145 of file type/time.h.

◆ second

uint32_t drizzled::type::Time::second

Definition at line 143 of file type/time.h.

◆ second_part

usec_t drizzled::type::Time::second_part

Definition at line 144 of file type/time.h.

◆ time_type

timestamp_t drizzled::type::Time::time_type

Definition at line 146 of file type/time.h.

◆ year

uint32_t drizzled::type::Time::year

Definition at line 143 of file type/time.h.


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