Get counter string to include in filename
| 37 | |
| 38 | /// Get counter string to include in filename |
| 39 | std::string get_counter(const pugi::xml_node& node, const std::string& name) |
| 40 | { |
| 41 | // Count number of entries |
| 42 | const size_t n = std::distance(node.children(name.c_str()).begin(), |
| 43 | node.children(name.c_str()).end()); |
| 44 | |
| 45 | // Compute counter string |
| 46 | constexpr int num_digits = 6; |
| 47 | std::string counter = std::to_string(n); |
| 48 | return std::string(num_digits - counter.size(), '0').append(counter); |
| 49 | } |
| 50 | //---------------------------------------------------------------------------- |
| 51 | |
| 52 | /// Convert a container to a std::stringstream |
no test coverage detected