|
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 |
|
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 >
- Parameters
-
[in] | s | output stream to serialize to |
[in] | ichar | indentation character to use |
[in] | error_handler_ | how to react on decoding errors |
◆ dump()
template<typename BasicJsonType >
void detail::serializer< BasicJsonType >::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
- Parameters
-
[in] | val | value to serialize |
[in] | pretty_print | whether the output shall be pretty-printed |
[in] | ensure_ascii | If 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_step | the indent level |
[in] | current_indent | the current indent level (only used internally) |
◆ ensure_ascii
template<typename BasicJsonType >
Initial value:{
std::uint32_t codepoint{}
The documentation for this class was generated from the following file:
- /Users/spirosmag/Documents/AlgoPlus/third_party/json.hpp