| 48 | } |
| 49 | |
| 50 | std::string trim_ascii(std::string value) { |
| 51 | std::size_t first = 0; |
| 52 | while (first < value.size() && std::isspace(static_cast<unsigned char>(value[first])) != 0) { |
| 53 | ++first; |
| 54 | } |
| 55 | std::size_t last = value.size(); |
| 56 | while (last > first && std::isspace(static_cast<unsigned char>(value[last - 1])) != 0) { |
| 57 | --last; |
| 58 | } |
| 59 | return value.substr(first, last - first); |
| 60 | } |
| 61 | |
| 62 | std::optional<int> atomic_number_from_symbol(const std::string& symbol_raw) { |
| 63 | if (symbol_raw.empty()) { |
no test coverage detected