MySQL 9.1.0
Source Code Documentation
anonymous_namespace{json_dom.cc}::Rapid_json_handler Class Reference

This class implements rapidjson's Handler concept to make our own handler which will construct our DOM from the parsing of the JSON text. More...

Public Member Functions

 Rapid_json_handler (JsonErrorHandler m_depth_handler)
 
Json_dom_ptr get_built_doc ()
 
bool Null ()
 
bool Bool (bool b)
 
bool Int (int i)
 
bool Uint (unsigned u)
 
bool Int64 (int64_t i)
 
bool Uint64 (uint64_t ui64)
 
bool Double (double d)
 
bool RawNumber (const char *, rapidjson::SizeType, bool)
 
bool String (const char *str, rapidjson::SizeType length, bool)
 
bool StartObject ()
 
bool EndObject (rapidjson::SizeType)
 
bool StartArray ()
 
bool EndArray (rapidjson::SizeType)
 
bool Key (const char *str, rapidjson::SizeType len, bool)
 

Private Types

enum  enum_state {
  expect_anything , expect_array_value , expect_object_key , expect_object_value ,
  expect_eof
}
 

Private Member Functions

bool seeing_value (Json_dom_ptr value)
 Function which is called on each value found in the JSON document being parsed. More...
 
bool start_object_or_array (Json_dom_ptr value, enum_state next_state)
 
void end_object_or_array ()
 

Private Attributes

enum_state m_state
 Tells what kind of value to expect next. More...
 
Json_dom_ptr m_dom_as_built
 Root of the DOM being built. More...
 
Json_domm_current_element
 The current object/array being parsed. More...
 
size_t m_depth
 The depth at which parsing currently happens. More...
 
std::string m_key
 The name of the current member of an object. More...
 
JsonErrorHandler m_depth_handler {nullptr}
 

Detailed Description

This class implements rapidjson's Handler concept to make our own handler which will construct our DOM from the parsing of the JSON text.

bool Null() { } bool Bool(bool) { } bool Int(int) { } bool Uint(unsigned) { } bool Int64(int64_t) { } bool Uint64(uint64_t) { } bool Double(double) { } bool RawNumber(const Ch*, SizeType, bool) { } bool String(const Ch*, SizeType, bool) { } bool StartObject() { } bool Key() { } bool EndObject(SizeType) { } bool StartArray() { } bool EndArray(SizeType) { }

See also
Json_dom::parse

Member Enumeration Documentation

◆ enum_state

enum anonymous_namespace{json_dom.cc}::Rapid_json_handler::enum_state
private
Enumerator
expect_anything 
expect_array_value 
expect_object_key 
expect_object_value 
expect_eof 

Constructor & Destructor Documentation

◆ Rapid_json_handler()

anonymous_namespace{json_dom.cc}::Rapid_json_handler::Rapid_json_handler ( JsonErrorHandler  m_depth_handler)
inlineexplicit

Member Function Documentation

◆ Bool()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Bool ( bool  b)
inline

◆ Double()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Double ( double  d)
inline

◆ end_object_or_array()

void anonymous_namespace{json_dom.cc}::Rapid_json_handler::end_object_or_array ( )
inlineprivate

◆ EndArray()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::EndArray ( rapidjson::SizeType  )
inline

◆ EndObject()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::EndObject ( rapidjson::SizeType  )
inline

◆ get_built_doc()

Json_dom_ptr anonymous_namespace{json_dom.cc}::Rapid_json_handler::get_built_doc ( )
inline
Returns
The built JSON DOM object. Deallocation of the returned value is the responsibility of the caller.

◆ Int()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Int ( int  i)
inline

◆ Int64()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Int64 ( int64_t  i)
inline

◆ Key()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Key ( const char *  str,
rapidjson::SizeType  len,
bool   
)
inline

◆ Null()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Null ( )
inline

◆ RawNumber()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::RawNumber ( const char *  ,
rapidjson::SizeType  ,
bool   
)
inline

◆ seeing_value()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::seeing_value ( Json_dom_ptr  value)
inlineprivate

Function which is called on each value found in the JSON document being parsed.

Parameters
[in]valuethe value that was seen
Returns
true if parsing should continue, false if an error was found and parsing should stop

◆ start_object_or_array()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::start_object_or_array ( Json_dom_ptr  value,
enum_state  next_state 
)
inlineprivate

◆ StartArray()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::StartArray ( )
inline

◆ StartObject()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::StartObject ( )
inline

◆ String()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::String ( const char *  str,
rapidjson::SizeType  length,
bool   
)
inline

◆ Uint()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Uint ( unsigned  u)
inline

◆ Uint64()

bool anonymous_namespace{json_dom.cc}::Rapid_json_handler::Uint64 ( uint64_t  ui64)
inline

Member Data Documentation

◆ m_current_element

Json_dom* anonymous_namespace{json_dom.cc}::Rapid_json_handler::m_current_element
private

The current object/array being parsed.

◆ m_depth

size_t anonymous_namespace{json_dom.cc}::Rapid_json_handler::m_depth
private

The depth at which parsing currently happens.

◆ m_depth_handler

JsonErrorHandler anonymous_namespace{json_dom.cc}::Rapid_json_handler::m_depth_handler {nullptr}
private

◆ m_dom_as_built

Json_dom_ptr anonymous_namespace{json_dom.cc}::Rapid_json_handler::m_dom_as_built
private

Root of the DOM being built.

◆ m_key

std::string anonymous_namespace{json_dom.cc}::Rapid_json_handler::m_key
private

The name of the current member of an object.

◆ m_state

enum_state anonymous_namespace{json_dom.cc}::Rapid_json_handler::m_state
private

Tells what kind of value to expect next.


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