26 #ifndef TILEDARRAY_ANNOTATION_H__INCLUDED
27 #define TILEDARRAY_ANNOTATION_H__INCLUDED
36 unsigned int n_inner_size = 0) {
37 std::ostringstream oss;
38 if (n_outer_size > 0) oss <<
"i0";
39 for (
unsigned int d = 1; d < n_outer_size; ++d) oss <<
",i" << d;
40 if (n_inner_size == 0)
return oss.str();
41 oss <<
";i" << n_outer_size;
42 for (
unsigned int d = 1; d < n_inner_size; ++d)
43 oss <<
",i" << d + n_outer_size;
53 s.erase(std::remove(s.begin(), s.end(),
' '), s.end());
82 if (s.size() == 0)
return std::vector<std::string>{
""};
83 std::vector<std::string> tokens;
84 std::stringstream ss(s);
86 while (std::getline(ss, buffer, delim))
87 tokens.emplace_back(std::move(buffer));
90 if (s[s.size() - 1] == delim) tokens.push_back(std::string{});
123 const std::string valid_chars =
124 "abcdefghijklmnopqrstuvwxyz"
125 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
129 for (
const auto& c : idx)
130 if (valid_chars.find(c) == std::string::npos)
return false;
134 if (no_ws.size() == 0)
return false;
138 if (split_on_semicolon.size() > 2)
return false;
140 for (
auto x : split_on_semicolon) {
142 for (
const auto& idx : indices)
143 if (idx.size() == 0)
return false;
162 return idx.find(
";") != std::string::npos;
196 std::vector<std::string>{});
205 #endif // TILEDARRAY_ANNOTATION_H__INCLUDED