MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / makeVectorOfChildrenRecursive

Function makeVectorOfChildrenRecursive

src/sdd/Helpers.cpp:33–40  ·  view source on GitHub ↗

Helper to make a vector of pugi::xml_node matching a tag: any level

Source from the content-addressed store, hash-verified

31
32 // Helper to make a vector of pugi::xml_node matching a tag: any level
33 std::vector<pugi::xml_node> makeVectorOfChildrenRecursive(const pugi::xml_node& root, const std::string& tagName) {
34 std::vector<pugi::xml_node> result;
35 // We use xpath '//tagName'
36 for (const pugi::xpath_node& n : root.select_nodes((std::string("//") + tagName).c_str())) {
37 result.push_back(n.node());
38 }
39 return result;
40 }
41
42 // Lexical cast the text() of a node as a double
43 boost::optional<double> lexicalCastToDouble(const pugi::xml_node& element) {

Callers 1

translateBuildingMethod · 0.85

Calls 2

nodeMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected