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

Method newCharReader

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:2118–2137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2116CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); }
2117CharReaderBuilder::~CharReaderBuilder() = default;
2118CharReader* CharReaderBuilder::newCharReader() const {
2119 bool collectComments = settings_["collectComments"].asBool();
2120 OurFeatures features = OurFeatures::all();
2121 features.allowComments_ = settings_["allowComments"].asBool();
2122 features.allowTrailingCommas_ = settings_["allowTrailingCommas"].asBool();
2123 features.strictRoot_ = settings_["strictRoot"].asBool();
2124 features.allowDroppedNullPlaceholders_ =
2125 settings_["allowDroppedNullPlaceholders"].asBool();
2126 features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
2127 features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
2128
2129 // Stack limit is always a size_t, so we get this as an unsigned int
2130 // regardless of it we have 64-bit integer support enabled.
2131 features.stackLimit_ = static_cast<size_t>(settings_["stackLimit"].asUInt());
2132 features.failIfExtra_ = settings_["failIfExtra"].asBool();
2133 features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
2134 features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();
2135 features.skipBom_ = settings_["skipBom"].asBool();
2136 return new OurCharReader(collectComments, features);
2137}
2138
2139bool CharReaderBuilder::validate(Json::Value* invalid) const {
2140 static const auto& valid_keys = *new std::set<String>{

Callers 2

CanParseStringMethod · 0.80
parseFromStreamFunction · 0.80

Calls 3

asBoolMethod · 0.80
asUIntMethod · 0.80
allClass · 0.50

Tested by

no test coverage detected