| 2137 | } |
| 2138 | |
| 2139 | bool CharReaderBuilder::validate(Json::Value* invalid) const { |
| 2140 | static const auto& valid_keys = *new std::set<String>{ |
| 2141 | "collectComments", |
| 2142 | "allowComments", |
| 2143 | "allowTrailingCommas", |
| 2144 | "strictRoot", |
| 2145 | "allowDroppedNullPlaceholders", |
| 2146 | "allowNumericKeys", |
| 2147 | "allowSingleQuotes", |
| 2148 | "stackLimit", |
| 2149 | "failIfExtra", |
| 2150 | "rejectDupKeys", |
| 2151 | "allowSpecialFloats", |
| 2152 | "skipBom", |
| 2153 | }; |
| 2154 | for (auto si = settings_.begin(); si != settings_.end(); ++si) { |
| 2155 | auto key = si.name(); |
| 2156 | if (valid_keys.count(key)) |
| 2157 | continue; |
| 2158 | if (invalid) |
| 2159 | (*invalid)[key] = *si; |
| 2160 | else |
| 2161 | return false; |
| 2162 | } |
| 2163 | return invalid ? invalid->empty() : true; |
| 2164 | } |
| 2165 | |
| 2166 | Value& CharReaderBuilder::operator[](const String& key) { |
| 2167 | return settings_[key]; |
no test coverage detected