![]() |
helics
3.6.1
|
#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) |
| bool | helics::fileops::looksLikeConfigToml (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=time_units::sec) |
| 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
References helics::fileops::loadTomlTime().
|
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
References helics::fileops::tomlAsString().
| bool helics::fileops::hasTomlExtension | ( | std::string_view | tomlString | ) |
return true if the string has a toml extension
|
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
References helics::fileops::loadToml().
Referenced by helics::fileops::loadToml().
| 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 |
References helics::fileops::loadTomlStr().
Referenced by helics::fileops::loadTomlStr().
| helics::Time helics::fileops::loadTomlTime | ( | const toml::value & | timeElement, |
| time_units | defaultUnits = time_units::sec |
||
| ) |
read a time from a TOML value element
References helics::fileops::loadTomlTime().
Referenced by helics::fileops::callIfMember(), and helics::fileops::loadTomlTime().
| bool helics::fileops::looksLikeConfigToml | ( | std::string_view | tomlString | ) |
check if the string looks like a possible config object in toml format
| std::string helics::fileops::tomlAsString | ( | const toml::value & | element | ) |
get a toml value as a string
References helics::fileops::tomlAsString().
Referenced by helics::fileops::getOrDefault(), and helics::fileops::tomlAsString().