nlohmann::detail::serializer
json.hpp
typename BasicJsonType
typename BasicJsonType::string_t using nlohmann::detail::serializer< BasicJsonType >::string_t = typename BasicJsonType::string_t string_t
typename BasicJsonType::number_float_t using nlohmann::detail::serializer< BasicJsonType >::number_float_t = typename BasicJsonType::number_float_t number_float_t
typename BasicJsonType::number_integer_t using nlohmann::detail::serializer< BasicJsonType >::number_integer_t = typename BasicJsonType::number_integer_t number_integer_t
typename BasicJsonType::number_unsigned_t using nlohmann::detail::serializer< BasicJsonType >::number_unsigned_t = typename BasicJsonType::number_unsigned_t number_unsigned_t
typename BasicJsonType::binary_t::value_type using nlohmann::detail::serializer< BasicJsonType >::binary_char_t = typename BasicJsonType::binary_t::value_type binary_char_t
constexpr std::uint8_t constexpr std::uint8_t nlohmann::detail::serializer< BasicJsonType >::UTF8_ACCEPT UTF8_ACCEPT = 0
constexpr std::uint8_t constexpr std::uint8_t nlohmann::detail::serializer< BasicJsonType >::UTF8_REJECT UTF8_REJECT = 1
JSON_PRIVATE_UNLESS_TESTED JSON_PRIVATE_UNLESS_TESTED nlohmann::detail::serializer< BasicJsonType >::__pad0__ __pad0__ void dump_escaped(const string_t& s
JSON_PRIVATE_UNLESS_TESTED const bool JSON_PRIVATE_UNLESS_TESTED const bool nlohmann::detail::serializer< BasicJsonType >::ensure_ascii ensure_ascii { std::uint32_t codepoint{}
std::uint8_t std::uint8_t nlohmann::detail::serializer< BasicJsonType >::state state = UTF8_ACCEPT
std::size_t std::size_t nlohmann::detail::serializer< BasicJsonType >::bytes bytes = 0
std::size_t std::size_t nlohmann::detail::serializer< BasicJsonType >::bytes_after_last_accept bytes_after_last_accept = 0
std::size_t std::size_t nlohmann::detail::serializer< BasicJsonType >::undumped_chars undumped_chars = 0
nlohmann::detail::serializer< BasicJsonType >::else
else
std::array< char, 64 > std::array<char, 64> nlohmann::detail::serializer< BasicJsonType >::number_buffer number_buffer {{}}

a (hopefully) large enough character buffer

const std::lconv * const std::lconv* nlohmann::detail::serializer< BasicJsonType >::loc loc = nullptr

the locale

const char const char nlohmann::detail::serializer< BasicJsonType >::thousands_sep thousands_sep = '\0'

the locale's thousand separator character

const char const char nlohmann::detail::serializer< BasicJsonType >::decimal_point decimal_point = '\0'

the locale's decimal point character

std::array< char, 512 > std::array<char, 512> nlohmann::detail::serializer< BasicJsonType >::string_buffer string_buffer {{}}

string buffer

const char const char nlohmann::detail::serializer< BasicJsonType >::indent_char indent_char

the indentation character

string_t string_t nlohmann::detail::serializer< BasicJsonType >::indent_string indent_string

the indentation string

const error_handler_t const error_handler_t nlohmann::detail::serializer< BasicJsonType >::error_handler error_handler

error_handler how to react on decoding errors

nlohmann::detail::serializer< BasicJsonType >::serializer
(output_adapter_t< char > s, const char ichar, error_handler_t error_handler_=error_handler_t::strict)
serializer
output_adapter_t< char > s
const char ichar
error_handler_t error_handler_ error_handler_t::strict

s

output stream to serialize to

ichar

indentation character to use

error_handler_

how to react on decoding errors

nlohmann::detail::serializer< BasicJsonType >::serializer
(const serializer &)=delete
serializer
const serializer &
serializer & serializer& nlohmann::detail::serializer< BasicJsonType >::operator= (const serializer &)=delete operator= const serializer &
nlohmann::detail::serializer< BasicJsonType >::serializer
(serializer &&)=delete
serializer
serializer &&
serializer & serializer& nlohmann::detail::serializer< BasicJsonType >::operator= (serializer &&)=delete operator= serializer &&
nlohmann::detail::serializer< BasicJsonType >::~serializer
()=default
~serializer
void 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) 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

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

val

value to serialize

pretty_print

whether the output shall be pretty-printed

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.

indent_step

the indent level

current_indent

the current indent level (only used internally)

nlohmann::detail::array
nlohmann::detail::binary
nlohmann::detail::boolean
nlohmann::detail::discarded
JSON_ASSERT
JSON_HEDLEY_UNLIKELY
JSON_PRIVATE_UNLESS_TESTED
nlohmann::detail::null
nlohmann::detail::number_float
nlohmann::detail::number_integer
nlohmann::detail::number_unsigned
nlohmann::detail::object
nlohmann::detail::string
nlohmann::detail::serializer< BasicJsonType >::for
(std::size_t i=0;i< s.size();++i)
for
nlohmann::detail::type_error::create
nlohmann::detail::ignore
JSON_ASSERT
JSON_THROW
nlohmann::detail::replace
nlohmann::detail::strict
nlohmann::detail::string
nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type
nlohmann::to_string
nlohmann::detail::serializer< BasicJsonType >::if
(JSON_HEDLEY_LIKELY(state==UTF8_ACCEPT))
if
JSON_HEDLEY_LIKELY(state==UTF8_ACCEPT)
size_t
const error_handler_t
T
JSON_PRIVATE_UNLESS_TESTED
std::array< T >
+elements
std::array< char, 512 >
+elements
< char, 512 >
lconv *
uint8_t
std::array< char, 64 >
+elements
< char, 64 >
string_t
char
nlohmann::detail::serializer< BasicJsonType >
+number_buffer
-UTF8_ACCEPT
-UTF8_REJECT
+loc
+indent_char
+decimal_point
+thousands_sep
+state
+indent_string
+string_buffer
+__pad0__
+ensure_ascii
+bytes_after_last_accept
+bytes
+undumped_chars
+error_handler
- nlohmann::detail::serializer
  __pad0__
- nlohmann::detail::serializer
  binary_char_t
- nlohmann::detail::serializer
  bytes
- nlohmann::detail::serializer
  bytes_after_last_accept
- nlohmann::detail::serializer
  decimal_point
- nlohmann::detail::serializer
  dump
- nlohmann::detail::serializer
  else
- nlohmann::detail::serializer
  ensure_ascii
- nlohmann::detail::serializer
  error_handler
- nlohmann::detail::serializer
  for
- nlohmann::detail::serializer
  if
- nlohmann::detail::serializer
  indent_char
- nlohmann::detail::serializer
  indent_string
- nlohmann::detail::serializer
  loc
- nlohmann::detail::serializer
  number_buffer
- nlohmann::detail::serializer
  number_float_t
- nlohmann::detail::serializer
  number_integer_t
- nlohmann::detail::serializer
  number_unsigned_t
- nlohmann::detail::serializer
  operator=
- nlohmann::detail::serializer
  operator=
- nlohmann::detail::serializer
  serializer
- nlohmann::detail::serializer
  serializer
- nlohmann::detail::serializer
  serializer
- nlohmann::detail::serializer
  state
- nlohmann::detail::serializer
  string_buffer
- nlohmann::detail::serializer
  string_t
- nlohmann::detail::serializer
  thousands_sep
- nlohmann::detail::serializer
  undumped_chars
- nlohmann::detail::serializer
  UTF8_ACCEPT
- nlohmann::detail::serializer
  UTF8_REJECT
- nlohmann::detail::serializer
  ~serializer