21 namespace ns_yaml_cpp03
30 namespace ns_yaml_cpp03
50 if (node_stack_[depth].isArray())
52 return (getRawNode(depth - 1)[node_stack_[depth].index_]);
56 return (*node_stack_[depth].node_);
63 return (getRawNode(node_stack_.size() - 1));
72 namespace ns_yaml_cpp03
76 std::ifstream config_ifs;
80 impl_->parser_.Load(config_ifs);
81 impl_->parser_.GetNextDocument(
impl_->root_node_);
89 impl_->parser_.Load(input_stream);
90 impl_->parser_.GetNextDocument(
impl_->root_node_);
98 return (
impl_->getRawNode().size());
105 const YAML::Node *child =
impl_->getRawNode().FindValue(child_name);
122 impl_->node_stack_.pop_back();
128 const YAML::Node *selected_node = &
impl_->getRawNode();
130 if (YAML::NodeType::Map != selected_node->Type())
136 child_names.resize(selected_node->size());
139 for (YAML::Iterator it = selected_node->begin(); it != selected_node->end(); ++it, ++i)
141 it.first() >> child_names[i];
150 std::size_t size =
impl_->getRawNode().size();
159 ARILES_ASSERT(
true ==
impl_->node_stack_.back().isArray(),
"Internal error: expected array.");
161 impl_->node_stack_.back().index_ <
impl_->node_stack_.back().size_,
162 "Internal error: array has more elements than expected.");
163 ++
impl_->node_stack_.back().index_;
169 impl_->node_stack_.pop_back();
173 #define ARILES_BASIC_TYPE(type) \ 174 void Reader::readElement(type &element) \ 176 impl_->getRawNode() >> element; \ 181 #undef ARILES_BASIC_TYPE
YAML::Parser parser_
instance of YAML parser
ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_INTEGER_TYPES_LIST) ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_REAL_TYPES_LIST) void Writer
const YAML::Node & getRawNode(const std::size_t depth)
void ascend()
Ascend from the current entry to its parent.
static void openFile(std::ifstream &config_ifs, const std::string &file_name)
open configuration file
bool getMapEntryNames(std::vector< std::string > &child_names)
std::size_t getMapSize(const bool)
Reader(const std::string &file_name)
Constructor.
const YAML::Node & getRawNode()
#define ARILES_BASIC_TYPES_LIST
std::vector< NodeWrapper > node_stack_
Stack of nodes.
ariles::Node< const YAML::Node * > NodeWrapper
YAML::Node root_node_
root node
bool descend(const std::string &child_name)
Descend to the entry with the given name.
#define ARILES_VISIBILITY_ATTRIBUTE
ARILES_SHARED_PTR< impl::Reader > ImplPtr