Torque2D Reference
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PrettyWriter< OutputStream, SourceEncoding, TargetEncoding, Allocator > Class Template Reference

Writer with indentation and spacing. More...

#include <prettywriter.h>

+ Inheritance diagram for PrettyWriter< OutputStream, SourceEncoding, TargetEncoding, Allocator >:

Public Types

typedef Writer< OutputStream, SourceEncoding, TargetEncoding, AllocatorBase
 
typedef Base::Ch Ch
 
- Public Types inherited from Writer< OutputStream, SourceEncoding, TargetEncoding, Allocator >
typedef SourceEncoding::Ch Ch
 

Public Member Functions

 PrettyWriter (OutputStream &os, 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)
 
PrettyWriterInt (int i)
 
PrettyWriterUint (unsigned u)
 
PrettyWriterInt64 (int64_t i64)
 
PrettyWriterUint64 (uint64_t u64)
 
PrettyWriterDouble (double d)
 
PrettyWriterString (const Ch *str, SizeType length, bool copy=false)
 
PrettyWriterStartObject ()
 
PrettyWriterEndObject (SizeType memberCount=0)
 
PrettyWriterStartArray ()
 
PrettyWriterEndArray (SizeType memberCount=0)
 
- Public Member Functions inherited from Writer< OutputStream, SourceEncoding, TargetEncoding, Allocator >
 Writer (OutputStream &os, 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)
 
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< OutputStream, SourceEncoding, TargetEncoding, 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 Writer< OutputStream, SourceEncoding, TargetEncoding, Allocator >
OutputStream & os_
 
internal::Stack< Allocatorlevel_stack_
 

Additional Inherited Members

- Static Protected Attributes inherited from Writer< OutputStream, SourceEncoding, TargetEncoding, Allocator >
static const size_t kDefaultLevelDepth = 32
 

Detailed Description

template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
class rapidjson::PrettyWriter< OutputStream, SourceEncoding, TargetEncoding, Allocator >

Writer with indentation and spacing.

Template Parameters
OutputStreamType of ouptut os.
EncodingEncoding of both source strings and output.
AllocatorType of allocator for allocating memory of stack.

Member Typedef Documentation

typedef Writer<OutputStream, SourceEncoding, TargetEncoding, Allocator> Base
typedef Base::Ch Ch

Constructor & Destructor Documentation

PrettyWriter ( OutputStream &  os,
Allocator allocator = 0,
size_t  levelDepth = Base::kDefaultLevelDepth 
)
inline

Constructor.

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

Member Function Documentation

PrettyWriter& Bool ( bool  b)
inline
PrettyWriter& Double ( double  d)
inline
PrettyWriter& EndArray ( SizeType  memberCount = 0)
inline
PrettyWriter& EndObject ( SizeType  memberCount = 0)
inline
PrettyWriter& Int ( int  i)
inline
PrettyWriter& Int64 ( int64_t  i64)
inline
PrettyWriter& Null ( )
inline
void PrettyPrefix ( Type  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.
PrettyWriter& StartArray ( )
inline
PrettyWriter& StartObject ( )
inline
PrettyWriter& String ( const Ch str,
SizeType  length,
bool  copy = false 
)
inline
PrettyWriter& String ( const Ch str)
inline

Simpler but slower overload.

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

Member Data Documentation

Ch indentChar_
protected
unsigned indentCharCount_
protected

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