36 return (node_stack_.back().node_);
52 pugi::xml_parse_result result =
impl_->document_.load_file(file_name.c_str(), pugi::parse_minimal);
54 true == result, std::string(
"Parsing of '") + file_name +
"' failed: " + result.description());
55 impl_->node_stack_.push_back(
impl_->document_);
63 pugi::xml_parse_result result =
impl_->document_.load(input_stream, pugi::parse_minimal);
64 ARILES2_ASSERT(
true == result, std::string(
"Parsing failed: ") + result.description());
65 impl_->node_stack_.push_back(
impl_->document_);
71 const pugi::xml_node child =
impl_->getRawNode().child(child_name.c_str());
75 impl_->node_stack_.push_back(child);
79 const pugi::xml_attribute attribute =
impl_->getRawNode().attribute(child_name.c_str());
80 if (NULL != attribute)
82 pugi::xml_node new_child =
impl_->getRawNode().append_child(child_name.c_str());
83 new_child.text() = attribute.value();
84 impl_->node_stack_.push_back(new_child);
94 impl_->node_stack_.pop_back();
103 pugi::xml_node child =
impl_->getRawNode().first_child();
114 if (NULL !=
impl_->getRawNode())
116 entry_name =
impl_->getRawNode().name();
124 const pugi::xml_node node =
impl_->getRawNode();
127 impl_->getRawNode() = node.next_sibling();
133 ARILES2_ASSERT(!
impl_->getRawNode(),
"End of iterated map has not been reached.");
134 impl_->node_stack_.pop_back();
140 std::size_t size = 0;
141 const pugi::xml_node node =
impl_->getRawNode();
142 for (pugi::xml_node child = node.child(
"item"); NULL != child; child = child.next_sibling(
"item"), ++size)
155 for (pugi::xml_node child =
impl_->getRawNode(); NULL != child;
156 child = child.next_sibling(child.name()), ++size)
169 impl_->node_stack_.back().index_ <
impl_->node_stack_.back().size_,
170 "Internal error: namevalue.has more elements than expected.");
176 ARILES2_ASSERT(
true ==
impl_->node_stack_.back().isArray(),
"Internal error: expected array.");
177 impl_->node_stack_.back().node_ =
impl_->getRawNode().next_sibling(
impl_->getRawNode().name());
178 ++
impl_->node_stack_.back().index_;
184 impl_->node_stack_.pop_back();
190 ARILES2_TRACE_FUNCTION;
191 if (
true == name.empty())
200 ARILES2_TRACE_FUNCTION;
207 element =
impl_->getRawNode().text().as_string();
211 #define ARILES2_BASIC_TYPE(type) \
212 void Reader::readElement(type &element) \
214 ARILES2_ASSERT(false == impl_->getRawNode().text().empty(), "Empty integer elements are not allowed."); \
215 element = boost::lexical_cast<type>(impl_->getRawNode().text().as_string()); \
220 #undef ARILES2_BASIC_TYPE