12 #ifndef __JSONV_ENCODE_HPP_INCLUDED__ 13 #define __JSONV_ENCODE_HPP_INCLUDED__ 40 virtual void write_null() = 0;
48 virtual void write_object_begin() = 0;
56 virtual void write_object_end() = 0;
72 virtual void write_object_delimiter() = 0;
80 virtual void write_array_begin() = 0;
88 virtual void write_array_end() = 0;
96 virtual void write_array_delimiter() = 0;
116 virtual void write_integer(std::int64_t value) = 0;
128 virtual void write_decimal(
double value) = 0;
136 virtual void write_boolean(
bool value) = 0;
159 void ensure_ascii(
bool value);
162 virtual void write_null()
override;
164 virtual void write_object_begin()
override;
166 virtual void write_object_end()
override;
168 virtual void write_object_key(
string_view key)
override;
170 virtual void write_object_delimiter()
override;
172 virtual void write_array_begin()
override;
174 virtual void write_array_end()
override;
176 virtual void write_array_delimiter()
override;
178 virtual void write_string(
string_view value)
override;
180 virtual void write_integer(std::int64_t value)
override;
183 virtual void write_decimal(
double value)
override;
185 virtual void write_boolean(
bool value)
override;
188 std::ostream& output();
191 std::ostream& _output;
214 virtual void write_null()
override;
216 virtual void write_object_begin()
override;
218 virtual void write_object_end()
override;
220 virtual void write_object_key(
string_view key)
override;
222 virtual void write_object_delimiter()
override;
224 virtual void write_array_begin()
override;
226 virtual void write_array_end()
override;
228 virtual void write_array_delimiter()
override;
232 virtual void write_integer(std::int64_t value)
override;
234 virtual void write_decimal(
double value)
override;
236 virtual void write_boolean(
bool value)
override;
245 std::size_t _indent_size;
Copyright (c) 2014-2019 by Travis Gockel.
Copyright (c) 2012-2014 by Travis Gockel.
Pulls in an implementation of string_view.
An encoder is responsible for writing values to some form of output.
An encoder that outputs to an std::ostream.
#define JSONV_PUBLIC
This function or class is part of the public API for JsonVoorhees.
JSONV_STRING_VIEW_TYPE string_view
A non-owning reference to a string.
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...