mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Adding get_child_nodes function to C++ xml_interface.
This commit is contained in:
parent
7b93499d11
commit
2bffc33452
2 changed files with 23 additions and 0 deletions
|
|
@ -50,5 +50,12 @@ xt::xarray<T> get_node_xarray(pugi::xml_node node, const char* name,
|
|||
return xt::adapt(v, shape);
|
||||
}
|
||||
|
||||
//===============================================================================
|
||||
// GET_NODE_LIST is used to get a pointer to a list of sub-element nodes
|
||||
//===============================================================================
|
||||
|
||||
std::vector<pugi::xml_node>
|
||||
get_child_nodes(pugi::xml_node node, const char* name);
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_XML_INTERFACE_H
|
||||
|
|
|
|||
|
|
@ -56,4 +56,20 @@ get_node_value_bool(pugi::xml_node node, const char* name)
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::vector<pugi::xml_node>
|
||||
get_child_nodes(pugi::xml_node node, const char* name)
|
||||
{
|
||||
pugi::xml_node current;
|
||||
std::vector<pugi::xml_node> node_list;
|
||||
|
||||
for (pugi::xml_node current : node.children(name)) {
|
||||
node_list.push_back(current);
|
||||
}
|
||||
|
||||
return node_list;
|
||||
}
|
||||
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue