Enumerate the set of JSON value types.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Enumerate the set of JSON value types.
-
- Classes:
-
- See also:
- Component bdljsn_json, Component bdljsn_jsonutil, bdljsn_jsonvalue
-
- Description:
- This component provides a namespace for the
enum
type bdljsn::JsonType::Enum
, which enumerates the set of fundamental JSON types in the JSON specification (see http://json.org).
-
- Enumerators:
Name Description
------------- ---------------------------------------------------
e_OBJECT A JSON object
e_ARRAY A JSON array
e_STRING A JSON string
e_NUMBER A JSON number
e_BOOLEAN true or false
e_NULL null
-
- Usage:
- This section illustrates intended use of this component.
-
- Example 1: Basic Syntax:
- The following snippets of code provide a simple illustration of using
bdljsn::JsonType
.
- First, we create a variable
value
of type bdljsn::JsonType::Enum
and initialize it with the enumerator value bdljsn::JsonType::e_STRING
: Now, we store the address of its ASCII representation in a pointer variable, asciiValue
, of type const char *
: Finally, we print value
to bsl::cout
. bsl::cout << value << bsl::endl;
This statement produces the following output on stdout
: