Nuclide temperatures - solution to issue #3102 (#3110)

This commit is contained in:
Zoe Prieto 2024-08-15 12:10:26 -03:00 committed by GitHub
parent 9483cce0bc
commit 10c511a0e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 36 deletions

View file

@ -1,6 +1,7 @@
#ifndef OPENMC_STRING_UTILS_H
#define OPENMC_STRING_UTILS_H
#include <sstream>
#include <string>
#include "openmc/vector.h"
@ -15,7 +16,7 @@ std::string to_element(const std::string& name);
void to_lower(std::string& str);
int word_count(std::string const& str);
int word_count(const std::string& str);
vector<std::string> split(const std::string& in);
@ -23,5 +24,20 @@ bool ends_with(const std::string& value, const std::string& ending);
bool starts_with(const std::string& value, const std::string& beginning);
template<typename T>
inline std::string concatenate(const T& values, const std::string& del = ", ")
{
if (values.size() == 0)
return "";
std::stringstream oss;
auto it = values.begin();
oss << *it++;
while (it != values.end()) {
oss << del << *it++;
}
return oss.str();
}
} // namespace openmc
#endif // OPENMC_STRING_UTILS_H