Components providing JSON parsing and generation facilities.

Types

Name

Description

Error

This unconstrained (value‐semantic) attribute class specifies a description of an error in processing a (JSON) document. See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

Json

This type is designed to be a thin wrapper around a variant of the possible JSON types, using a BDE‐style variant interface.

JsonArray

This type is designed to replicate much of the standard sequence container interface, eliding interfaces that are less relevant for a non‐generic container. Note that a bsl::vector is chosen for the implementation because our implementation permits the element type to be incomplete (when just spelling the type name).

JsonNull

This type represents the JSON null value. There is only 1 value of this type, so all objects compare equal, hash to the same value, etc.

JsonNumber

This class defines a value‐semantic class that represents a JSON number. Objects of this class have a value determined at construction and does not change except by assignment from or swap with another JsonNumber object. The value can be specified by supplying a string that conforms to the {JSON Textual Specification} or from one of the {Supported Types}. The value of a JSON object can be converted to any of those types; however, some of those conversions can be inexact.

JsonObject

This type is designed to replicate much of the standard associative container interface, eliding interfaces that are less relevant for a non‐generic container, like hasher and comparator access, emplacement, nodes, capacity management, etc.

JsonObject_MemberInitializer

This component‐private class is designed capture a set of values that can be used to initialize an element in a JsonObject. The purpose here is to enable list‐initialization (including nested lists) of JSON objects.

JsonTestSuiteUtil

This utility struct provides a namespace for the test points of the JSON Test Suite.

JsonType

This struct provides a namespace for enumerating the set value types of the JSON language. See Enum in the TYPES sub‐section for details.

JsonUtil

This struct provides a namespace for utility functions that provide read and write operations to/from Json objects.

Json_ConstructVisitor

This component‐private class is used to construct a Json object from a Json_Initializer object. Json_Initializer is a variant class defined below.

Json_Initializer

This component‐private class is designed capture a set of values that can be used to initialize a Json object, or an element in a JsonArray, or the "value" portion of a JsonObject member. This class is not modifiable, and (except for small types like int) does not own the objects that it holds. The purpose here is to enable list‐initialization (including nested lists) of Json, JsonArray, and JsonObject objects. The lifetime of a Json_Initializer object should not exceed that of list‐initialization expression because pointers held here would no longer be valid.

Json_StringInvariantGuard

This is a component‐private guard class.

Json_VisitUtil

The Json_VisitUtil type.

Location

This unconstrained (value‐semantic) attribute class specifies a location in a (JSON) document. See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

NumberUtil

This struct provides a namespace for a suite of functions that convert between a JSON formated numeric value and various numerical types. The valid syntax for a JSON formatted numeric value is spelled out in https://www.rfc‐editor.org/rfc/rfc8259#section‐6.

NumberUtil_IsSigned

This class will be a bsl::true_type if the specified (template parameter type) t_TYPE is a signed type, and bsl::false_type otherwise. t_TYPE shall be an integral type. Note that currently bsl::is_signed is not available for C++03 platforms.

ReadOptions

This simply constrained (value‐semantic) attribute class specifies options for reading a JSON document. See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

StringUtil

This class provides utility functions for converting arbitrary UTF‐8 sequences into JSON strings and visa versa. See []Strings) for details of these transformations.

Tokenizer

This class provides a mechanism for traversing JSON data stored in a bsl::streambuf one node at a time and allows clients to access the data associated with that node, including its type and data value.

WriteOptions

This simply constrained (value‐semantic) attribute class specifies options for writing a JSON document. See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

WriteStyle

This struct provides a namespace for enumerating the formatting styles that can be used for writing a JSON document. See Enum in the TYPES sub‐section for details.

Functions

Name

Description

hashAppend

hashAppend overloads

operator""_json

Return a bdljsn::Json object having the value of the JSON described in the specified text of the specified numBytes. If text is not a valid JSON document then invoke the currently installed bsls::Assert failure handler.

swap

swap overloads

operator<<

Stream insertion operators

operator==

Equality operators

operator!=

Inequality operators

Variables

Name

Description

jsonNull

The singular value of the JsonNull type.

Created with MrDocs