MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
helper::json::SerializerToText Class Reference

#include <serializer_to_text.h>

Classes

class  Array
 
class  Object
 

Public Member Functions

 SerializerToText (const bool bigint_encode_as_string=false)
 
std::string get_result ()
 
Object add_object ()
 
Array add_array ()
 
SerializerToTextoperator<< (const char *value)
 
SerializerToTextoperator<< (const std::string &value)
 
SerializerToTextoperator<< (const float value)
 
SerializerToTextoperator<< (const int value)
 
SerializerToTextoperator<< (const unsigned int value)
 
SerializerToTextoperator<< (const uint64_t value)
 
SerializerToTextoperator<< (const int64_t value)
 
SerializerToTextoperator<< (const bool value)
 
SerializerToTextadd_value (const char *value, JsonType ct=JsonType::kString)
 
SerializerToTextadd_value (const char *value, uint32_t length, JsonType ct)
 
SerializerToTextadd_value (const rapidjson::Value &value)
 
void flush ()
 
Array member_add_array (const char *key)
 
Object member_add_object (const char *key)
 
template<typename Str1 , typename Str2 >
SerializerToTextmember_add_value (const Str1 &key, const Str2 &value, JsonType ct)
 
template<typename Str1 , typename Value >
SerializerToTextmember_add_value (const Str1 &key, Value &&value)
 
template<typename Str1 >
SerializerToTextmember_add_value (const Str1 &key, const char *str, uint32_t len)
 
template<typename Str1 >
SerializerToTextmember_add_value (const Str1 &key, const char *str, uint32_t len, JsonType ct)
 
template<typename Str1 >
SerializerToTextmember_add_null_value (const Str1 &key)
 

Private Member Functions

const char * get_raw (const char *value)
 
const char * get_raw (const std::string &value)
 
const char * get_raw (const bool value)
 
template<typename Value >
void add_member_impl (const char *key, Value &&value)
 
template<typename Value >
void add_member_impl (const char *key, helper::Optional< Value > &value)
 
template<typename Value >
void add_member_impl (const char *key, const helper::Optional< Value > &value)
 
void add_member_impl (const char *key, const char *value, JsonType ct)
 

Private Attributes

bool bigint_encode_as_string_ {false}
 
std::stringstream value_
 
rapidjson::OStreamWrapper ostream_ {value_}
 
rapidjson::Writer< rapidjson::OStreamWrapper > writer_ {ostream_}
 

Constructor & Destructor Documentation

◆ SerializerToText()

helper::json::SerializerToText::SerializerToText ( const bool  bigint_encode_as_string = false)
inlineexplicit

Member Function Documentation

◆ add_array()

Array helper::json::SerializerToText::add_array ( )
inline

◆ add_member_impl() [1/4]

void helper::json::SerializerToText::add_member_impl ( const char *  key,
const char *  value,
JsonType  ct 
)
inlineprivate

◆ add_member_impl() [2/4]

template<typename Value >
void helper::json::SerializerToText::add_member_impl ( const char *  key,
const helper::Optional< Value > &  value 
)
inlineprivate

◆ add_member_impl() [3/4]

template<typename Value >
void helper::json::SerializerToText::add_member_impl ( const char *  key,
helper::Optional< Value > &  value 
)
inlineprivate

◆ add_member_impl() [4/4]

template<typename Value >
void helper::json::SerializerToText::add_member_impl ( const char *  key,
Value &&  value 
)
inlineprivate

◆ add_object()

Object helper::json::SerializerToText::add_object ( )
inline

◆ add_value() [1/3]

SerializerToText & helper::json::SerializerToText::add_value ( const char *  value,
JsonType  ct = JsonType::kString 
)
inline

◆ add_value() [2/3]

SerializerToText & helper::json::SerializerToText::add_value ( const char *  value,
uint32_t  length,
JsonType  ct 
)
inline

◆ add_value() [3/3]

SerializerToText & helper::json::SerializerToText::add_value ( const rapidjson::Value &  value)
inline

◆ flush()

void helper::json::SerializerToText::flush ( )
inline

◆ get_raw() [1/3]

const char * helper::json::SerializerToText::get_raw ( const bool  value)
inlineprivate

◆ get_raw() [2/3]

const char * helper::json::SerializerToText::get_raw ( const char *  value)
inlineprivate

◆ get_raw() [3/3]

const char * helper::json::SerializerToText::get_raw ( const std::string &  value)
inlineprivate

◆ get_result()

std::string helper::json::SerializerToText::get_result ( )
inline

◆ member_add_array()

Array helper::json::SerializerToText::member_add_array ( const char *  key)
inline

◆ member_add_null_value()

template<typename Str1 >
SerializerToText & helper::json::SerializerToText::member_add_null_value ( const Str1 &  key)
inline

◆ member_add_object()

Object helper::json::SerializerToText::member_add_object ( const char *  key)
inline

◆ member_add_value() [1/4]

template<typename Str1 >
SerializerToText & helper::json::SerializerToText::member_add_value ( const Str1 &  key,
const char *  str,
uint32_t  len 
)
inline

◆ member_add_value() [2/4]

template<typename Str1 >
SerializerToText & helper::json::SerializerToText::member_add_value ( const Str1 &  key,
const char *  str,
uint32_t  len,
JsonType  ct 
)
inline

◆ member_add_value() [3/4]

template<typename Str1 , typename Str2 >
SerializerToText & helper::json::SerializerToText::member_add_value ( const Str1 &  key,
const Str2 &  value,
JsonType  ct 
)
inline

◆ member_add_value() [4/4]

template<typename Str1 , typename Value >
SerializerToText & helper::json::SerializerToText::member_add_value ( const Str1 &  key,
Value &&  value 
)
inline

◆ operator<<() [1/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const bool  value)
inline

◆ operator<<() [2/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const char *  value)
inline

◆ operator<<() [3/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const float  value)
inline

◆ operator<<() [4/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const int  value)
inline

◆ operator<<() [5/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const int64_t  value)
inline

◆ operator<<() [6/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const std::string &  value)
inline

◆ operator<<() [7/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const uint64_t  value)
inline

◆ operator<<() [8/8]

SerializerToText & helper::json::SerializerToText::operator<< ( const unsigned int  value)
inline

Member Data Documentation

◆ bigint_encode_as_string_

bool helper::json::SerializerToText::bigint_encode_as_string_ {false}
private

◆ ostream_

rapidjson::OStreamWrapper helper::json::SerializerToText::ostream_ {value_}
private

◆ value_

std::stringstream helper::json::SerializerToText::value_
private

◆ writer_

rapidjson::Writer<rapidjson::OStreamWrapper> helper::json::SerializerToText::writer_ {ostream_}
private

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