| 2351 | } |
| 2352 | |
| 2353 | bool CharReaderBuilder::validate(Json::Value *invalid) const |
| 2354 | { |
| 2355 | static const auto &valid_keys = *new std::set<String>{ |
| 2356 | "collectComments", |
| 2357 | "allowComments", |
| 2358 | "allowTrailingCommas", |
| 2359 | "strictRoot", |
| 2360 | "allowDroppedNullPlaceholders", |
| 2361 | "allowNumericKeys", |
| 2362 | "allowSingleQuotes", |
| 2363 | "stackLimit", |
| 2364 | "failIfExtra", |
| 2365 | "rejectDupKeys", |
| 2366 | "allowSpecialFloats", |
| 2367 | "skipBom", |
| 2368 | }; |
| 2369 | for (auto si = settings_.begin(); si != settings_.end(); ++si) |
| 2370 | { |
| 2371 | auto key = si.name(); |
| 2372 | if (valid_keys.count(key)) |
| 2373 | continue; |
| 2374 | if (invalid) |
| 2375 | (*invalid)[key] = *si; |
| 2376 | else |
| 2377 | return false; |
| 2378 | } |
| 2379 | return invalid ? invalid->empty() : true; |
| 2380 | } |
| 2381 | |
| 2382 | Value &CharReaderBuilder::operator[](const String &key) { return settings_[key]; } |
| 2383 | // static |