1- #include < tinyxml2.h>
2- #include < Doxybook/Xml.hpp>
3- #include < Doxybook/Exception.hpp>
41#include " ExceptionUtils.hpp"
2+ #include " tinyxml2/tinyxml2.h"
3+ #include < Doxybook/Exception.hpp>
4+ #include < Doxybook/Xml.hpp>
55
6- Doxybook2::Xml::Node::Node (tinyxml2::XMLNode* ptr)
7- : ptr(ptr) {
8-
6+ Doxybook2::Xml::Node::Node (tinyxml2::XMLNode* ptr) : ptr(ptr) {
97}
108
119Doxybook2::Xml::Node Doxybook2::Xml::Node::nextSibling () const {
@@ -32,13 +30,12 @@ Doxybook2::Xml::Element Doxybook2::Xml::Node::asElement() const {
3230 return Element (ptr->ToElement ());
3331}
3432
35- Doxybook2::Xml::Element::Element (tinyxml2::XMLElement* ptr)
36- : ptr(ptr) {
33+ Doxybook2::Xml::Element::Element (tinyxml2::XMLElement* ptr) : ptr(ptr) {
3734}
3835
3936void Doxybook2::Xml::Element::allChildElements (const std::string& name, const ElementCallback& callback) const {
4037 auto found = firstChildElement (name);
41- while (found) {
38+ while (found) {
4239 callback (found);
4340 found = found.nextSiblingElement (name);
4441 }
@@ -70,13 +67,15 @@ Doxybook2::Xml::Element Doxybook2::Xml::Element::firstChildElement(const std::st
7067
7168std::string Doxybook2::Xml::Element::getAttr (const std::string& name) const {
7269 const auto str = ptr->Attribute (name.c_str ());
73- if (str == nullptr ) throw EXCEPTION (" Attribute {} does not exist in element {}" , name, ptr->Name ());
70+ if (str == nullptr )
71+ throw EXCEPTION (" Attribute {} does not exist in element {}" , name, ptr->Name ());
7472 return str;
7573}
7674
7775std::string Doxybook2::Xml::Element::getAttr (const std::string& name, const std::string& defaultValue) const {
7876 const auto str = ptr->Attribute (name.c_str ());
79- if (str == nullptr ) return defaultValue;
77+ if (str == nullptr )
78+ return defaultValue;
8079 return str;
8180}
8281
0 commit comments