![]() |
helics
2.8.1
|
Go to the source code of this file.
Functions | |
toml::value | loadToml (const std::string &tomlString) |
bool | hasTomlExtension (const std::string &tomlString) |
toml::value | loadTomlStr (const std::string &tomlString) |
std::string | tomlAsString (const toml::value &element) |
helics::Time | loadTomlTime (const toml::value &timeElement, time_units defaultUnits=time_units::sec) |
std::string | getKey (const toml::value &element) |
std::string | getOrDefault (const toml::value &element, const std::string &key, const std::string &defVal) |
double | getOrDefault (const toml::value &element, const std::string &key, double defVal) |
bool | getOrDefault (const toml::value &element, const std::string &key, bool defVal) |
int64_t | getOrDefault (const toml::value &element, const std::string &key, int64_t defVal) |
bool | callIfMember (const toml::value &element, const std::string &key, const std::function< void(const std::string &)> &call) |
bool | callIfMember (const toml::value &element, const std::string &key, const std::function< void(const std::string &, helics::Time)> &call) |
template<class X > | |
bool | callIfMember (const toml::value &element, const std::string &key, const std::function< void(const std::string &, X)> &call) |
void | replaceIfMember (const toml::value &element, const std::string &key, helics::Time &timeVal) |
void | replaceIfMember (const toml::value &element, const std::string &key, std::string &loc) |
template<class X > | |
void | replaceIfMember (const toml::value &element, const std::string &key, X &loc) |
bool | isMember (const toml::value &element, const std::string &key) |
functions related to loading and evaluating TOML files and helper functions for reading them using the toml library
|
inline |
call a function if a member element exists and pass the string to the invoked object
|
inline |
call a function if a member element exists and pass a time to the invoked object
References loadTomlTime().
|
inline |
call a function if a member element exists and pass a specific type to the invoked object
std::string getKey | ( | const toml::value & | element | ) |
get a name or key from the element
|
inline |
get a boolean value or use the default if it is not a member
|
inline |
get a string value or use the default if it is not a member
|
inline |
get a double value or use the default if it is not a member
|
inline |
get an integer value or use the default if it is not a member
|
inline |
check if a key is a member of a table object
toml::value loadToml | ( | const std::string & | tomlString | ) |
load a TOML string or filename that points to a TOML file and return a toml::Value to the root object
References loadTomlStr().
Referenced by helics::FederateInfo::loadInfoFromToml().
toml::value loadTomlStr | ( | const std::string & | tomlString | ) |
load a TOML object in a string
Referenced by loadToml().
helics::Time loadTomlTime | ( | const toml::value & | timeElement, |
time_units | defaultUnits | ||
) |
read a time from a TOML value element
read a time from a JSON value element
References tomlAsString().
Referenced by callIfMember().
std::string tomlAsString | ( | const toml::value & | element | ) |
get a toml value as a string
Referenced by loadTomlTime().