rapidjson Namespace Reference

Namespaces

 internal
 

Classes

class  GenericValue
 Represents a JSON value. Use Value for UTF8 encoding and default allocator. More...
 
class  GenericDocument
 A document for parsing JSON text as DOM. More...
 
class  FileStream
 Wrapper of C file stream for input or output. More...
 
class  GenericReadStream
 Wrapper of std::istream for input. More...
 
class  GenericWriteStream
 Wrapper of std::ostream for output. More...
 
class  PrettyWriter
 Writer with indentation and spacing. More...
 
class  CrtAllocator
 C-runtime library allocator. More...
 
class  MemoryPoolAllocator
 Default memory allocator used by the parser and DOM. More...
 
struct  UTF8
 UTF-8 encoding. More...
 
struct  UTF16
 UTF-16 encoding. More...
 
struct  UTF32
 UTF-32 encoding. More...
 
struct  GenericStringStream
 Read-only string stream. More...
 
struct  GenericInsituStringStream
 A read-write string stream. More...
 
struct  BaseReaderHandler
 Default implementation of Handler. More...
 
class  GenericReader
 SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator. More...
 
struct  GenericStringBuffer
 Represents an in-memory output stream. More...
 
class  Writer
 JSON writer. More...
 

Typedefs

typedef GenericValue< UTF8<> > Value
 Value with UTF8 encoding. More...
 
typedef GenericDocument< UTF8<> > Document
 
typedef unsigned SizeType
 Use 32-bit array/string indices even for 64-bit platform, instead of using size_t. More...
 
typedef GenericStringStream< UTF8<> > StringStream
 
typedef GenericInsituStringStream< UTF8<> > InsituStringStream
 
typedef GenericReader< UTF8<> > Reader
 Reader with UTF8 encoding and default allocator. More...
 
typedef GenericStringBuffer< UTF8<> > StringBuffer
 

Enumerations

enum  Type {
  kNull_Type = 0 , kFalseType = 1 , kTrueType = 2 , kObjectType = 3 ,
  kArrayType = 4 , kStringType = 5 , kNumberType = 6
}
 Type of JSON value. More...
 
enum  ParseFlag { kParseDefaultFlags = 0 , kParseInsituFlag = 1 }
 Combination of parseFlags. More...
 

Functions

template<>
void PutN (GenericWriteStream &stream, char c, size_t n)
 
template<typename Stream , typename Ch >
void PutN (Stream &stream, Ch c, size_t n)
 Put N copies of a character to a stream. More...
 
template<typename Stream >
void SkipWhitespace (Stream &stream)
 Skip the JSON white spaces in a stream. More...
 
template<>
void PutN (GenericStringBuffer< UTF8<> > &stream, char c, size_t n)
 Implement specialized version of PutN() with memset() for better performance. More...
 

Typedef Documentation

◆ Document

◆ InsituStringStream

◆ Reader

Reader with UTF8 encoding and default allocator.

◆ SizeType

typedef unsigned rapidjson::SizeType

Use 32-bit array/string indices even for 64-bit platform, instead of using size_t.

User may override the SizeType by defining RAPIDJSON_NO_SIZETYPEDEFINE.

◆ StringBuffer

◆ StringStream

◆ Value

Value with UTF8 encoding.

Enumeration Type Documentation

◆ ParseFlag

Combination of parseFlags.

Enumerator
kParseDefaultFlags 

Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer.

kParseInsituFlag 

In-situ(destructive) parsing.

67  {
68  kParseDefaultFlags = 0,
69  kParseInsituFlag = 1
70 };
@ kParseInsituFlag
In-situ(destructive) parsing.
Definition: reader.h:69
@ kParseDefaultFlags
Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer.
Definition: reader.h:68

◆ Type

Type of JSON value.

Enumerator
kNull_Type 

null

kFalseType 

false

kTrueType 

true

kObjectType 

object

kArrayType 

array

kStringType 

string

kNumberType 

number

538  {
539  kNull_Type = 0,
540  kFalseType = 1,
541  kTrueType = 2,
542  kObjectType = 3,
543  kArrayType = 4,
544  kStringType = 5,
545  kNumberType = 6,
546 };
@ kArrayType
array
Definition: rapidjson.h:543
@ kNull_Type
null
Definition: rapidjson.h:539
@ kTrueType
true
Definition: rapidjson.h:541
@ kFalseType
false
Definition: rapidjson.h:540
@ kNumberType
number
Definition: rapidjson.h:545
@ kObjectType
object
Definition: rapidjson.h:542
@ kStringType
string
Definition: rapidjson.h:544

Function Documentation

◆ PutN() [1/3]

template<>
void rapidjson::PutN ( GenericStringBuffer< UTF8<> > &  stream,
char  c,
size_t  n 
)
inline

Implement specialized version of PutN() with memset() for better performance.

68  {
69  memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
70 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32

References n.

◆ PutN() [2/3]

template<>
void rapidjson::PutN ( GenericWriteStream stream,
char  c,
size_t  n 
)
inline
113  {
114  stream.PutN(c, n);
115  }

References n, and rapidjson::GenericWriteStream::PutN().

Referenced by rapidjson::PrettyWriter< Stream, Encoding, Allocator >::WriteIndent().

◆ PutN() [3/3]

template<typename Stream , typename Ch >
void rapidjson::PutN ( Stream stream,
Ch  c,
size_t  n 
)
inline

Put N copies of a character to a stream.

473  {
474  for (size_t i = 0; i < n; i++)
475  stream.Put(c);
476 }
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References constants::i, and n.

◆ SkipWhitespace()

template<typename Stream >
void rapidjson::SkipWhitespace ( Stream stream)

Skip the JSON white spaces in a stream.

Parameters
streamA input stream for skipping white spaces.
Note
This function has SSE2/SSE4.2 specialization.
130  {
131  Stream s = stream; // Use a local copy for optimization
132  while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
133  s.Take();
134  stream = s;
135 }
Concept for reading and writing characters.

Referenced by rapidjson::GenericReader< Encoding, Allocator >::Parse(), rapidjson::GenericReader< Encoding, Allocator >::ParseArray(), and rapidjson::GenericReader< Encoding, Allocator >::ParseObject().