| 38 | { |
| 39 | |
| 40 | void DomainBounds::parsePair(std::istringstream& ss, const std::string& dimName) |
| 41 | { |
| 42 | Utils::eatwhitespace(ss); |
| 43 | if (!Utils::eatcharacter(ss, '[')) |
| 44 | throw error("No opening '[' for '" + dimName + "' range."); |
| 45 | |
| 46 | double low{0.0}; |
| 47 | ss >> low; |
| 48 | if (!ss.good()) |
| 49 | throw error("No valid minimum value for '" + dimName + "' range."); |
| 50 | |
| 51 | Utils::eatwhitespace(ss); |
| 52 | if (!Utils::eatcharacter(ss, ',')) |
| 53 | throw error("No ',' separating minimum/maximum values on '" + dimName + |
| 54 | "'."); |
| 55 | |
| 56 | double high{0.0}; |
| 57 | ss >> high; |
| 58 | if (!ss.good()) |
| 59 | throw error("No valid maximum value for '" + dimName + "' range."); |
| 60 | |
| 61 | Utils::eatwhitespace(ss); |
| 62 | if (!Utils::eatcharacter(ss, ']')) |
| 63 | throw error("No closing ']' for '" + dimName + "' range."); |
| 64 | |
| 65 | m_data.push_back({low, high}); |
| 66 | } |
| 67 | |
| 68 | void DomainBounds::parse(std::string input) |
| 69 | { |