PhyStar  v0.0.0 thu24
tml Namespace Reference

Typedefs

using tmlnode = toml::node_view< toml::node >
 

Functions

template<typename T >
readValue (const toml::node_view< toml::node > &node)
 read value from a toml node More...
 
template<typename T >
readValue (const toml::node_view< toml::node > &node, T default_value)
 read value from a toml node More...
 
template<typename T >
readValue (toml::table *table, std::string key, T default_value)
 Read value from toml table. More...
 
template<typename T >
readValue (toml::table *table, std::string key)
 Read value from toml table. More...
 
template<typename T >
std::vector< T > readVec (const toml::node_view< toml::node > &node)
 load a 1-D std::vector from a toml array More...
 
template<typename T >
std::vector< T > readVec (const toml::node_view< toml::node > &node, const std::vector< T > &default_vec)
 load a 1-D std::vector from a toml array with default value More...
 
template<typename T >
std::vector< T > readVec (toml::table *table, std::string key)
 load a 1-D std::vector from a toml array More...
 
template<typename T >
std::vector< T > readVec (toml::table *table, std::string key, const std::vector< T > &default_vec)
 load a 1-D std::vector from a toml array, with default value More...
 

Typedef Documentation

◆ tmlnode

using tml::tmlnode = typedef toml::node_view<toml::node>

Function Documentation

◆ readValue() [1/4]

template<typename T >
T tml::readValue ( const toml::node_view< toml::node > &  node)

read value from a toml node

read intergral value from a toml node

read floating point value from a toml node

Template Parameters
Tdata type
Parameters
node
Returns
T

◆ readValue() [2/4]

template<typename T >
T tml::readValue ( const toml::node_view< toml::node > &  node,
default_value 
)

read value from a toml node

Template Parameters
Tdata type
Parameters
node
default_value
Returns
T

◆ readValue() [3/4]

template<typename T >
T tml::readValue ( toml::table *  table,
std::string  key 
)

Read value from toml table.

Template Parameters
datatype
Parameters
tabletoml table
keykeyname
Returns
T

◆ readValue() [4/4]

template<typename T >
T tml::readValue ( toml::table *  table,
std::string  key,
default_value 
)

Read value from toml table.

Template Parameters
datatype
Parameters
tabletoml table
keykeyname
default_valuethe return is assigned as the default_value if the key is not defined in toml
Returns
T

◆ readVec() [1/4]

template<typename T >
std::vector<T> tml::readVec ( const toml::node_view< toml::node > &  node)

load a 1-D std::vector from a toml array

Template Parameters
Ttypename
Parameters
tablethe toml table
keythe key that contains an array
Returns
std::vector<T>

◆ readVec() [2/4]

template<typename T >
std::vector<T> tml::readVec ( const toml::node_view< toml::node > &  node,
const std::vector< T > &  default_vec 
)

load a 1-D std::vector from a toml array with default value

Template Parameters
Ttypename
Parameters
tablethe toml table
keythe key that contains an array
default_vecdefulat vector if reading is failed
Returns
std::vector<T>

◆ readVec() [3/4]

template<typename T >
std::vector<T> tml::readVec ( toml::table *  table,
std::string  key 
)

load a 1-D std::vector from a toml array

Template Parameters
Ttypename
Parameters
tablethe toml table
keythe key that contains an array
Returns
std::vector<T>

◆ readVec() [4/4]

template<typename T >
std::vector<T> tml::readVec ( toml::table *  table,
std::string  key,
const std::vector< T > &  default_vec 
)

load a 1-D std::vector from a toml array, with default value

Template Parameters
Ttypename
Parameters
tablethe toml table
keythe key that contains an array
default_vecdefault vector
Returns
std::vector<T>