MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
shcore::polyglot::Date Class Reference

#include <polyglot_date.h>

Inheritance diagram for shcore::polyglot::Date:
[legend]

Public Member Functions

 Date (const Date &date)
 
 Date (int year, int month, int day, int hour, int min, int sec, int usec)
 
 Date (int hour, int min, int sec, int usec)
 
 Date (int year, int month, int day)
 
std::string class_name () const override
 
std::string & append_descr (std::string &s_out, int indent=-1, int quote_strings=0) const override
 
std::string & append_repr (std::string &s_out) const override
 
void append_json (shcore::JSON_dumper &dumper) const override
 
virtual bool operator== (const Object_bridge &other) const
 
bool operator== (const Date &other) const
 
int64_t as_ms () const
 
int get_year () const
 
int get_month () const
 
int get_day () const
 
int get_hour () const
 
int get_min () const
 
int get_sec () const
 
int get_usec () const
 
bool has_time () const
 
bool has_date () const
 
- Public Member Functions inherited from shcore::polyglot::Object_bridge
virtual ~Object_bridge ()=default
 
virtual std::vector< std::string > get_members () const
 Returns the list of members that this object has. More...
 
virtual bool has_member (const std::string &prop) const
 Verifies if the object has a member. More...
 
virtual void set_member (const std::string &, Value)
 Sets the value of a member. More...
 
virtual bool is_indexed () const
 Returns the value of a member. More...
 
virtual Value get_member (size_t) const
 Returns the value of a member. More...
 
virtual void set_member (size_t, Value)
 Sets the value of a member. More...
 
virtual size_t length () const
 Returns the number of indexable members. More...
 
bool has_method (const std::string &name) const
 Returns true if a method with the given name exists. More...
 
virtual Value get_member (const std::string &) const
 Returns the value of a member. More...
 
virtual Value call (const std::string &, const Argument_list &)
 Calls the named method with the given args. More...
 

Static Public Member Functions

static Date unrepr (const std::string &s)
 
static Date from_ms (int64_t ms_since_epoch)
 

Private Member Functions

void validate ()
 

Private Attributes

int _year
 
int _month
 
int _day
 
int _hour
 
int _min
 
int _sec
 
int _usec
 
bool _has_time
 
bool _has_date
 

Constructor & Destructor Documentation

◆ Date() [1/4]

shcore::polyglot::Date::Date ( const Date date)

◆ Date() [2/4]

shcore::polyglot::Date::Date ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec,
int  usec 
)

◆ Date() [3/4]

shcore::polyglot::Date::Date ( int  hour,
int  min,
int  sec,
int  usec 
)

◆ Date() [4/4]

shcore::polyglot::Date::Date ( int  year,
int  month,
int  day 
)

Member Function Documentation

◆ append_descr()

std::string & shcore::polyglot::Date::append_descr ( std::string &  s_out,
int  indent = -1,
int  quote_strings = 0 
) const
overridevirtual

Reimplemented from shcore::polyglot::Object_bridge.

◆ append_json()

void shcore::polyglot::Date::append_json ( shcore::JSON_dumper dumper) const
overridevirtual

Reimplemented from shcore::polyglot::Object_bridge.

◆ append_repr()

std::string & shcore::polyglot::Date::append_repr ( std::string &  s_out) const
overridevirtual

Reimplemented from shcore::polyglot::Object_bridge.

◆ as_ms()

int64_t shcore::polyglot::Date::as_ms ( ) const

◆ class_name()

std::string shcore::polyglot::Date::class_name ( ) const
inlineoverridevirtual

◆ from_ms()

Date shcore::polyglot::Date::from_ms ( int64_t  ms_since_epoch)
static

◆ get_day()

int shcore::polyglot::Date::get_day ( ) const
inline

◆ get_hour()

int shcore::polyglot::Date::get_hour ( ) const
inline

◆ get_min()

int shcore::polyglot::Date::get_min ( ) const
inline

◆ get_month()

int shcore::polyglot::Date::get_month ( ) const
inline

◆ get_sec()

int shcore::polyglot::Date::get_sec ( ) const
inline

◆ get_usec()

int shcore::polyglot::Date::get_usec ( ) const
inline

◆ get_year()

int shcore::polyglot::Date::get_year ( ) const
inline

◆ has_date()

bool shcore::polyglot::Date::has_date ( ) const
inline

◆ has_time()

bool shcore::polyglot::Date::has_time ( ) const
inline

◆ operator==() [1/2]

bool shcore::polyglot::Date::operator== ( const Date other) const

◆ operator==() [2/2]

bool shcore::polyglot::Date::operator== ( const Object_bridge other) const
virtual

◆ unrepr()

Date shcore::polyglot::Date::unrepr ( const std::string &  s)
static

◆ validate()

void shcore::polyglot::Date::validate ( )
private

Member Data Documentation

◆ _day

int shcore::polyglot::Date::_day
private

◆ _has_date

bool shcore::polyglot::Date::_has_date
private

◆ _has_time

bool shcore::polyglot::Date::_has_time
private

◆ _hour

int shcore::polyglot::Date::_hour
private

◆ _min

int shcore::polyglot::Date::_min
private

◆ _month

int shcore::polyglot::Date::_month
private

◆ _sec

int shcore::polyglot::Date::_sec
private

◆ _usec

int shcore::polyglot::Date::_usec
private

◆ _year

int shcore::polyglot::Date::_year
private

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