46 static constexpr uint8_t UTF8_ACCEPT = 0;
47 static constexpr uint8_t UTF8_REJECT = 1;
56 : o(s), indent_char(ichar),
57 indent_string(indent_init_len, indent_char)
82 void dump(
const json& val,
const bool pretty_print,
83 const bool ensure_ascii,
84 const unsigned int indent_step,
85 const unsigned int current_indent = 0);
103 template <
typename NumberType,
109 template <
typename NumberType,
125 std::is_same<NumberType, uint64_t>::value
or
126 std::is_same<NumberType, int64_t>::value,
143 assert(i < number_buffer.size() - 1);
145 const auto digit = std::labs(
static_cast<long>(x % 10));
146 number_buffer[i++] =
static_cast<char>(
'0' + digit);
153 assert(i < number_buffer.size() - 2);
154 number_buffer[i++] =
'-';
157 std::reverse(number_buffer.begin(), number_buffer.begin() + i);
158 o.
write(number_buffer.data(), i);
199 std::array<char, 64> number_buffer{{}};
202 const char indent_char;
204 std::string indent_string;
or
Definition: ThirdPartyNotices.txt:199
Definition: json_serializer.h:45
serializer(const serializer &)=delete
void dump(const json &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
void dump_escaped(std::string_view s, const bool ensure_ascii)
dump escaped string
bool is_negative_integer(NumberType x)
Definition: json_serializer.h:105
serializer & operator=(const serializer &)=delete
static uint8_t decode(uint8_t &state, uint32_t &codep, const uint8_t byte) noexcept
check whether a string is UTF-8 encoded
serializer(raw_ostream &s, const char ichar, size_t indent_init_len=512)
Definition: json_serializer.h:55
void dump_integer(NumberType x)
dump an integer
Definition: json_serializer.h:128
void dump_float(double x)
dump a floating-point number
a class to store JSON values
Definition: json.h:2655
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:44
raw_ostream & write(unsigned char C)
basic_string_view< char > string_view
Definition: core.h:520
::uint32_t uint32_t
Definition: Meta.h:56
::uint8_t uint8_t
Definition: Meta.h:52
typename std::enable_if< B, T >::type enable_if_t
Definition: json.h:207
/file This file defines the SmallVector class.
Definition: AprilTagFieldLayout.h:18