MySQL 9.7.0
Source Code Documentation
Json_date Class Referencefinal

MySQL DATE value. More...

#include <json_dom.h>

Inheritance diagram for Json_date:
[legend]

Public Member Functions

 Json_date (const Date_val date)
 Constructs an object to hold a MySQL date value. More...
 
enum_json_type json_type () const override
 
Json_dom_ptr clone () const override
 Make a deep clone. More...
 
const Date_val value () const
 
enum_field_types field_type () const override
 
void to_packed (char *dest) const
 Convert the DATE value to the packed format used for storage. More...
 
- Public Member Functions inherited from Json_temporal
 Json_temporal ()
 
- Public Member Functions inherited from Json_scalar
uint32 depth () const final
 Compute the depth of a document. More...
 
bool is_scalar () const final
 
- Public Member Functions inherited from Json_dom
virtual ~Json_dom ()=default
 
void * operator new (size_t size, const std::nothrow_t &) noexcept
 Allocate space on the heap for a Json_dom object. More...
 
void operator delete (void *ptr) noexcept
 Deallocate the space used by a Json_dom object. More...
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 Nothrow delete. More...
 
Json_containerparent () const
 Get the parent dom to which this dom is attached. More...
 
virtual bool is_number () const
 
Json_path get_location () const
 Get the path location of this dom, measured from the outermost document it nests inside. More...
 
bool seek (const Json_seekable_path &path, size_t legs, Json_dom_vector *hits, bool auto_wrap, bool only_need_one)
 Finds all of the json sub-documents which match the path expression. More...
 

Static Public Member Functions

static void from_packed (const char *from, Date_val *to)
 Convert a packed date back to a date value. More...
 
static void from_packed_to_key (const char *from, uchar *to)
 Convert a packed date value to key string for indexing by SE. More...
 
- Static Public Member Functions inherited from Json_dom
static Json_dom_ptr parse (const char *text, size_t length, const JsonParseErrorHandler &error_handler, const JsonErrorHandler &depth_handler)
 Parse Json text to DOM (using rapidjson). More...
 
static Json_dom_ptr parse (const json_binary::Value &v)
 Construct a DOM object based on a binary JSON value. More...
 

Private Attributes

Date_val m_date
 Holds the date value. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Json_temporal
static const size_t PACKED_SIZE = 8
 Datetimes are packed in eight bytes. More...
 

Detailed Description

MySQL DATE value.

Constructor & Destructor Documentation

◆ Json_date()

Json_date::Json_date ( const Date_val  date)
inlineexplicit

Constructs an object to hold a MySQL date value.

Parameters
datethe date value

Member Function Documentation

◆ clone()

Json_dom_ptr Json_date::clone ( ) const
overridevirtual

Make a deep clone.

The ownership of the returned object is henceforth with the caller.

Returns
a cloned Json_dom object.

Implements Json_dom.

◆ field_type()

enum_field_types Json_date::field_type ( ) const
inlineoverridevirtual
Returns
kind of temporal value this object holds: MYSQL_TYPE_DATE

Implements Json_temporal.

◆ from_packed()

void Json_date::from_packed ( const char *  from,
Date_val to 
)
static

Convert a packed date back to a date value.

Parameters
fromthe buffer to read from (must have at least PACKED_SIZE bytes)
tothe date field to write the value to

◆ from_packed_to_key()

void Json_date::from_packed_to_key ( const char *  from,
uchar to 
)
static

Convert a packed date value to key string for indexing by SE.

Parameters
fromthe buffer to read from
tothe destination buffer

◆ json_type()

enum_json_type Json_date::json_type ( ) const
inlineoverridevirtual
Returns
the type corresponding to the actual Json_dom subclass

Implements Json_dom.

◆ to_packed()

void Json_date::to_packed ( char *  dest) const

Convert the DATE value to the packed format used for storage.

Parameters
destthe destination buffer to write the packed date value to (must at least have size PACKED_SIZE)

◆ value()

const Date_val Json_date::value ( ) const
inline
Returns
the date value.

Member Data Documentation

◆ m_date

Date_val Json_date::m_date
private

Holds the date value.


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