qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
JSON Utilities

JSON parsing, manipulation, and serialization utilities. More...

Collaboration diagram for JSON Utilities:

Files

file  json.h
 JSON utility functions and types for the qb framework.

Classes

struct  nlohmann::jsonb
 A wrapper around nlohmann::json providing a qb::jsonb type, often used for binary JSON (BSON) or similar dense representations. More...
struct  std::hash< qb::jsonb >
 Specialization of std::hash for qb::jsonb. More...

Typedefs

using nlohmann::pointer = json::pointer
 JSON pointer type from nlohmann::json library.
using nlohmann::object = json
 Alias for the main JSON type from nlohmann::json.
using nlohmann::array = json::array_t
 JSON array type from nlohmann::json.
using nlohmann::string = json::string_t
 JSON string type from nlohmann::json.
using nlohmann::number = json::number_integer_t
 JSON integer number type from nlohmann::json.
using nlohmann::floating = json::number_float_t
 JSON floating-point number type from nlohmann::json.
using nlohmann::boolean = json::boolean_t
 JSON boolean type from nlohmann::json.

Functions

void uuids::to_json (qb::json &obj, qb::uuid const &id)
 Converts a UUID to a JSON object.
void uuids::from_json (qb::json const &obj, qb::uuid &id)
 Converts a JSON object to a UUID.
std::ostream & operator<< (std::ostream &os, const qb::jsonb &j)
 Stream output operator for qb::jsonb.

Detailed Description

JSON parsing, manipulation, and serialization utilities.

Provides `qb::json`, `qb::jsonb`, and integration with the nlohmann/json library.

Typedef Documentation

◆ pointer

using nlohmann::pointer = json::pointer

JSON pointer type from nlohmann::json library.

Used for accessing nested JSON values with specific paths

◆ object

using nlohmann::object = json

Alias for the main JSON type from nlohmann::json.

Represents a complete JSON object with various value types

◆ array

using nlohmann::array = json::array_t

JSON array type from nlohmann::json.

Represents an ordered collection of JSON values

◆ string

using nlohmann::string = json::string_t

JSON string type from nlohmann::json.

Represents a string value in JSON

◆ number

using nlohmann::number = json::number_integer_t

JSON integer number type from nlohmann::json.

Represents an integer numerical value in JSON

◆ floating

using nlohmann::floating = json::number_float_t

JSON floating-point number type from nlohmann::json.

Represents a floating-point numerical value in JSON

◆ boolean

using nlohmann::boolean = json::boolean_t

JSON boolean type from nlohmann::json.

Represents a boolean value (true/false) in JSON

Function Documentation

◆ to_json()

void uuids::to_json ( qb::json & obj,
qb::uuid const & id )

Converts a UUID to a JSON object.

Serializes a qb::uuid into a JSON object for storage or transmission

Parameters
objJSON object to store the UUID in
idUUID to serialize

◆ from_json()

void uuids::from_json ( qb::json const & obj,
qb::uuid & id )

Converts a JSON object to a UUID.

Deserializes a UUID from a JSON object

Parameters
objJSON object containing the UUID data
idUUID object to populate

◆ operator<<()

std::ostream & operator<< ( std::ostream & os,
const qb::jsonb & j )
inline

Stream output operator for qb::jsonb.

Parameters
osThe output stream.
jThe qb::jsonb object to output.
Returns
Reference to the output stream.

Dumps the JSON content to the stream, typically without pretty printing.