mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-13 10:22:55 +01:00
fix Builders::validate()
This commit is contained in:
parent
99822b27cd
commit
626cfcdbb8
@ -1915,7 +1915,6 @@ bool CharReaderBuilder::validate(Json::Value* invalid) const
|
||||
Json::Value my_invalid;
|
||||
if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
|
||||
Json::Value& inv = *invalid;
|
||||
bool valid = true;
|
||||
std::set<std::string> valid_keys;
|
||||
getValidReaderKeys(&valid_keys);
|
||||
Value::Members keys = settings_.getMemberNames();
|
||||
@ -1926,7 +1925,7 @@ bool CharReaderBuilder::validate(Json::Value* invalid) const
|
||||
inv[key] = settings_[key];
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
return 0u == inv.size();
|
||||
}
|
||||
// static
|
||||
void CharReaderBuilder::strictMode(Json::Value* settings)
|
||||
|
@ -1110,7 +1110,6 @@ bool StreamWriterBuilder::validate(Json::Value* invalid) const
|
||||
Json::Value my_invalid;
|
||||
if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
|
||||
Json::Value& inv = *invalid;
|
||||
bool valid = true;
|
||||
std::set<std::string> valid_keys;
|
||||
getValidWriterKeys(&valid_keys);
|
||||
Value::Members keys = settings_.getMemberNames();
|
||||
@ -1121,7 +1120,7 @@ bool StreamWriterBuilder::validate(Json::Value* invalid) const
|
||||
inv[key] = settings_[key];
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
return 0u == inv.size();
|
||||
}
|
||||
// static
|
||||
void StreamWriterBuilder::setDefaults(Json::Value* settings)
|
||||
|
Loading…
Reference in New Issue
Block a user