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