|
| GenericReader (const GenericReader &) |
|
GenericReader & | operator= (const GenericReader &) |
|
void | ClearStack () |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseObject (InputStream &is, Handler &handler) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseArray (InputStream &is, Handler &handler) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseNull (InputStream &is, Handler &handler) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseTrue (InputStream &is, Handler &handler) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseFalse (InputStream &is, Handler &handler) |
|
template<typename InputStream > |
unsigned | ParseHex4 (InputStream &is) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseString (InputStream &is, Handler &handler, bool isKey=false) |
|
template<unsigned parseFlags, typename SEncoding , typename TEncoding , typename InputStream , typename OutputStream > |
RAPIDJSON_FORCEINLINE void | ParseStringToStream (InputStream &is, OutputStream &os) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseNumber (InputStream &is, Handler &handler) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
void | ParseValue (InputStream &is, Handler &handler) |
|
RAPIDJSON_FORCEINLINE Token | Tokenize (Ch c) |
|
RAPIDJSON_FORCEINLINE IterativeParsingState | Predict (IterativeParsingState state, Token token) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
RAPIDJSON_FORCEINLINE IterativeParsingState | Transit (IterativeParsingState src, Token token, IterativeParsingState dst, InputStream &is, Handler &handler) |
|
template<typename InputStream > |
void | HandleError (IterativeParsingState src, InputStream &is) |
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
ParseResult | IterativeParse (InputStream &is, Handler &handler) |
|
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
class GenericReader< SourceEncoding, TargetEncoding, StackAllocator >
SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.
GenericReader parses JSON text from a stream, and send events synchronously to an object implementing Handler concept.
It needs to allocate a stack for storing a single decoded string during non-destructive parsing.
For in-situ parsing, the decoded string is directly written to the source text string, no temporary buffer is required.
A GenericReader object can be reused for parsing multiple JSON text.
- Template Parameters
-
SourceEncoding | Encoding of the input stream. |
TargetEncoding | Encoding of the parse output. |
StackAllocator | Allocator type for stack. |
Definition at line 374 of file reader.h.
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
ParseResult GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::IterativeParse |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
ParseResult GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::Parse |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inline |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<typename InputStream , typename Handler >
ParseResult GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::Parse |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inline |
Parse JSON text (with kParseDefaultFlags)
- Template Parameters
-
InputStream | Type of input stream, implementing Stream concept |
Handler | Type of handler, implementing Handler concept. |
- Parameters
-
is | Input stream to be parsed. |
handler | The handler to receive events. |
- Returns
- Whether the parsing is successful.
Definition at line 432 of file reader.h.
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseArray |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseFalse |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseNull |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseNumber |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseObject |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseString |
( |
InputStream & |
is, |
|
|
Handler & |
handler, |
|
|
bool |
isKey = false |
|
) |
| |
|
inlineprivate |
Definition at line 637 of file reader.h.
References kParseErrorTermination, kParseInsituFlag, GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::StackStream< CharType >::Length(), GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::StackStream< CharType >::Pop(), RAPIDJSON_ASSERT, RAPIDJSON_PARSE_ERROR, and SizeType.
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename SEncoding , typename TEncoding , typename InputStream , typename OutputStream >
RAPIDJSON_FORCEINLINE void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseStringToStream |
( |
InputStream & |
is, |
|
|
OutputStream & |
os |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseTrue |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |
template<typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
void GenericReader< SourceEncoding, TargetEncoding, StackAllocator >::ParseValue |
( |
InputStream & |
is, |
|
|
Handler & |
handler |
|
) |
| |
|
inlineprivate |