MySQL 8.0.29
Source Code Documentation
MYSQL_TIME_cache Class Reference

Cache for MYSQL_TIME value with various representations. More...

#include <item_timefunc.h>

Public Member Functions

 MYSQL_TIME_cache ()
 
void set_date (MYSQL_TIME *ltime)
 Set time and time_packed from a DATE value. More...
 
void set_time (MYSQL_TIME *ltime, uint8 dec_arg)
 Set time and time_packed from a TIME value. More...
 
void set_datetime (MYSQL_TIME *ltime, uint8 dec_arg, const Time_zone *tz=nullptr)
 Set time and time_packed from a DATETIME value. More...
 
void set_date (my_timeval tv, Time_zone *tz)
 Set time and time_packed according to DATE value in "struct timeval" representation and its time zone. More...
 
void set_time (my_timeval tv, uint8 dec_arg, Time_zone *tz)
 Set time and time_packed according to TIME value in "struct timeval" representation and its time zone. More...
 
void set_datetime (my_timeval tv, uint8 dec_arg, Time_zone *tz)
 Set time and time_packed according to DATETIME value in "struct timeval" representation and its time zone. More...
 
bool eq (const MYSQL_TIME_cache &tm) const
 Test if cached value is equal to another MYSQL_TIME_cache value. More...
 
uint8 decimals () const
 Return number of decimal digits. More...
 
longlong val_packed () const
 Return packed representation. More...
 
bool get_date (MYSQL_TIME *ltime, uint fuzzyflags) const
 Store MYSQL_TIME representation into the given date/datetime variable checking date flags. More...
 
bool get_time (MYSQL_TIME *ltime) const
 Store MYSQL_TIME representation into the given time variable. More...
 
MYSQL_TIMEget_TIME_ptr ()
 Return pointer to MYSQL_TIME representation. More...
 
Stringval_str (String *str)
 Store string representation into String. More...
 
const char * cptr () const
 Return C string representation. More...
 

Private Member Functions

void get_TIME (MYSQL_TIME *ltime) const
 Store MYSQL_TIME representation into the given MYSQL_TIME variable. More...
 

Private Attributes

MYSQL_TIME time
 MYSQL_TIME representation. More...
 
longlong time_packed
 packed representation More...
 
char string_buff [MAX_DATE_STRING_REP_LENGTH]
 string representation More...
 
uint string_length
 length of string More...
 
uint8 dec
 Number of decimals. More...
 

Detailed Description

Cache for MYSQL_TIME value with various representations.

  • MYSQL_TIME representation (time) is initialized during set_XXX().
  • Packed representation (time_packed) is also initialized during set_XXX().
  • String representation (string_buff) is also initialized during set_XXX();

Constructor & Destructor Documentation

◆ MYSQL_TIME_cache()

MYSQL_TIME_cache::MYSQL_TIME_cache ( )
inline

Member Function Documentation

◆ cptr()

const char * MYSQL_TIME_cache::cptr ( ) const
inline

Return C string representation.

◆ decimals()

uint8 MYSQL_TIME_cache::decimals ( ) const
inline

Return number of decimal digits.

◆ eq()

bool MYSQL_TIME_cache::eq ( const MYSQL_TIME_cache tm) const
inline

Test if cached value is equal to another MYSQL_TIME_cache value.

◆ get_date()

bool MYSQL_TIME_cache::get_date ( MYSQL_TIME ltime,
uint  fuzzyflags 
) const

Store MYSQL_TIME representation into the given date/datetime variable checking date flags.

◆ get_TIME()

void MYSQL_TIME_cache::get_TIME ( MYSQL_TIME ltime) const
inlineprivate

Store MYSQL_TIME representation into the given MYSQL_TIME variable.

◆ get_time()

bool MYSQL_TIME_cache::get_time ( MYSQL_TIME ltime) const
inline

Store MYSQL_TIME representation into the given time variable.

◆ get_TIME_ptr()

MYSQL_TIME * MYSQL_TIME_cache::get_TIME_ptr ( )
inline

Return pointer to MYSQL_TIME representation.

◆ set_date() [1/2]

void MYSQL_TIME_cache::set_date ( my_timeval  tv,
Time_zone tz 
)

Set time and time_packed according to DATE value in "struct timeval" representation and its time zone.

◆ set_date() [2/2]

void MYSQL_TIME_cache::set_date ( MYSQL_TIME ltime)

Set time and time_packed from a DATE value.

◆ set_datetime() [1/2]

void MYSQL_TIME_cache::set_datetime ( my_timeval  tv,
uint8  dec_arg,
Time_zone tz 
)

Set time and time_packed according to DATETIME value in "struct timeval" representation and its time zone.

◆ set_datetime() [2/2]

void MYSQL_TIME_cache::set_datetime ( MYSQL_TIME ltime,
uint8  dec_arg,
const Time_zone tz = nullptr 
)

Set time and time_packed from a DATETIME value.

◆ set_time() [1/2]

void MYSQL_TIME_cache::set_time ( my_timeval  tv,
uint8  dec_arg,
Time_zone tz 
)

Set time and time_packed according to TIME value in "struct timeval" representation and its time zone.

◆ set_time() [2/2]

void MYSQL_TIME_cache::set_time ( MYSQL_TIME ltime,
uint8  dec_arg 
)

Set time and time_packed from a TIME value.

◆ val_packed()

longlong MYSQL_TIME_cache::val_packed ( ) const
inline

Return packed representation.

◆ val_str()

String * MYSQL_TIME_cache::val_str ( String str)

Store string representation into String.

Member Data Documentation

◆ dec

uint8 MYSQL_TIME_cache::dec
private

Number of decimals.

◆ string_buff

char MYSQL_TIME_cache::string_buff[MAX_DATE_STRING_REP_LENGTH]
private

string representation

◆ string_length

uint MYSQL_TIME_cache::string_length
private

length of string

◆ time

MYSQL_TIME MYSQL_TIME_cache::time
private

MYSQL_TIME representation.

◆ time_packed

longlong MYSQL_TIME_cache::time_packed
private

packed representation


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