MCPcopy Create free account
hub / github.com/Kitware/CMake / newCharReader

Method newCharReader

Utilities/cmjsoncpp/src/lib_json/json_reader.cpp:1881–1900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1879CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); }
1880CharReaderBuilder::~CharReaderBuilder() = default;
1881CharReader* 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
1902bool CharReaderBuilder::validate(Json::Value* invalid) const {
1903 static const auto& valid_keys = *new std::set<String>{

Callers 7

parseFromStreamFunction · 0.80
parseMethod · 0.80
ReadJsonFunction · 0.80
cmJSONStateMethod · 0.80
cmFileAPIMethod · 0.80

Calls 2

asBoolMethod · 0.80
asUIntMethod · 0.80

Tested by

no test coverage detected