template <typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>

class PrettyWriter

Defined at line 48 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

Writer with indentation and spacing.

Template Parameters

OutputStream Type of output os.
SourceEncoding Encoding of source string.
TargetEncoding Encoding of output stream.
StackAllocator Type of allocator for allocating memory of stack.

Protected Members

Ch indentChar_
unsigned int indentCharCount_
PrettyFormatOptions formatOptions_

Public Methods

void PrettyWriter<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> (OutputStream & os, StackAllocator * allocator, size_t levelDepth)

Constructor

Parameters

os Output stream.
allocator User supplied allocator. If it is null, it will create a private one.
levelDepth Initial capacity of stack.

Defined at line 58 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

void PrettyWriter<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> (StackAllocator * allocator, size_t levelDepth)

Defined at line 62 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

void PrettyWriter<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> (PrettyWriter<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> && rhs)

Defined at line 66 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

PrettyWriter<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> & SetIndent (Ch indentChar, unsigned int indentCharCount)

Set custom indentation.

Parameters

indentChar Character for indentation. Must be whitespace character (' ', '\t', '\n', '\r').
indentCharCount Number of indent characters for each indentation level.

Defined at line 75 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

PrettyWriter<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> & SetFormatOptions (PrettyFormatOptions options)

Set pretty writer formatting options.

Parameters

options Formatting options.

Defined at line 85 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Null ()

@

{

Defined at line 95 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Bool (bool b)

Defined at line 96 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Int (int i)

Defined at line 97 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Uint (unsigned int u)

Defined at line 98 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Int64 (int64_t i64)

Defined at line 99 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Uint64 (uint64_t u64)

Defined at line 100 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Double (double d)

Defined at line 101 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool RawNumber (const Ch * str, SizeType length, bool copy)

Defined at line 103 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool String (const Ch * str, SizeType length, bool copy)

Defined at line 110 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool String (const std::basic_string<Ch> & str)

Defined at line 118 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool StartObject ()

Defined at line 123 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Key (const Ch * str, SizeType length, bool copy)

Defined at line 129 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Key (const std::basic_string<Ch> & str)

Defined at line 132 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool EndObject (SizeType memberCount)

Defined at line 137 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool StartArray ()

Defined at line 157 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool EndArray (SizeType memberCount)

Defined at line 163 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool String (const Ch * str)

Simpler but slower overload.

Defined at line 187 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool Key (const Ch * str)

Defined at line 188 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

bool RawValue (const Ch * json, size_t length, Type type)

Write a raw JSON value.

For user to write a stringified JSON as a value.

Parameters

json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
length Length of the json.
type Type of the root of json.

Defined at line 201 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

Protected Methods

void PrettyPrefix (Type type)

Defined at line 208 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h

void WriteIndent ()

Defined at line 252 of file ../../third_party/rapidjson/include/rapidjson/prettywriter.h