29#ifndef PDI_PARACONF_WRAPPER_H_
30#define PDI_PARACONF_WRAPPER_H_
38#include <pdi/pdi_fwd.h>
82 Yaml_region(PC_tree_t tree);
89 inline const std::string&
file()
const {
return m_file; }
108 static std::optional<Yaml_region>
make(PC_tree_t tree);
122int PDI_EXPORT
len(PC_tree_t tree);
136int PDI_EXPORT
len(PC_tree_t tree,
int dflt);
155long PDI_EXPORT
to_long(PC_tree_t tree,
long dflt);
174double PDI_EXPORT
to_double(PC_tree_t tree,
double dflt);
193std::string PDI_EXPORT
to_string(PC_tree_t tree,
const std::string& dflt);
212bool PDI_EXPORT
to_bool(PC_tree_t tree,
bool dflt);
241void PDI_EXPORT
each(PC_tree_t tree, std::function<
void(PC_tree_t)> operation);
249void PDI_EXPORT
opt_each(PC_tree_t tree, std::function<
void(PC_tree_t)> operation);
256void PDI_EXPORT
each(PC_tree_t tree, std::function<
void(PC_tree_t, PC_tree_t)> operation);
264void PDI_EXPORT
each_in_omap(PC_tree_t tree, std::function<
void(PC_tree_t, PC_tree_t)> operation);
const Yaml_mark & end() const
Gives access to the end location of the region.
Definition paraconf_wrapper.h:101
const Yaml_mark & start() const
Gives access to the start location of the region.
Definition paraconf_wrapper.h:95
const std::string & file() const
Gives access to the "file" where this region resides.
Definition paraconf_wrapper.h:89
size_t line
the line of the location
Definition paraconf_wrapper.h:61
size_t column
the column of the location
Definition paraconf_wrapper.h:63
static std::optional< Yaml_region > make(PC_tree_t tree)
Builds a YAML region that contains a given YAML subtree or nothing if the tree is invalid.
a location in a YAML stream
Definition paraconf_wrapper.h:59
Definition array_datatype.h:38
int len(PC_tree_t tree)
Returns the length of a node.
bool is_list(PC_tree_t tree)
Checks if the tree is a list.
bool to_bool(PC_tree_t tree)
Returns the boolean value of a scalar node.
void opt_each(PC_tree_t tree, std::function< void(PC_tree_t)> operation)
Iterates and apply the provided function to all elements of a PC list or directly to the provided ele...
void each_in_omap(PC_tree_t tree, std::function< void(PC_tree_t, PC_tree_t)> operation)
Iterates and apply the provided function to all elements of a PC ordered mapping.
bool is_map(PC_tree_t tree)
Checks if the tree is a map.
double to_double(PC_tree_t tree)
Returns the floating point value of a scalar node.
void each(PC_tree_t tree, std::function< void(PC_tree_t)> operation)
Iterates and apply the provided function to all elements of a PC list.
long to_long(PC_tree_t tree)
Returns the int value of a scalar node.
bool is_scalar(PC_tree_t tree)
Checks if the tree is a scalar.
std::string to_string(PC_tree_t tree)
Returns the string content of a scalar node.
PC_errhandler_t m_handler
Definition paraconf_wrapper.h:46