Repository navigation
v4.2.6
Release v4.2.6
This release add JSON::contains(const std::vector<std::string>& path) const function
which can be used if traversable path exists or not;
for example, if json content is following:
{
"obj": {
"another_obj": {
"value": "result"
}
}
}
function can be used like this json.contains({ "obj", "another_obj", "value" }); to determine
if value exists inside obj -> another_obj, saving user from a lot, for example:
if ( j.contains["obj"] && j["obj"].contains("another_obj"] && j["obj"]["another_obj"].contains("value")) ...
Signed-off-by: Oskari Rauta oskari.rauta@gmail.com