Skip to content

Commit

Permalink
Add RAPIDJSON_PARSE_DEFAULT_FLAGS for customizing kParseDefaultFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Nov 30, 2014
1 parent 0a17e1a commit 23b7a5e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions include/rapidjson/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,27 @@ RAPIDJSON_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// ParseFlag

/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS
\ingroup RAPIDJSON_CONFIG
\brief User-defined kParseDefaultFlags definition.
User can define this as any \c ParseFlag combinations.
*/
#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS
#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags
#endif

//! Combination of parseFlags
/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream
*/
enum ParseFlag {
kParseDefaultFlags = 0, //!< Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer.
kParseNoFlags = 0, //!< No flags are set.
kParseInsituFlag = 1, //!< In-situ(destructive) parsing.
kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings.
kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing.
kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error.
kParseFullPrecisionFlag = 16 //!< Parse number in full precision (but slower).
kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower).
kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS
};

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 23b7a5e

Please sign in to comment.