• Home
  • Raw
  • Download

Lines Matching refs:JSON

3 …tp://en.wikipedia.org/wiki/Simple_API_for_XML). We borrowed this term for JSON parsing and generat…
5 …>`) is the SAX-style parser for JSON, and `Writer` (typedef of `GenericWriter<...>`) is the SAX-st…
11 …eader` parses a JSON from a stream. While it reads characters from the stream, it analyze the char…
13 For example, here is a JSON.
27 While a `Reader` parses this JSON, it publishes the following events to the handler sequentially:
53 These events can be easily matched with the JSON, except some event parameters need further explana…
118 `Null()` is called when the `Reader` encounters a JSON null value.
120 `Bool(bool)` is called when the `Reader` encounters a JSON true or false value.
122 When the `Reader` encounters a JSON number, it chooses a suitable C++ type mapping. And then it cal…
126 …unters the beginning of an object, it calls `StartObject()`. An object in JSON is a set of name-va…
132 For example, when we parse a JSON with `Reader` and the handler detected that the JSON does not con…
151 …source and target encoding. The source encoding means the encoding in the JSON stream. The target …
163 The one and only one function of `Reader` is to parse JSON.
178 `Reader` converts (parses) JSON into events. `Writer` does exactly the opposite. It converts events…
180 `Writer` is very easy to use. If your application only need to converts some data into JSON, it may…
228 You may doubt that, why not just using `sprintf()` or `std::stringstream` to build a JSON?
231 1. `Writer` must output a well-formed JSON. If there is incorrect event sequence (e.g. `Int()` just…
237 Anyway, using `Writer` API is even simpler than generating a JSON by ad hoc methods.
268 While the output of `Writer` is the most condensed JSON without white-spaces, suitable for network …
276JSON, which can be any JSON type at the root. Once the singular event for root (e.g. `String()`), …
278 When a JSON is complete, the `Writer` cannot accept any new events. Otherwise the output will be in…
282 ## Parsing JSON to Custom Data Structure {#CustomDataStructure}
288 In the following `messagereader` example, `ParseMessages()` parses a JSON which should be an object…
369 cout << endl << "Parse a JSON with invalid schema." << endl;
383 Parse a JSON with invalid schema.
389JSON (`json1`) was successfully parsed into `MessageMap`. Since `MessageMap` is a `std::map`, the …
391 In the second JSON (`json2`), `foo`'s value is an empty object. As it is an object, `MessageHandler…
393 ## Filtering of JSON {#Filtering}
395 …paces in JSON. `pretty` example uses the same relationship, but replacing `Writer` by `PrettyWrite…
397 …) to filter the contents of JSON via these SAX-style API. For example, `capitalize` example capita…
439 // Prepare JSON reader and input stream.
444 // Prepare JSON writer and output stream.
449 // JSON reader parse from the input stream and let writer generate the output.
460 Note that, it is incorrect to simply capitalize the JSON as a string. For example:
465 Simply capitalizing the whole JSON would contain incorrect escape character: