cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PrettyWriter< Stream, Encoding, Allocator > Class Template Reference

Writer with indentation and spacing. More...

#include <prettywriter.h>

Inheritance diagram for PrettyWriter< Stream, Encoding, Allocator >:
Writer< Stream, Encoding, Allocator > Handler

Public Types

typedef Writer< Stream,
Encoding, Allocator
Base
typedef Base::Ch Ch
- Public Types inherited from Writer< Stream, Encoding, Allocator >
typedef Encoding::Ch Ch

Public Member Functions

 PrettyWriter (Stream &stream, Allocator *allocator=0, size_t levelDepth=Base::kDefaultLevelDepth)
 Constructor. More...
 
PrettyWriterSetIndent (Ch indentChar, unsigned indentCharCount)
 Set custom indentation. More...
 
PrettyWriterString (const Ch *str)
 Simpler but slower overload. More...
 
PrettyWriterNull ()
PrettyWriterBool (bool b)
var Bool ( var b)
local Bool ( local b)
PrettyWriterInt (int i)
var Int ( var i)
local Int ( local i)
PrettyWriterUint (unsigned u)
var Uint ( var u)
local Uint ( local u)
PrettyWriterInt64 (int64_t i64)
PrettyWriterUint64 (uint64_t u64)
PrettyWriterDouble (double d)
PrettyWriterString (const Ch *str, SizeType length, bool copy=false)
var String ( var str, var length, var false)
local String ( local str, local length, local false)
PrettyWriterStartObject ()
PrettyWriterEndObject (SizeType memberCount=0)
var EndObject ( var 0)
local EndObject ( local 0)
PrettyWriterStartArray ()
PrettyWriterEndArray (SizeType memberCount=0)
local EndArray ( local 0)
- Public Member Functions inherited from Writer< Stream, Encoding, Allocator >
 Writer (Stream &stream, Allocator *allocator=0, size_t levelDepth=kDefaultLevelDepth)
WriterString (const Ch *str)
 Simpler but slower overload. More...
 
WriterNull ()
WriterBool (bool b)
WriterInt (int i)
WriterUint (unsigned u)
WriterInt64 (int64_t i64)
WriterUint64 (uint64_t u64)
WriterDouble (double d)
WriterString (const Ch *str, SizeType length, bool copy=false)
local String ( local str, local length, local false)
WriterStartObject ()
WriterEndObject (SizeType memberCount=0)
WriterStartArray ()
WriterEndArray (SizeType elementCount=0)

Protected Member Functions

void PrettyPrefix (Type type)
void WriteIndent ()
- Protected Member Functions inherited from 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)
var WriteDouble ( var d)
local WriteDouble ( local 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_
local indentCharCount_
- Protected Attributes inherited from Writer< Stream, Encoding, Allocator >
Streamstream_
internal::Stack< Allocatorlevel_stack_
var level_stack_
local level_stack_

Additional Inherited Members

- Static Protected Attributes inherited from Writer< Stream, Encoding, Allocator >
static const size_t kDefaultLevelDepth = 32
local 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
StreamType of ouptut stream.
EncodingEncoding of both source strings and output.
AllocatorType of allocator for allocating memory of stack.

Member Typedef Documentation

var Base
local Base
typedef Base::Ch Ch
var Ch
local Ch

Constructor & Destructor Documentation

PrettyWriter ( Stream stream,
Allocator allocator = 0,
size_t  levelDepth = Base::kDefaultLevelDepth 
)
inline

Constructor.

Parameters
streamOutput stream.
allocatorUser supplied allocator. If it is null, it will create a private one.
levelDepthInitial capacity of
var PrettyWriter ( var  stream,
var  allocator = 0,
var  levelDepth = Base::kDefaultLevelDepth 
)
inline

Constructor.

Parameters
streamOutput stream.
allocatorUser supplied allocator. If it is null, it will create a private one.
levelDepthInitial capacity of
local PrettyWriter ( local  stream,
local  allocator = 0,
local  levelDepth = Base::kDefaultLevelDepth 
)
inline

Constructor.

Parameters
streamOutput stream.
allocatorUser supplied allocator. If it is null, it will create a private one.
levelDepthInitial capacity of

Member Function Documentation

PrettyWriter& Bool ( bool  b)
inline
var Bool ( var  b)
inline
local Bool ( local  b)
inline
PrettyWriter& Double ( double  d)
inline
var Double ( var  d)
inline
local Double ( local  d)
inline
PrettyWriter& EndArray ( SizeType  memberCount = 0)
inline
var EndArray ( var  memberCount = 0)
inline
local EndArray ( local  memberCount = 0)
inline
PrettyWriter& EndObject ( SizeType  memberCount = 0)
inline
var EndObject ( var  memberCount = 0)
inline
local EndObject ( local  memberCount = 0)
inline
PrettyWriter& Int ( int  i)
inline
var Int ( var  i)
inline
local Int ( local  i)
inline
PrettyWriter& Int64 ( int64_t  i64)
inline
var Int64 ( var  i64)
inline
local Int64 ( local  i64)
inline
PrettyWriter& Null ( )
inline
var Null ( )
inline
local Null ( )
inline
void PrettyPrefix ( Type  type)
inlineprotected
var PrettyPrefix ( var  type)
inlineprotected
local PrettyPrefix ( local  type)
inlineprotected
PrettyWriter& SetIndent ( Ch  indentChar,
unsigned  indentCharCount 
)
inline

Set custom indentation.

Parameters
indentCharCharacter for indentation. Must be whitespace character (' ', '', '
', '').
indentCharCountNumber of indent characters for each indentation level.
Note
The default indentation is 4 spaces.
var SetIndent ( var  indentChar,
var  indentCharCount 
)
inline

Set custom indentation.

Parameters
indentCharCharacter for indentation. Must be whitespace character (' ', '', '
', '').
indentCharCountNumber of indent characters for each indentation level.
Note
The default indentation is 4 spaces.
local SetIndent ( local  indentChar,
local  indentCharCount 
)
inline

Set custom indentation.

Parameters
indentCharCharacter for indentation. Must be whitespace character (' ', '', '
', '').
indentCharCountNumber of indent characters for each indentation level.
Note
The default indentation is 4 spaces.
PrettyWriter& StartArray ( )
inline
var StartArray ( )
inline
local StartArray ( )
inline
PrettyWriter& StartObject ( )
inline
var StartObject ( )
inline
local StartObject ( )
inline
PrettyWriter& String ( const Ch str,
SizeType  length,
bool  copy = false 
)
inline
var String ( var  str,
var  length,
var  copy = false 
)
inline
local String ( local  str,
local  length,
local  copy = false 
)
inline
PrettyWriter& String ( const Ch str)
inline

Simpler but slower overload.

var String ( var  str)
inline

Simpler but slower overload.

local String ( local  str)
inline

Simpler but slower overload.

PrettyWriter& Uint ( unsigned  u)
inline
var Uint ( var  u)
inline
local Uint ( local  u)
inline
PrettyWriter& Uint64 ( uint64_t  u64)
inline
var Uint64 ( var  u64)
inline
local Uint64 ( local  u64)
inline
void WriteIndent ( )
inlineprotected
var WriteIndent ( )
inlineprotected
local WriteIndent ( )
inlineprotected

Member Data Documentation

Ch indentChar_
protected
unsigned indentCharCount_
protected
var indentCharCount_
protected
local indentCharCount_
protected

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