| 2330 | CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); } |
| 2331 | CharReaderBuilder::~CharReaderBuilder() = default; |
| 2332 | CharReader *CharReaderBuilder::newCharReader() const |
| 2333 | { |
| 2334 | bool collectComments = settings_["collectComments"].asBool(); |
| 2335 | OurFeatures features = OurFeatures::all(); |
| 2336 | features.allowComments_ = settings_["allowComments"].asBool(); |
| 2337 | features.allowTrailingCommas_ = settings_["allowTrailingCommas"].asBool(); |
| 2338 | features.strictRoot_ = settings_["strictRoot"].asBool(); |
| 2339 | features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool(); |
| 2340 | features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool(); |
| 2341 | features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool(); |
| 2342 | |
| 2343 | // Stack limit is always a size_t, so we get this as an unsigned int |
| 2344 | // regardless of it we have 64-bit integer support enabled. |
| 2345 | features.stackLimit_ = static_cast<size_t>(settings_["stackLimit"].asUInt()); |
| 2346 | features.failIfExtra_ = settings_["failIfExtra"].asBool(); |
| 2347 | features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool(); |
| 2348 | features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool(); |
| 2349 | features.skipBom_ = settings_["skipBom"].asBool(); |
| 2350 | return new OurCharReader(collectComments, features); |
| 2351 | } |
| 2352 | |
| 2353 | bool CharReaderBuilder::validate(Json::Value *invalid) const |
| 2354 | { |
no test coverage detected