|
| | serializer (output_adapter_t< char > s, const char ichar, error_handler_t error_handler_=error_handler_t::strict) |
| |
| | serializer (const serializer &)=delete |
| |
| serializer & | operator= (const serializer &)=delete |
| |
| | serializer (serializer &&)=delete |
| |
| serializer & | operator= (serializer &&)=delete |
| |
| | ~serializer ()=default |
| |
| 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)) |
| |
| | serializer (output_adapter_t< char > s, const char ichar, error_handler_t error_handler_=error_handler_t::strict) |
| |
| | serializer (const serializer &)=delete |
| |
| serializer & | operator= (const serializer &)=delete |
| |
| | serializer (serializer &&)=delete |
| |
| serializer & | operator= (serializer &&)=delete |
| |
| | ~serializer ()=default |
| |
| 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)) |
| |
| | serializer (output_adapter_t< char > s, const char ichar, error_handler_t error_handler_=error_handler_t::strict) |
| |
| | serializer (const serializer &)=delete |
| |
| serializer & | operator= (const serializer &)=delete |
| |
| | serializer (serializer &&)=delete |
| |
| serializer & | operator= (serializer &&)=delete |
| |
| | ~serializer ()=default |
| |
| 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)) |
| |
template<typename BasicJsonType>
class nlohmann::detail::serializer< BasicJsonType >
Definition at line 16085 of file json.hpp.
template<typename BasicJsonType >
| void nlohmann::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) |
Definition at line 16141 of file json.hpp.
References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::discarded, nlohmann::detail::serializer< BasicJsonType >::dump(), nlohmann::detail::serializer< BasicJsonType >::ensure_ascii, i, nlohmann::detail::serializer< BasicJsonType >::indent_string, JSON_ASSERT, JSON_HEDLEY_UNLIKELY, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, and nlohmann::detail::string.
Referenced by nlohmann::detail::serializer< BasicJsonType >::dump().
template<typename BasicJsonType >
| void nlohmann::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) |
Definition at line 16141 of file json.hpp.
References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::discarded, nlohmann::detail::serializer< BasicJsonType >::dump(), nlohmann::detail::serializer< BasicJsonType >::ensure_ascii, i, nlohmann::detail::serializer< BasicJsonType >::indent_string, JSON_ASSERT, JSON_HEDLEY_UNLIKELY, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, and nlohmann::detail::string.
template<typename BasicJsonType >
| void nlohmann::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) |
Definition at line 16141 of file json.hpp.
References nlohmann::detail::array, nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::discarded, nlohmann::detail::serializer< BasicJsonType >::dump(), nlohmann::detail::serializer< BasicJsonType >::ensure_ascii, i, nlohmann::detail::serializer< BasicJsonType >::indent_string, JSON_ASSERT, JSON_HEDLEY_UNLIKELY, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, and nlohmann::detail::string.