Lines Matching +full:parse +full:- +full:json
1 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
19 // Disable warning C4251: <data member>: <type> needs to have dll-interface to
28 namespace Json {
30 /** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
41 /** \brief An error tagged with where in the JSON text it was encountered.
62 /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
65 * \param document UTF-8 encoded string containing the document
76 bool parse(const std::string& document, Value& root,
79 /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
82 * \param beginDoc Pointer on the beginning of the UTF-8 encoded
84 * \param endDoc Pointer on the end of the UTF-8 encoded string
95 bool parse(const char* beginDoc, const char* endDoc, Value& root,
98 /// \brief Parse from input stream.
99 /// \see Json::operator>>(std::istream&, Json::Value&).
100 bool parse(IStream& is, Value& root, bool collectComments = true);
126 * errors. This can occur if the parser recovers from a non-fatal parse
133 * \param value JSON Value location associated with the error
142 * \param value JSON Value location associated with the error
144 * \param extra Additional JSON Value location to contextualize the error
242 /** Interface for reading JSON from a char array.
247 /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
248 * document. The document must be a UTF-8 encoded string containing the
251 * \param beginDoc Pointer on the beginning of the UTF-8 encoded string
253 * \param endDoc Pointer on the end of the UTF-8 encoded string of the
263 virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
280 * using namespace Json;
290 // Note: We use a Json::Value so that we can add data-members to this class
293 * These are case-sensitive.
294 * Available settings (case-sensitive):
295 * - `"collectComments": false or true`
296 * - true to collect comment and allow writing them back during
299 * - `"allowComments": false or true`
300 * - true if comments are allowed.
301 * - `"allowTrailingCommas": false or true`
302 * - true if trailing commas in objects and arrays are allowed.
303 * - `"strictRoot": false or true`
304 * - true if root must be either an array or an object value
305 * - `"allowDroppedNullPlaceholders": false or true`
306 * - true if dropped null placeholders are allowed. (See
308 * - `"allowNumericKeys": false or true`
309 * - true if numeric object keys are allowed.
310 * - `"allowSingleQuotes": false or true`
311 * - true if '' are allowed for strings (both keys and values)
312 * - `"stackLimit": integer`
313 * - Exceeding stackLimit (recursive depth of `readValue()`) will cause an
315 * - This is a security issue (seg-faults caused by deeply nested JSON), so
317 * - `"failIfExtra": false or true`
318 * - If true, `parse()` returns false when extra non-whitespace trails the
319 * JSON value in the input string.
320 * - `"rejectDupKeys": false or true`
321 * - If true, `parse()` returns false when a key is duplicated within an
323 * - `"allowSpecialFloats": false or true`
324 * - If true, special float values (NaNs and infinities) are allowed and
326 * - `"skipBom": false or true`
327 * - If true, if the input starts with the Unicode byte order mark (BOM),
331 * write and read them just like any JSON Value.
334 Json::Value settings_;
344 bool validate(Json::Value* invalid) const;
351 * \pre 'settings' != NULL (but Json::null is fine)
355 static void setDefaults(Json::Value* settings);
357 * \pre 'settings' != NULL (but Json::null is fine)
361 static void strictMode(Json::Value* settings);
373 * Always keep comments from the input JSON.
375 * This can be used to read a file into a particular sub-object.
378 * Json::Value root;
387 * // The input stream JSON would be nested here.
392 * \throw std::exception on parse error.
393 * \see Json::operator<<()
397 } // namespace Json