File: json.dox

package info (click to toggle)
ola 0.10.7.nojsmin-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,252 kB
  • sloc: cpp: 131,729; python: 13,127; sh: 4,590; ansic: 2,179; java: 518; xml: 253; makefile: 142
file content (38 lines) | stat: -rw-r--r-- 991 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
 * @defgroup json JSON
 * @brief JSON based APIs.
 *
 * The ola::web namespace provides:
 *   - Classes for parsing and serializing JSON (RFC 7159)
 *   - Implementation of JSON pointers (RFC 6901)
 *   - Classes for applying JSON Patch documents (RFC 6902)
 *   - A JSON Schema validator (http://www.json-schema.org).
 *
 * @par Serialization Example
 *
 * ~~~~~~~~~~~~~~~~~~~~~
   \#include <ola/web/Json.h>
   \#include <ola/web/JsonWriter.h>

   JsonObject obj;
   obj.Add("name", "simon");
   obj.Add("age", 10);
   obj.Add("male", true);
   JsonArray *friends = obj.AddArray("friends");
   friends->Add("Peter");
   friends->Add("Bob");
   friends->Add("Jane");

   const std::string output = JsonWriter::AsString(json);
   ~~~~~~~~~~~~~~~~~~~~~
 *
 * @par Parsing Example
 *
 * ~~~~~~~~~~~~~~~~~~~~~
   \#include <ola/web/Json.h>
   \#include <ola/web/JsonParser.h>

   std::string error;
   JsonValue *value = JsonParser::Parse(json_string, &error);
   ~~~~~~~~~~~~~~~~~~~~~
 */