namespace Gambit::NodeUtility

[No description available]

Functions

Name
template <class TYPE >
TYPE
safeIntegerTypeCast(const std::string & s)
voidautoExpandEnvironmentVariables(std::string & text)
Expand environment variables in the given string.
voidremoveCharsFromString(std::string & text, const char * charsToRemove)
Remove characters in the given string.
std::stringexpandEnvironmentVariables(const std::string & input)
template <class TYPE >
TYPE
getNode(const YAML::Node node)
intgetNode< int >(const YAML::Node node)
unsigned intgetNode< unsigned int >(const YAML::Node node)
See int specialization.
longgetNode< long >(const YAML::Node node)
See int specialization.
unsigned longgetNode< unsigned long >(const YAML::Node node)
See int specialization.
long longgetNode< long long >(const YAML::Node node)
See int specialization.
unsigned long longgetNode< unsigned long long >(const YAML::Node node)
See int specialization.
std::stringgetNode< std::string >(const YAML::Node node)

Functions Documentation

function safeIntegerTypeCast

template <class TYPE >
TYPE safeIntegerTypeCast(
    const std::string & s
)

Wrapper for integer type casts from a double in string representation. It does first try to safely convert the string to a double and then performs checks before casting to an integer type.

function autoExpandEnvironmentVariables

void autoExpandEnvironmentVariables(
    std::string & text
)

Expand environment variables in the given string.

function removeCharsFromString

void removeCharsFromString(
    std::string & text,
    const char * charsToRemove
)

Remove characters in the given string.

function expandEnvironmentVariables

std::string expandEnvironmentVariables(
    const std::string & input
)

Leave input alone and return new string, which has environment variables substituted and escpae characters removed.

function getNode

template <class TYPE >
TYPE getNode(
    const YAML::Node node
)

Wrapper for reading the node for a given type. Default case does nothing. However in some instances we want to catch the yamlcpp exception and try to interpret it, e.g. scientific notation numbers as integers.

function getNode< int >

inline int getNode< int >(
    const YAML::Node node
)

Allows to read scientific notation integer numbers. If the number does not fit into the given type (here int) or is not an integer, this function will raise. This exception is then caught by getValue and handled.

function getNode< unsigned int >

inline unsigned int getNode< unsigned int >(
    const YAML::Node node
)

See int specialization.

function getNode< long >

inline long getNode< long >(
    const YAML::Node node
)

See int specialization.

function getNode< unsigned long >

inline unsigned long getNode< unsigned long >(
    const YAML::Node node
)

See int specialization.

function getNode< long long >

inline long long getNode< long long >(
    const YAML::Node node
)

See int specialization.

function getNode< unsigned long long >

inline unsigned long long getNode< unsigned long long >(
    const YAML::Node node
)

See int specialization.

function getNode< std::string >

inline std::string getNode< std::string >(
    const YAML::Node node
)

Read string and expand environment variables of the type ${MYVAR}. Expansion of environment variables is not performed if given as $MYVAR and ${MYVAR}.


Updated on 2023-06-26 at 21:36:52 +0000