rapidjson A fast JSON parser/generator for C++ with both SAX/DOM style API

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rapidjson::PrettyWriter< Stream, Encoding, Allocator > Class Template Reference

Writer with indentation and spacing. More...

`#include <prettywriter.h>`

Inheritance diagram for rapidjson::PrettyWriter< Stream, Encoding, Allocator >:

## Public Types
typedef Writer< Stream, Encoding, Allocator > | Base
typedef Base::Ch | Ch
Public Types inherited from rapidjson::Writer< Stream, Encoding, Allocator >
typedef Encoding::Ch | Ch

## Public Member Functions
| PrettyWriter (Stream &stream, Allocator *allocator=0, size_t levelDepth=Base::kDefaultLevelDepth)
| Constructor.
PrettyWriter & | SetIndent (Ch indentChar, unsigned indentCharCount)
| Set custom indentation.
PrettyWriter & | String (const Ch *str)
| Simpler but slower overload.
PrettyWriter & | Null ()
PrettyWriter & | Bool (bool b)
PrettyWriter & | Int (int i)
PrettyWriter & | Uint (unsigned u)
PrettyWriter & | Int64 (int64_t i64)
PrettyWriter & | Uint64 (uint64_t u64)
PrettyWriter & | Double (double d)
PrettyWriter & | String (const Ch *str, SizeType length, bool copy=false)
PrettyWriter & | StartObject ()
PrettyWriter & | EndObject (SizeType memberCount=0)
PrettyWriter & | StartArray ()
PrettyWriter & | EndArray (SizeType memberCount=0)
Public Member Functions inherited from rapidjson::Writer< Stream, Encoding, Allocator >
| Writer (Stream &stream, Allocator *allocator=0, size_t levelDepth=kDefaultLevelDepth)

## Protected Member Functions
void | PrettyPrefix (Type type)
void | WriteIndent ()
Protected Member Functions inherited from rapidjson::Writer< Stream, Encoding, Allocator >
void | WriteNull ()
void | WriteBool (bool b)
void | WriteInt (int i)
void | WriteUint (unsigned u)
void | WriteInt64 (int64_t i64)
void | WriteUint64 (uint64_t u64)
void | WriteDouble (double d)
void | WriteString (const Ch *str, SizeType length)
void | WriteStartObject ()
void | WriteEndObject ()
void | WriteStartArray ()
void | WriteEndArray ()
void | Prefix (Type type)

## Protected Attributes
Ch | indentChar_
unsigned | indentCharCount_
Protected Attributes inherited from rapidjson::Writer< Stream, Encoding, Allocator >
Stream & | stream_
internal::Stack< Allocator > | level_stack_

## Additional Inherited Members
Static Protected Attributes inherited from rapidjson::Writer< Stream, Encoding, Allocator >
static const size_t | kDefaultLevelDepth = 32

## Detailed Description

### template<typename Stream, typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
class rapidjson::PrettyWriter< Stream, Encoding, Allocator >

Writer with indentation and spacing.

Template Parameters

  Stream | Type of ouptut stream.
  Encoding | Encoding of both source strings and output.
  Allocator | Type of allocator for allocating memory of stack.

## Constructor & Destructor Documentation

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>

rapidjson::PrettyWriter< Stream, Encoding, Allocator >::PrettyWriter | ( | Stream & | stream,
|  | Allocator * | allocator = `0`,
|  | size_t | levelDepth = `Base::kDefaultLevelDepth`
| ) |  |
| inline

Constructor.

Parameters

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

## Member Function Documentation

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>

PrettyWriter& rapidjson::PrettyWriter< Stream, Encoding, Allocator >::SetIndent | ( | Ch | indentChar,
|  | unsigned | indentCharCount
| ) |  |
| inline

Set custom indentation.

Parameters

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

Note
  The default indentation is 4 spaces.

The documentation for this class was generated from the following file:

- D:/rapidjson_version0.1x/include/rapidjson/prettywriter.h