RflySimSDK v4.10
RflySimSDK说明文档
载入中...
搜索中...
未找到
serializer< BasicJsonType > 模板类 参考

Public 成员函数

 serializer (output_adapter_t< char > s, const char ichar, error_handler_t error_handler_=error_handler_t::strict)
 serializer (const serializer &)=delete
serializeroperator= (const serializer &)=delete
 serializer (serializer &&)=delete
serializeroperator= (serializer &&)=delete
void dump (const BasicJsonType &val, const bool pretty_print, const bool ensure_ascii, const unsigned int indent_step, const unsigned int current_indent=0)
 internal implementation of the serialization function
 for (std::size_t i=0;i< s.size();++i)
 if (JSON_HEDLEY_LIKELY(state==UTF8_ACCEPT))

Public 属性

JSON_PRIVATE_UNLESS_TESTED : void dump_escaped(const string_t& s
JSON_PRIVATE_UNLESS_TESTED const bool ensure_ascii
std::uint8_t state = UTF8_ACCEPT
std::size_t bytes = 0
std::size_t bytes_after_last_accept = 0
std::size_t undumped_chars = 0
 else
 enable_if_t< std::is_signed< NumberType >::value, int >
 enable_if_t< std::is_unsigned< NumberType >::value, int >
std::array< char, 64 > number_buffer {{}}
 a (hopefully) large enough character buffer
const std::lconv * loc = nullptr
 the locale
const char thousands_sep = '\0'
 the locale's thousand separator character
const char decimal_point = '\0'
 the locale's decimal point character
std::array< char, 512 > string_buffer {{}}
 string buffer
const char indent_char
 the indentation character
string_t indent_string
 the indentation string
const error_handler_t error_handler
 error_handler how to react on decoding errors

构造及析构函数说明

◆ serializer()

template<typename BasicJsonType>
serializer ( output_adapter_t< char > s,
const char ichar,
error_handler_t error_handler_ = error_handler_t::strict )
inline
参数
[in]soutput stream to serialize to
[in]icharindentation character to use
[in]error_handler_how to react on decoding errors

成员函数说明

◆ dump()

template<typename BasicJsonType>
void dump ( const BasicJsonType & val,
const bool pretty_print,
const bool ensure_ascii,
const unsigned int indent_step,
const unsigned int current_indent = 0 )
inline

internal implementation of the serialization function

This function is called by the public member function dump and organizes the serialization internally. The indentation level is propagated as additional parameter. In case of arrays and objects, the function is called recursively.

  • strings and object keys are escaped using escape_string()
  • integer numbers are converted implicitly via operator<<
  • floating-point numbers are converted to a string using "g" format
  • binary values are serialized as objects containing the subtype and the byte array
参数
[in]valvalue to serialize
[in]pretty_printwhether the output shall be pretty-printed
[in]ensure_asciiIf ensure_ascii is true, all non-ASCII characters in the output are escaped with \uXXXX sequences, and the result consists of ASCII characters only.
[in]indent_stepthe indent level
[in]current_indentthe current indent level (only used internally)
函数调用图:
这是这个函数的调用关系图:

类成员变量说明

◆ decimal_point

template<typename BasicJsonType>
const char decimal_point = '\0'

the locale's decimal point character

◆ enable_if_t< std::is_signed< NumberType >::value, int >

template<typename BasicJsonType>
enable_if_t< std::is_signed< NumberType >::value, int >
初始值:
= 0>
bool is_negative_number(NumberType x)
{
return x < 0;
}
template < typename NumberType

◆ enable_if_t< std::is_unsigned< NumberType >::value, int >

template<typename BasicJsonType>
enable_if_t< std::is_unsigned< NumberType >::value, int >
初始值:
= 0 >
bool is_negative_number(NumberType )
{
return false;
}
template < typename NumberType

◆ ensure_ascii

template<typename BasicJsonType>
JSON_PRIVATE_UNLESS_TESTED const bool ensure_ascii
初始值:
{
std::uint32_t codepoint{}

◆ error_handler

template<typename BasicJsonType>
const error_handler_t error_handler

error_handler how to react on decoding errors

◆ indent_char

template<typename BasicJsonType>
const char indent_char

the indentation character

◆ indent_string

template<typename BasicJsonType>
string_t indent_string

the indentation string

◆ loc

template<typename BasicJsonType>
const std::lconv* loc = nullptr

the locale

◆ number_buffer

template<typename BasicJsonType>
std::array<char, 64> number_buffer {{}}

a (hopefully) large enough character buffer

◆ string_buffer

template<typename BasicJsonType>
std::array<char, 512> string_buffer {{}}

string buffer

◆ thousands_sep

template<typename BasicJsonType>
const char thousands_sep = '\0'

the locale's thousand separator character


该类的文档由以下文件生成: