Celeritas 0.7.0-dev.130+develop.71a7ea01e
Loading...
Searching...
No Matches
Macros | Functions
OptionsIO.json.cc File Reference
#include "OptionsIO.json.hh"
#include "corecel/Assert.hh"
#include "corecel/io/EnumStringMapper.hh"
#include "corecel/io/JsonUtils.json.hh"
#include "corecel/io/StringEnumMapper.hh"
#include "orange/OrangeTypesIO.json.hh"
#include "Options.hh"

Macros

#define OPT_JSON_STRING(NAME)   CELER_JSON_PAIR_WHEN(v, NAME, !v.NAME.empty())
 
#define OPT_LOAD_OPTION(NAME)   CELER_JSON_LOAD_OPTION(j, v, NAME)
 

Functions

char constceleritas::g4org::to_cstring (InlineSingletons value)
 Get a string corresponding to an inline singletons option.
 
std::istream & celeritas::g4org::operator>> (std::istream &is, Options &inp)
 Helper to read the conversion options from a file or stream.
 
std::ostream & celeritas::g4org::operator<< (std::ostream &os, Options const &inp)
 Helper to write the options to a file or stream.
 
void celeritas::g4org::to_json (nlohmann::json &j, InlineSingletons const &v)
 
void celeritas::g4org::from_json (nlohmann::json const &j, InlineSingletons &v)
 
void celeritas::g4org::to_json (nlohmann::json &j, Options const &v)
 
void celeritas::g4org::from_json (nlohmann::json const &j, Options &v)
 

Function Documentation

◆ from_json() [1/2]

void celeritas::g4org::from_json ( nlohmann::json const j,
InlineSingletons v 
)

I/O routines for JSON

◆ from_json() [2/2]

void celeritas::g4org::from_json ( nlohmann::json const j,
Options v 
)

I/O routines for JSON

◆ operator>>()

std::istream & celeritas::g4org::operator>> ( std::istream &  is,
Options inp 
)
inline

Helper to read the conversion options from a file or stream.

Example to read from a file:

Options inp;
std::ifstream("foo.json") >> inp;

◆ to_json() [1/2]

void celeritas::g4org::to_json ( nlohmann::json &  j,
InlineSingletons const v 
)

I/O routines for JSON

◆ to_json() [2/2]

void celeritas::g4org::to_json ( nlohmann::json &  j,
Options const v 
)

I/O routines for JSON