| 1118 | } |
| 1119 | CharReaderBuilder::~CharReaderBuilder() = default; |
| 1120 | CharReader* CharReaderBuilder::newCharReader() const { |
| 1121 | bool collectComments = settings_["collectComments"].asBool(); |
| 1122 | OurFeatures features = OurFeatures::all(); |
| 1123 | features.allowComments_ = settings_["allowComments"].asBool(); |
| 1124 | features.allowTrailingCommas_ = settings_["allowTrailingCommas"].asBool(); |
| 1125 | features.strictRoot_ = settings_["strictRoot"].asBool(); |
| 1126 | features.allowDroppedNullPlaceholders_ = |
| 1127 | settings_["allowDroppedNullPlaceholders"].asBool(); |
| 1128 | features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool(); |
| 1129 | features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool(); |
| 1130 | |
| 1131 | // Stack limit is always a size_t, so we get this as an unsigned int |
| 1132 | // regardless of it we have 64-bit integer support enabled. |
| 1133 | features.stackLimit_ = static_cast<size_t>(settings_["stackLimit"].asUInt()); |
| 1134 | features.failIfExtra_ = settings_["failIfExtra"].asBool(); |
| 1135 | features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool(); |
| 1136 | features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool(); |
| 1137 | features.skipBom_ = settings_["skipBom"].asBool(); |
| 1138 | return new OurCharReader(collectComments, features); |
| 1139 | } |
| 1140 | |
| 1141 | bool CharReaderBuilder::validate(Json::Value* invalid) const { |
| 1142 | #ifdef JSONCPP_HAS_STRING_VIEW |
no test coverage detected