#include <YAMLReader.h>
A YAMLReader based on yaml-cpp.
Definition at line 14 of file YAMLReader.h.
|
using | node_finder_t = std::function<YAML::Node(const YAML::Node)> |
| A function f : Node A -> Node B which searches YAML::Node A for a specific YAML::Node B , returning it.
|
|
using | node_id_t = std::variant<std::string, node_finder_t> |
|
using | node_path_t = std::deque<node_id_t> |
| Representation of a path of YAML::Node s in a YAML::Node tree, e.g., in a YAML file.
|
|
◆ node_finder_t
A function f : Node A -> Node B
which searches YAML::Node A
for a specific YAML::Node B
, returning it.
Definition at line 20 of file YAMLReader.h.
◆ node_id_t
Variant for identifying a YAML::Node
:
std::string
: the key name of the node
node_finder_t
: how to find the node
Definition at line 25 of file YAMLReader.h.
◆ node_path_t
Representation of a path of YAML::Node
s in a YAML::Node
tree, e.g., in a YAML file.
Definition at line 28 of file YAMLReader.h.
◆ YAMLReader()
iguana::YAMLReader::YAMLReader |
( |
std::string_view | name = "config" | ) |
|
|
inline |
◆ ~YAMLReader()
iguana::YAMLReader::~YAMLReader |
( |
| ) |
|
|
inline |
◆ GetScalar() [1/2]
template<typename SCALAR >
std::optional< SCALAR > iguana::YAMLReader::GetScalar |
( |
node_path_t | node_path | ) |
|
Read a scalar value from a YAML::Node
path; searches all currently loaded config files.
- Parameters
-
node_path | the YAML::Node path |
- Returns
- the scalar, if found
◆ GetScalar() [2/2]
template<typename SCALAR >
std::optional< SCALAR > iguana::YAMLReader::GetScalar |
( |
YAML::Node | node | ) |
|
Read a scalar value from a YAML::Node
- Parameters
-
node | the YAML::Node to read |
- Returns
- the scalar, if found
◆ GetVector() [1/2]
template<typename SCALAR >
std::optional< std::vector< SCALAR > > iguana::YAMLReader::GetVector |
( |
node_path_t | node_path | ) |
|
Read a vector value from a YAML::Node
path; searches all currently loaded config files.
- Parameters
-
node_path | the YAML::Node path |
- Returns
- the vector, if found
◆ GetVector() [2/2]
template<typename SCALAR >
std::optional< std::vector< SCALAR > > iguana::YAMLReader::GetVector |
( |
YAML::Node | node | ) |
|
Read a vector value from a YAML::Node
- Parameters
-
node | the YAML::Node to read |
- Returns
- the vector, if found
◆ InRange()
template<typename SCALAR >
node_finder_t iguana::YAMLReader::InRange |
( |
std::string const & | key, |
|
|
SCALAR | val ) |
Create a function to search a YAML::Node
for a sub-YAML::Node
such that the scalar val
is within a range specified by key
- Parameters
-
key | the key of the sub-YAML::Node to use as the range (its value must be a 2-vector) |
val | the scalar value to check |
- Returns
- the search function
The documentation for this class was generated from the following file:
- /__w/iguana/iguana/iguana_src/src/iguana/services/YAMLReader.h