| 288 | } |
| 289 | |
| 290 | bool DictionaryInt64Decode(unordered_map<string, int64>* dictionary, |
| 291 | const string& encoded_str) { |
| 292 | vector<pair<string, string> > items; |
| 293 | if (!DictionaryParse(encoded_str, &items)) |
| 294 | return false; |
| 295 | |
| 296 | dictionary->clear(); |
| 297 | for (const auto& item : items) { |
| 298 | char *error = nullptr; |
| 299 | const int64 value = strto64(item.second.c_str(), &error, 0); |
| 300 | if (error == item.second.c_str() || *error != '\0') { |
| 301 | // parsing error |
| 302 | return false; |
| 303 | } |
| 304 | (*dictionary)[item.first] = value; |
| 305 | } |
| 306 | return true; |
| 307 | } |
| 308 | |
| 309 | |
| 310 | bool DictionaryDoubleDecode(unordered_map<string, double>* dictionary, |
nothing calls this directly
no test coverage detected