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 88 of file fwd.h.
template<typename SourceEncoding , typename TargetEncoding , typename StackAllocator = CrtAllocator>
template<unsigned parseFlags, typename InputStream , typename Handler >
Parse JSON text.
- Template Parameters
-
parseFlags | Combination of ParseFlag. |
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 485 of file reader.h.
template<typename SourceEncoding , typename TargetEncoding , typename StackAllocator = CrtAllocator>
template<typename InputStream , typename Handler >
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 526 of file reader.h.