| 1909 | CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); } |
| 1910 | CharReaderBuilder::~CharReaderBuilder() = default; |
| 1911 | CharReader* CharReaderBuilder::newCharReader() const { |
| 1912 | bool collectComments = settings_["collectComments"].asBool(); |
| 1913 | OurFeatures features = OurFeatures::all(); |
| 1914 | features.allowComments_ = settings_["allowComments"].asBool(); |
| 1915 | features.strictRoot_ = settings_["strictRoot"].asBool(); |
| 1916 | features.allowDroppedNullPlaceholders_ = |
| 1917 | settings_["allowDroppedNullPlaceholders"].asBool(); |
| 1918 | features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool(); |
| 1919 | features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool(); |
| 1920 | #if defined(JSON_HAS_INT64) |
| 1921 | features.stackLimit_ = settings_["stackLimit"].asUInt64(); |
| 1922 | #else |
| 1923 | features.stackLimit_ = settings_["stackLimit"].asUInt(); |
| 1924 | #endif |
| 1925 | features.failIfExtra_ = settings_["failIfExtra"].asBool(); |
| 1926 | features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool(); |
| 1927 | features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool(); |
| 1928 | return new OurCharReader(collectComments, features); |
| 1929 | } |
| 1930 | static void getValidReaderKeys(std::set<JSONCPP_STRING>* valid_keys) { |
| 1931 | valid_keys->clear(); |
| 1932 | valid_keys->insert("collectComments"); |
no test coverage detected