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