Opt-in nlohmann/json hooks for core's value types (target snicholls::core_json).
More...
|
| file | decimal_json.hpp |
| | nlohmann/json hooks for snicholls::decimal: its exact canonical text, as a JSON string.
|
| |
| file | json.hpp |
| | snicholls::json_error and the nlohmann/json adapter layer: shared by every adapter.
|
| |
| file | secret_json.hpp |
| | nlohmann/json hook for snicholls::secret<T>: read only. A secret is never written to JSON.
|
| |
| file | time_json.hpp |
| | nlohmann/json hooks for snicholls::utc<D>: a canonical RFC 3339 string.
|
| |
| file | uuid_json.hpp |
| | nlohmann/json hooks for snicholls::uuid: the canonical lowercase 8-4-4-4-12 string.
|
| |
|
| void | snicholls::to_json (nlohmann::json &j, const decimal &d) |
| | Writes d as its canonical text, a JSON string.
|
| |
| void | snicholls::from_json (const nlohmann::json &j, decimal &d) |
| | Reads canonical decimal text from a JSON string.
|
| |
| template<typename T > |
| void | snicholls::from_json (const nlohmann::json &j, secret< T > &s) |
| | Reads a secret from JSON. There is no to_json: a secret is never written.
|
| |
| template<utc_duration D> |
| void | snicholls::to_json (nlohmann::json &j, const utc< D > &t) |
| | Writes t as its canonical RFC 3339 string.
|
| |
| template<utc_duration D> |
| void | snicholls::from_json (const nlohmann::json &j, utc< D > &t) |
| | Reads an RFC 3339 string (strict: snicholls::parse_utc<D> with default options).
|
| |
| void | snicholls::to_json (nlohmann::json &j, const uuid &u) |
| | Writes u as its canonical lowercase string.
|
| |
| void | snicholls::from_json (const nlohmann::json &j, uuid &u) |
| | Reads a canonical 8-4-4-4-12 string (either case).
|
| |
Opt-in nlohmann/json hooks for core's value types (target snicholls::core_json).
◆ from_json() [1/4]
| void snicholls::from_json |
( |
const nlohmann::json & |
j, |
|
|
decimal & |
d |
|
) |
| |
|
inline |
Reads canonical decimal text from a JSON string.
- Parameters
-
| j | the JSON value. |
| d | receives the decimal; unchanged on failure. |
- Exceptions
-
Definition at line 72 of file decimal_json.hpp.
◆ from_json() [2/4]
template<typename T >
| void snicholls::from_json |
( |
const nlohmann::json & |
j, |
|
|
secret< T > & |
s |
|
) |
| |
Reads a secret from JSON. There is no to_json: a secret is never written.
- Template Parameters
-
| T | the secret's value type, readable by j.get<T>(). |
- Parameters
-
| j | the JSON value. |
| s | receives the secret; unchanged on failure. |
- Exceptions
-
Definition at line 68 of file secret_json.hpp.
◆ from_json() [3/4]
template<utc_duration D>
| void snicholls::from_json |
( |
const nlohmann::json & |
j, |
|
|
utc< D > & |
t |
|
) |
| |
Reads an RFC 3339 string (strict: snicholls::parse_utc<D> with default options).
- Template Parameters
-
- Parameters
-
| j | the JSON value. |
| t | receives the instant; unchanged on failure. |
- Exceptions
-
Definition at line 84 of file time_json.hpp.
◆ from_json() [4/4]
| void snicholls::from_json |
( |
const nlohmann::json & |
j, |
|
|
uuid & |
u |
|
) |
| |
|
inline |
Reads a canonical 8-4-4-4-12 string (either case).
- Parameters
-
| j | the JSON value. |
| u | receives the UUID; unchanged on failure. |
- Exceptions
-
Definition at line 68 of file uuid_json.hpp.
◆ to_json() [1/3]
| void snicholls::to_json |
( |
nlohmann::json & |
j, |
|
|
const decimal & |
d |
|
) |
| |
|
inline |
Writes d as its canonical text, a JSON string.
- Parameters
-
| j | receives the string. |
| d | the decimal. |
- Exceptions
-
Definition at line 65 of file decimal_json.hpp.
◆ to_json() [2/3]
template<utc_duration D>
| void snicholls::to_json |
( |
nlohmann::json & |
j, |
|
|
const utc< D > & |
t |
|
) |
| |
Writes t as its canonical RFC 3339 string.
- Template Parameters
-
- Parameters
-
| j | receives the string. |
| t | the instant. |
- Exceptions
-
Definition at line 69 of file time_json.hpp.
◆ to_json() [3/3]
| void snicholls::to_json |
( |
nlohmann::json & |
j, |
|
|
const uuid & |
u |
|
) |
| |
|
inline |
Writes u as its canonical lowercase string.
- Parameters
-
| j | receives the string. |
| u | the UUID. |
- Exceptions
-
Definition at line 61 of file uuid_json.hpp.