MySQL 9.3.0
Source Code Documentation
helper::json::RapidReaderHandlerToMapOfSimpleValues Class Reference

This class is a adapter for Reader from RapidJson. More...

#include <rapid_json_to_map.h>

Inheritance diagram for helper::json::RapidReaderHandlerToMapOfSimpleValues:
[legend]

Classes

struct  KeyValue
 

Public Types

using Map = std::map< std::string, std::string >
 
using Result = Map
 

Public Member Functions

 RapidReaderHandlerToMapOfSimpleValues (int allowed_levels=1)
 
const Mapget_result () const
 
bool Null ()
 
bool Bool (bool value)
 
bool String (const Ch *ch, rapidjson::SizeType size, bool)
 
bool Int (int v)
 
bool Uint (unsigned v)
 
bool Int64 (int64_t v)
 
bool Uint64 (uint64_t v)
 
bool Double (double v)
 
bool RawNumber (const Ch *str, rapidjson::SizeType len, bool copy)
 enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) More...
 
bool StartObject ()
 
bool EndObject (rapidjson::SizeType)
 
bool Key (const Ch *str, rapidjson::SizeType len, bool)
 
bool StartArray ()
 
bool EndArray (rapidjson::SizeType)
 

Static Public Attributes

constexpr static rapidjson::ParseFlag k_parse_flags
 

Private Member Functions

std::string get_current_key () const
 

Private Attributes

int allowed_levels_
 
std::list< KeyValuekeys_
 
KeyValue key_
 
Map result_
 
int level_ {0}
 
int arrays_ {0}
 

Detailed Description

This class is a adapter for Reader from RapidJson.

This class adapts std::map of strings (keys and values are strings) to be destination of text document conversion done be rapidjson::Reader. There are some constrains to what is converted:

  • values from top level document are inserted into the map,
  • value must be a simple type, sub objects, or arrays are ignored.

Member Typedef Documentation

◆ Map

using helper::json::RapidReaderHandlerToMapOfSimpleValues::Map = std::map<std::string, std::string>

◆ Result

Constructor & Destructor Documentation

◆ RapidReaderHandlerToMapOfSimpleValues()

helper::json::RapidReaderHandlerToMapOfSimpleValues::RapidReaderHandlerToMapOfSimpleValues ( int  allowed_levels = 1)
inline

Member Function Documentation

◆ Bool()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Bool ( bool  value)
inline

◆ Double()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Double ( double  v)
inline

◆ EndArray()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::EndArray ( rapidjson::SizeType  )
inline

◆ EndObject()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::EndObject ( rapidjson::SizeType  )
inline

◆ get_current_key()

std::string helper::json::RapidReaderHandlerToMapOfSimpleValues::get_current_key ( ) const
inlineprivate

◆ get_result()

const Map & helper::json::RapidReaderHandlerToMapOfSimpleValues::get_result ( ) const
inline

◆ Int()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Int ( int  v)
inline

◆ Int64()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Int64 ( int64_t  v)
inline

◆ Key()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Key ( const Ch *  str,
rapidjson::SizeType  len,
bool   
)
inline

◆ Null()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Null ( )
inline

◆ RawNumber()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::RawNumber ( const Ch *  str,
rapidjson::SizeType  len,
bool  copy 
)
inline

enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length)

◆ StartArray()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::StartArray ( )
inline

◆ StartObject()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::StartObject ( )
inline

◆ String()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::String ( const Ch *  ch,
rapidjson::SizeType  size,
bool   
)
inline

◆ Uint()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Uint ( unsigned  v)
inline

◆ Uint64()

bool helper::json::RapidReaderHandlerToMapOfSimpleValues::Uint64 ( uint64_t  v)
inline

Member Data Documentation

◆ allowed_levels_

int helper::json::RapidReaderHandlerToMapOfSimpleValues::allowed_levels_
private

◆ arrays_

int helper::json::RapidReaderHandlerToMapOfSimpleValues::arrays_ {0}
private

◆ k_parse_flags

constexpr static rapidjson::ParseFlag helper::json::RapidReaderHandlerToMapOfSimpleValues::k_parse_flags
staticconstexpr
Initial value:
{
rapidjson::kParseNumbersAsStringsFlag}

◆ key_

KeyValue helper::json::RapidReaderHandlerToMapOfSimpleValues::key_
private

◆ keys_

std::list<KeyValue> helper::json::RapidReaderHandlerToMapOfSimpleValues::keys_
private

◆ level_

int helper::json::RapidReaderHandlerToMapOfSimpleValues::level_ {0}
private

◆ result_

Map helper::json::RapidReaderHandlerToMapOfSimpleValues::result_
private

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