![]() |
helics
3.3.0
|
#include "../core/helicsTime.hpp"
#include <string_view>
#include "toml.hpp"
#include <functional>
#include <string>
Go to the source code of this file.
Namespaces | |
helics | |
the main namespace for the helics co-simulation library User functions will be in the helics namespace with internal functions possible in a lower level namespace | |
Macros | |
#define | TOML11_USING_STRING_VIEW 1 |
Functions | |
toml::value | helics::fileops::loadToml (const std::string &tomlString) |
bool | helics::fileops::hasTomlExtension (std::string_view tomlString) |
toml::value | helics::fileops::loadTomlStr (const std::string &tomlString) |
std::string | helics::fileops::tomlAsString (const toml::value &element) |
helics::Time | helics::fileops::loadTomlTime (const toml::value &timeElement, time_units defaultUnits) |
std::string | helics::fileops::getName (const toml::value &element) |
std::string | helics::fileops::getOrDefault (const toml::value &element, const std::string &key, std::string_view defVal) |
double | helics::fileops::getOrDefault (const toml::value &element, const std::string &key, double defVal) |
bool | helics::fileops::getOrDefault (const toml::value &element, const std::string &key, bool defVal) |
int64_t | helics::fileops::getOrDefault (const toml::value &element, const std::string &key, int64_t defVal) |
bool | helics::fileops::callIfMember (const toml::value &element, const std::string &key, const std::function< void(const std::string &)> &call) |
bool | helics::fileops::callIfMember (const toml::value &element, const std::string &key, const std::function< void(const std::string &, helics::Time)> &call) |
template<class X > | |
bool | helics::fileops::callIfMember (const toml::value &element, const std::string &key, const std::function< void(const std::string &, X)> &call) |
void | helics::fileops::replaceIfMember (const toml::value &element, const std::string &key, helics::Time &timeVal) |
void | helics::fileops::replaceIfMember (const toml::value &element, const std::string &key, std::string &loc) |
template<class X > | |
void | helics::fileops::replaceIfMember (const toml::value &element, const std::string &key, X &loc) |
bool | helics::fileops::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
|
inline |
call a function if a member element exists and pass a specific type to the invoked object
std::string helics::fileops::getName | ( | 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 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 |
get a string value or use the default if it is not a member
|
inline |
check if a key is a member of a table object
References helics::fileops::isMember().
Referenced by helics::fileops::isMember().
toml::value helics::fileops::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
toml::value helics::fileops::loadTomlStr | ( | const std::string & | tomlString | ) |
load a TOML object in a string
std::invalid_argument | if the string parsing failed through toml |
helics::Time helics::fileops::loadTomlTime | ( | const toml::value & | timeElement, |
time_units | defaultUnits | ||
) |
read a time from a JSON value element
read a time from a TOML value element
std::string helics::fileops::tomlAsString | ( | const toml::value & | element | ) |
get a toml value as a string