Extension: Json and NetCDF utilities
#include "dg/file/file.h"
Loading...
Searching...
No Matches
The WrappedJsonValue class
Collaboration diagram for The WrappedJsonValue class:

Classes

struct  dg::file::WrappedJsonValue
 Wrapped Access to Json values with error handling. More...
 

Typedefs

using dg::file::JsonType = Json::Value
 Json Type to use in dg::file functions and classes.
 

Enumerations

enum class  dg::file::error { dg::file::error::is_throw , dg::file::error::is_warning , dg::file::error::is_silent }
 Switch between how to handle errors in a Json utitlity functions. More...
 
enum class  dg::file::comments { dg::file::comments::are_kept , dg::file::comments::are_discarded , dg::file::comments::are_forbidden }
 Switch how comments are treated in a json string or file. More...
 

Detailed Description

Typedef Documentation

◆ JsonType

using dg::file::JsonType = Json::Value

Json Type to use in dg::file functions and classes.

By default this typedef expands to jsoncpp's Json::Value

Note
If the Macro DG_USE_JSONHPP is defined before the inclusion of "dg/file/file.h" then the typedef expands to nlohmann::json

Enumeration Type Documentation

◆ comments

enum class dg::file::comments
strong

Switch how comments are treated in a json string or file.

Enumerator
are_kept 

Keep comments in the Json value.

are_discarded 

Allow comments but discard them in the Json value.

are_forbidden 

Treat comments as invalid Json.

◆ error

enum class dg::file::error
strong

Switch between how to handle errors in a Json utitlity functions.

Enumerator
is_throw 

throw an error (std::runtime_error)

is_warning 

Handle the error by writing a warning to std::cerr.

is_silent 

Ignore the error and silently continue execution.