12#ifndef __JSONV_ENCODE_HPP_INCLUDED__
13#define __JSONV_ENCODE_HPP_INCLUDED__
189 std::ostream& output();
192 std::ostream& _output;
246 std::
size_t _indent_size;
An encoder is responsible for writing values to some form of output.
virtual void write_object_begin()=0
Write the opening of an object value.
virtual void write_decimal(double value)=0
Write a decimal value.
virtual void write_array_begin()=0
Write the opening of an array value.
virtual void write_array_delimiter()=0
Write the delimiter between two entries in an array.
virtual void write_string(std::string_view value)=0
Write a string value.
virtual void write_object_end()=0
Write the closing of an object value.
void encode(const jsonv::value &source)
Encode some source value into this encoder.
virtual void write_object_key(std::string_view key)=0
Write the key for an object, including the separator.
virtual void write_integer(std::int64_t value)=0
Write an integer value.
virtual void write_null()=0
Write the null value.
virtual void write_object_delimiter()=0
Write the delimiter between two entries in an object.
virtual void write_boolean(bool value)=0
Write a boolean value.
virtual void write_array_end()=0
Write the closing of an array value.
An adapter for enumeration types.
An encoder that outputs to an std::ostream.
ostream_encoder(std::ostream &output)
Create an instance which places text into output.
ostream_pretty_encoder(std::ostream &output, std::size_t indent_size=2)
Create an instance which places text into output.
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
Copyright (c) 2014-2020 by Travis Gockel.
#define JSONV_PUBLIC
This function or class is part of the public API for JSON Voorhees.
Copyright (c) 2012-2020 by Travis Gockel.