| 261 | } |
| 262 | |
| 263 | bool WktParser::HasValueDouble(const std::string& key, double& val) { |
| 264 | std::string res; |
| 265 | if (HasValueStr(key, res)) { |
| 266 | size_t pos = res.find('|'); |
| 267 | try { |
| 268 | if (pos != std::string::npos) { |
| 269 | // by default try 2nd value in values (1st is usually text) |
| 270 | val = std::stod(res.substr(pos + 1, 999)); |
| 271 | } else { |
| 272 | // if only one value: try this |
| 273 | val = std::stod(res); |
| 274 | } |
| 275 | return true; |
| 276 | } catch (const std::exception&) { |
| 277 | return false; |
| 278 | } |
| 279 | } else { |
| 280 | return false; |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | int WktParser::ValueInt(const std::string& key, const double def) { |
| 285 | int ret; |
nothing calls this directly
no outgoing calls
no test coverage detected