cppfig 0.1.0
Modern C++20 compile-time type-safe configuration library
Loading...
Searching...
No Matches
cppfig::JsonSerializer Struct Reference

JSON serializer using nlohmann::json. More...

#include <json.h>

Public Types

using data_type = Value
 

Static Public Member Functions

static auto Parse (std::istream &is) -> StatusOr< Value >
 Parses JSON from an input stream.
 
static auto ParseString (std::string_view str) -> StatusOr< Value >
 Parses JSON from a string.
 
static auto Stringify (const Value &data, int indent=4) -> std::string
 Converts a Value tree to a formatted JSON string.
 

Detailed Description

JSON serializer using nlohmann::json.

Converts between cppfig::Value trees and JSON file format.

Member Typedef Documentation

◆ data_type

Member Function Documentation

◆ Parse()

static auto cppfig::JsonSerializer::Parse ( std::istream &  is) -> StatusOr<Value>
inlinestatic

Parses JSON from an input stream.

◆ ParseString()

static auto cppfig::JsonSerializer::ParseString ( std::string_view  str) -> StatusOr<Value>
inlinestatic

Parses JSON from a string.

◆ Stringify()

static auto cppfig::JsonSerializer::Stringify ( const Value data,
int  indent = 4 
) -> std::string
inlinestatic

Converts a Value tree to a formatted JSON string.


The documentation for this struct was generated from the following file: