Celeritas  0.5.0-56+6b053cd
Functions
JsonUtils.json.cc File Reference
#include "JsonUtils.json.hh"
#include "corecel/Assert.hh"
#include "corecel/Types.hh"
#include "corecel/sys/Version.hh"
#include "Logger.hh"

Functions

void celeritas::warn_deprecated_json_option (char const *old_name, char const *new_name)
 Print a warning about a deprecated input option.
 
void celeritas::save_format (nlohmann::json &j, std::string const &format)
 Save a format and version marker. More...
 
void celeritas::save_units (nlohmann::json &j)
 Save units for provenance/reproducibility.
 
void celeritas::check_format (nlohmann::json const &j, std::string_view format)
 Load and check for a format and compatible version marker.
 
void celeritas::check_units (nlohmann::json const &j, std::string_view format)
 Check units for consistency.
 

Function Documentation

◆ save_format()

void celeritas::save_format ( nlohmann::json &  j,
std::string const &  format 
)

Save a format and version marker.

This should be only used for JSON structs intended for input in addition to output. Format strings should be all lowercase with hyphens for consistency.