30#ifndef PT_JSON_JSONWRITER_H
31#define PT_JSON_JSONWRITER_H
33#include <Pt/Json/Api.h>
34#include <Pt/IOStream.h>
88 void reset(std::basic_ostream<Char>& os);
153 class JsonWriterImpl* _impl;
void writeInt(Pt::int64_t value)
Writes an integer value.
void writeMember(const Pt::Char *name, std::size_t nameSize)
Writes a member.
void writeString(const Pt::Char *value, std::size_t valueSize)
Writes a string value.
void writeMember(const char *name)
Writes a member.
std::basic_ostream< Char > * output()
Returns the output stream or a nullptr if none was set.
void writeArrayEnd()
Writes the end of an array.
void writeArray()
Writes the begin of an array.
void setIndent(const Pt::String &indent)
Sets the indentation string.
JsonWriter(std::basic_ostream< Char > &os)
Constructs with output stream.
void writeObjectEnd()
Writes the end of an object.
void reset()
Clears the writer state and output.
void writeFloat(long double value)
Writes an float value.
void writeBool(bool value)
Writes an boolean value.
void reset(std::basic_ostream< Char > &os)
Clears the writer state and output.
const Pt::String & indent() const
Returns the indentation string.
void writeNull()
Writes an null value.
void setFormatting(bool value)
Indicates wether indentation should be written.
void writeObject()
Writes the begin of an object.
bool isFormatting() const
Returns true if indentation should be written.
void writeUInt(Pt::uint64_t value)
Writes an unsigned integer value.
Unicode capable basic_string.
Definition Api-String.h:67
size_type size() const
Returns the length of the string.
Definition Api-String.h:263
const Pt::Char * c_str() const
Returns a null terminated C string.
Definition Api-String.h:288
int_type int64_t
Signed 64-bit integer type.
Definition Api-Types.h:59
uint_type uint64_t
Unsigned 64-bit integer type.
Definition Api-Types.h:66
Read and write JSON ducuments.
Core module.
Definition Allocator.h:33
Unicode character type.
Definition String.h:67