diff --git a/xml_converter/.clang-format b/xml_converter/.clang-format index bf384993..76cbc3dc 100644 --- a/xml_converter/.clang-format +++ b/xml_converter/.clang-format @@ -57,7 +57,7 @@ ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DeriveLineEnding: true -DerivePointerAlignment: false +DerivePointerAlignment: true DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true diff --git a/xml_converter/src/string_hierarchy.cpp b/xml_converter/src/string_hierarchy.cpp index c7583d83..62b3c35b 100644 --- a/xml_converter/src/string_hierarchy.cpp +++ b/xml_converter/src/string_hierarchy.cpp @@ -20,8 +20,6 @@ bool StringHierarchy::in_hierarchy( return true; } - - //////////////////////////////////////////////////////////////////////////////// // in_hierarchy // @@ -39,8 +37,7 @@ bool StringHierarchy::in_hierarchy( // ambiguity between the vector and string overloads of the function. //////////////////////////////////////////////////////////////////////////////// bool StringHierarchy::in_hierarchy( - const std::initializer_list input -) const { + const std::initializer_list input) const { std::vector vec; vec.insert(vec.end(), input.begin(), input.end()); return this->in_hierarchy(vec); @@ -78,7 +75,7 @@ bool StringHierarchy::_in_hierarchy( // // A helper function to grab a sub hierarchy one level down from the top. //////////////////////////////////////////////////////////////////////////////// -const StringHierarchy* StringHierarchy::sub_hierarchy( +const StringHierarchy *StringHierarchy::sub_hierarchy( const std::string &node) const { if (this->all_children_included) { return this; @@ -91,21 +88,19 @@ const StringHierarchy* StringHierarchy::sub_hierarchy( return &(iterator->second); } - //////////////////////////////////////////////////////////////////////////////// // sub_hierarchy // // An explicit version of sub_hierarchy that takes an initalizer list to // prevent ambiguity between the vector and string overloads of the function. //////////////////////////////////////////////////////////////////////////////// -const StringHierarchy* StringHierarchy::sub_hierarchy( +const StringHierarchy *StringHierarchy::sub_hierarchy( const std::initializer_list input) const { std::vector vec; vec.insert(vec.end(), input.begin(), input.end()); return this->sub_hierarchy(vec); } - //////////////////////////////////////////////////////////////////////////////// // sub_hierarchy // @@ -113,9 +108,9 @@ const StringHierarchy* StringHierarchy::sub_hierarchy( // entire hierarchy in the case where the use case is traversing down a tree // anyways and does not want to keep track of the parent's values. //////////////////////////////////////////////////////////////////////////////// -const StringHierarchy* StringHierarchy::sub_hierarchy( +const StringHierarchy *StringHierarchy::sub_hierarchy( const std::vector &path) const { - const StringHierarchy* sub_hierarchy = this; + const StringHierarchy *sub_hierarchy = this; for (size_t i = 0; i < path.size(); i++) { sub_hierarchy = sub_hierarchy->sub_hierarchy(path[i]); // Escape before segfaulting. diff --git a/xml_converter/src/string_hierarchy.hpp b/xml_converter/src/string_hierarchy.hpp index 94e2fc7c..3b323b11 100644 --- a/xml_converter/src/string_hierarchy.hpp +++ b/xml_converter/src/string_hierarchy.hpp @@ -15,13 +15,13 @@ class StringHierarchy { bool in_hierarchy( const std::initializer_list) const; - const StringHierarchy* sub_hierarchy( + const StringHierarchy *sub_hierarchy( const std::string &node) const; - const StringHierarchy* sub_hierarchy( + const StringHierarchy *sub_hierarchy( const std::initializer_list input) const; - const StringHierarchy* sub_hierarchy( + const StringHierarchy *sub_hierarchy( const std::vector &path) const; void add_path(