| 66 | }; |
| 67 | |
| 68 | void AssignRange::parse(const std::string& r) |
| 69 | { |
| 70 | std::string::size_type pos, count; |
| 71 | |
| 72 | pos = subParse(r); |
| 73 | count = Utils::extractSpaces(r, pos); |
| 74 | pos += count; |
| 75 | |
| 76 | if (r[pos] != '=') |
| 77 | throw error("Missing '=' assignment separator."); |
| 78 | pos++; |
| 79 | |
| 80 | count = Utils::extractSpaces(r, pos); |
| 81 | pos += count; |
| 82 | |
| 83 | // Extract value. |
| 84 | Utils::StringStreamClassicLocale ss(r.data() + pos); |
| 85 | auto start = ss.tellg(); |
| 86 | ss >> m_value; |
| 87 | if (ss.fail()) |
| 88 | throw error("Missing value to assign following '='."); |
| 89 | else if (ss.eof()) |
| 90 | pos = r.size(); |
| 91 | else { |
| 92 | pos += (ss.tellg() - start); |
| 93 | count = Utils::extractSpaces(r, pos); |
| 94 | pos += count; |
| 95 | } |
| 96 | |
| 97 | if (pos != r.size()) |
| 98 | throw error("Invalid characters following valid range."); |
| 99 | } |
| 100 | |
| 101 | |
| 102 | std::istream& operator>>(std::istream& in, AssignRange& r) |
no test coverage detected