![]() |
helics
2.8.1
|
Go to the source code of this file.
Functions | |
bool | hasJsonExtension (const std::string &jsonString) |
Json::Value | loadJson (const std::string &jsonString) |
Json::Value | loadJsonStr (const std::string &jsonString) |
helics::Time | loadJsonTime (const Json::Value &timeElement, time_units defaultUnits=time_units::sec) |
std::string | getKey (const Json::Value &element) |
std::string | generateJsonString (const Json::Value &block) |
std::string | JsonAsString (const Json::Value &element) |
std::string | getOrDefault (const Json::Value &element, const std::string &key, const std::string &defVal) |
double | getOrDefault (const Json::Value &element, const std::string &key, double defVal) |
bool | getOrDefault (const Json::Value &element, const std::string &key, bool defVal) |
int64_t | getOrDefault (const Json::Value &element, const std::string &key, int64_t defVal) |
bool | callIfMember (const Json::Value &element, const std::string &key, const std::function< void(const std::string &, helics::Time)> &call) |
bool | callIfMember (const Json::Value &element, const std::string &key, const std::function< void(const std::string &, bool)> &call) |
bool | callIfMember (const Json::Value &element, const std::string &key, const std::function< void(const std::string &, int)> &call) |
bool | callIfMember (const Json::Value &element, const std::string &key, const std::function< void(const std::string &)> &call) |
void | replaceIfMember (const Json::Value &element, const std::string &key, helics::Time &timeVal) |
void | replaceIfMember (const Json::Value &element, const std::string &key, std::string &sval) |
void | replaceIfMember (const Json::Value &element, const std::string &key, bool &bval) |
void | replaceIfMember (const Json::Value &element, const std::string &key, int &sval) |
functions related to loading and evaluating JSON files and helper functions for reading them using the jsoncpp library
std::string generateJsonString | ( | const Json::Value & | block | ) |
generate a Json String
Referenced by helics::JsonMapBuilder::generate(), helics::JsonBuilder::generate(), helics::ActionMessage::to_json_string(), and helics::typeConvert().
std::string getKey | ( | const Json::Value & | element | ) |
get a name or key from the element
bool hasJsonExtension | ( | const std::string & | jsonString | ) |
check if the file has a valid JSON extension
Json::Value loadJson | ( | const std::string & | jsonString | ) |
load a JSON string or filename that points to a JSON file and return a JSON::Value to the root object
References loadJsonStr().
Referenced by helics::FederateInfo::loadInfoFromJson(), helics::apps::App::loadJsonFileConfiguration(), helics::ValueFederate::publishJSON(), helics::ValueFederate::registerFromPublicationJSON(), and helics::apps::BrokerServer::startServers().
Json::Value loadJsonStr | ( | const std::string & | jsonString | ) |
load a JSON object in a string
Referenced by helics::JsonMapBuilder::addComponent(), helics::ActionMessage::from_json_string(), helics::ValueConverter3< X >::interpret(), loadJson(), and helics::apps::Clone::saveFile().
helics::Time loadJsonTime | ( | const Json::Value & | timeElement, |
time_units | defaultUnits | ||
) |
read a time from a JSON value element