| 1879 | CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); } |
| 1880 | CharReaderBuilder::~CharReaderBuilder() = default; |
| 1881 | CharReader* CharReaderBuilder::newCharReader() const { |
| 1882 | bool collectComments = settings_["collectComments"].asBool(); |
| 1883 | OurFeatures features = OurFeatures::all(); |
| 1884 | features.allowComments_ = settings_["allowComments"].asBool(); |
| 1885 | features.allowTrailingCommas_ = settings_["allowTrailingCommas"].asBool(); |
| 1886 | features.strictRoot_ = settings_["strictRoot"].asBool(); |
| 1887 | features.allowDroppedNullPlaceholders_ = |
| 1888 | settings_["allowDroppedNullPlaceholders"].asBool(); |
| 1889 | features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool(); |
| 1890 | features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool(); |
| 1891 | |
| 1892 | // Stack limit is always a size_t, so we get this as an unsigned int |
| 1893 | // regardless of it we have 64-bit integer support enabled. |
| 1894 | features.stackLimit_ = static_cast<size_t>(settings_["stackLimit"].asUInt()); |
| 1895 | features.failIfExtra_ = settings_["failIfExtra"].asBool(); |
| 1896 | features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool(); |
| 1897 | features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool(); |
| 1898 | features.skipBom_ = settings_["skipBom"].asBool(); |
| 1899 | return new OurCharReader(collectComments, features); |
| 1900 | } |
| 1901 | |
| 1902 | bool CharReaderBuilder::validate(Json::Value* invalid) const { |
| 1903 | static const auto& valid_keys = *new std::set<String>{ |
no test coverage detected