|
| GenericReader (StackAllocator *stackAllocator=0, size_t stackCapacity=kDefaultStackCapacity) |
| Constructor.
|
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
ParseResult | Parse (InputStream &is, Handler &handler) |
| Parse JSON text.
|
|
template<typename InputStream , typename Handler > |
ParseResult | Parse (InputStream &is, Handler &handler) |
| Parse JSON text (with kParseDefaultFlags)
|
|
void | IterativeParseInit () |
| Initialize JSON text token-by-token parsing.
|
|
template<unsigned parseFlags, typename InputStream , typename Handler > |
bool | IterativeParseNext (InputStream &is, Handler &handler) |
| Parse one token from JSON text.
|
|
RAPIDJSON_FORCEINLINE bool | IterativeParseComplete () const |
| Check if token-by-token parsing JSON text is complete.
|
|
bool | HasParseError () const |
| Whether a parse error has occurred in the last parsing.
|
|
ParseErrorCode | GetParseErrorCode () const |
| Get the ParseErrorCode of last parsing.
|
|
size_t | GetErrorOffset () const |
| Get the position of last parsing error in input, 0 otherwise.
|
|
|
enum | IterativeParsingState {
IterativeParsingFinishState = 0
, IterativeParsingErrorState
, IterativeParsingStartState
, IterativeParsingObjectInitialState
,
IterativeParsingMemberKeyState
, IterativeParsingMemberValueState
, IterativeParsingObjectFinishState
, IterativeParsingArrayInitialState
,
IterativeParsingElementState
, IterativeParsingArrayFinishState
, IterativeParsingValueState
, IterativeParsingElementDelimiterState
,
IterativeParsingMemberDelimiterState
, IterativeParsingKeyValueDelimiterState
, cIterativeParsingStateCount
} |
|
enum | Token {
LeftBracketToken = 0
, RightBracketToken
, LeftCurlyBracketToken
, RightCurlyBracketToken
,
CommaToken
, ColonToken
, StringToken
, FalseToken
,
TrueToken
, NullToken
, NumberToken
, kTokenCount
} |
|
|
| GenericReader (const GenericReader &) |
|
GenericReader & | operator= (const GenericReader &) |
|
void | ClearStack () |
|
template<unsigned parseFlags, typename InputStream > |
void | SkipWhitespaceAndComments (InputStream &is) |
|
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, size_t escapeOffset) |
|
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) const |
|
RAPIDJSON_FORCEINLINE IterativeParsingState | Predict (IterativeParsingState state, Token token) const |
|
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) |
|
RAPIDJSON_FORCEINLINE bool | IsIterativeParsingDelimiterState (IterativeParsingState s) const |
|
RAPIDJSON_FORCEINLINE bool | IsIterativeParsingCompleteState (IterativeParsingState s) const |
|
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.
- Paramètres du template
-
SourceEncoding | Encoding of the input stream. |
TargetEncoding | Encoding of the parse output. |
StackAllocator | Allocator type for stack. |
Définition à la ligne 539 du fichier reader.h.
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 |