CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
rapidjson::Writer< Stream, Encoding, Allocator > Class Template Reference

JSON writer. More...

#include <writer.h>

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

Classes

struct  Level
 Information for each nested level. More...
 

Public Types

typedef Encoding::Ch Ch
 

Public Member Functions

 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)
 
WriterStartObject ()
 
WriterEndObject (SizeType memberCount=0)
 
WriterStartArray ()
 
WriterEndArray (SizeType elementCount=0)
 

Protected Member Functions

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

Streamstream_
 
internal::Stack< Allocatorlevel_stack_
 

Static Protected Attributes

static const size_t kDefaultLevelDepth = 32
 

Detailed Description

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

JSON writer.

Writer implements the concept Handler. It generates JSON text by events to an output stream.

User may programmatically calls the functions of a writer to generate JSON text.

On the other side, a writer can also be passed to objects that generates events,

for example Reader::Parse() and Document::Accept().

Template Parameters
StreamType of ouptut stream.
EncodingEncoding of both source strings and output.

Definition at line 32 of file writer.h.

Member Typedef Documentation

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
typedef Encoding::Ch rapidjson::Writer< Stream, Encoding, Allocator >::Ch

Definition at line 34 of file writer.h.

Constructor & Destructor Documentation

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
rapidjson::Writer< Stream, Encoding, Allocator >::Writer ( Stream stream,
Allocator allocator = 0,
size_t  levelDepth = kDefaultLevelDepth 
)
inline

Definition at line 36 of file writer.h.

Member Function Documentation

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Bool ( bool  b)
inline

Definition at line 42 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Double ( double  d)
inline

Definition at line 47 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::EndArray ( SizeType  elementCount = 0)
inline

Definition at line 79 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::EndObject ( SizeType  memberCount = 0)
inline

Definition at line 63 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Int ( int  i)
inline

Definition at line 43 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Int64 ( int64_t  i64)
inline

Definition at line 45 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Null ( )
inline

Definition at line 41 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::Prefix ( Type  type)
inlineprotected

Definition at line 209 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::StartArray ( )
inline

Definition at line 72 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::StartObject ( )
inline

Definition at line 56 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::String ( const Ch str,
SizeType  length,
bool  copy = false 
)
inline

Definition at line 49 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::String ( const Ch str)
inline

Simpler but slower overload.

Definition at line 90 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Uint ( unsigned  u)
inline

Definition at line 44 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Writer& rapidjson::Writer< Stream, Encoding, Allocator >::Uint64 ( uint64_t  u64)
inline

Definition at line 46 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteBool ( bool  b)
inlineprotected

Definition at line 106 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteDouble ( double  d)
inlineprotected
Todo:
Optimization with custom double-to-string converter.

Definition at line 160 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteEndArray ( )
inlineprotected

Definition at line 207 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteEndObject ( )
inlineprotected

Definition at line 205 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteInt ( int  i)
inlineprotected

Definition at line 115 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteInt64 ( int64_t  i64)
inlineprotected

Definition at line 137 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteNull ( )
inlineprotected

Definition at line 102 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteStartArray ( )
inlineprotected

Definition at line 206 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteStartObject ( )
inlineprotected

Definition at line 204 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteString ( const Ch str,
SizeType  length 
)
inlineprotected

Definition at line 172 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteUint ( unsigned  u)
inlineprotected

Definition at line 123 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
void rapidjson::Writer< Stream, Encoding, Allocator >::WriteUint64 ( uint64_t  u64)
inlineprotected

Definition at line 145 of file writer.h.

Member Data Documentation

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
const size_t rapidjson::Writer< Stream, Encoding, Allocator >::kDefaultLevelDepth = 32
staticprotected

Definition at line 100 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
internal::Stack<Allocator> rapidjson::Writer< Stream, Encoding, Allocator >::level_stack_
protected

Definition at line 228 of file writer.h.

template<typename Stream , typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<>>
Stream& rapidjson::Writer< Stream, Encoding, Allocator >::stream_
protected

Definition at line 227 of file writer.h.


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