mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Adding a C++ version of node_word_count
This commit is contained in:
parent
fea2c3cc04
commit
f725e2c532
2 changed files with 10 additions and 3 deletions
|
|
@ -9,7 +9,7 @@
|
|||
#include "pugixml.hpp"
|
||||
#include "xtensor/xarray.hpp"
|
||||
#include "xtensor/xadapt.hpp"
|
||||
|
||||
#include "openmc/string_functions.h"
|
||||
|
||||
namespace openmc {
|
||||
|
||||
|
|
@ -56,6 +56,8 @@ xt::xarray<T> get_node_xarray(pugi::xml_node node, const char* name,
|
|||
|
||||
std::vector<pugi::xml_node>
|
||||
get_child_nodes(pugi::xml_node node, const char* name);
|
||||
|
||||
|
||||
int node_word_count(pugi::xml_node node, const char* name);
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_XML_INTERFACE_H
|
||||
|
|
|
|||
|
|
@ -71,5 +71,10 @@ get_child_nodes(pugi::xml_node node, const char* name)
|
|||
return node_list;
|
||||
}
|
||||
|
||||
|
||||
int node_word_count(pugi::xml_node node, const char* name)
|
||||
{
|
||||
std::string s = get_node_value(node, name);
|
||||
return word_count(s);
|
||||
}
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue