Add json::object::has query for keys
This commit is contained in:
parent
f0928b80c1
commit
fd113f6c4d
@ -403,6 +403,12 @@ json::object::operator[](const std::string &key) const {
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
json::object::has (const std::string &key) const {
|
||||
return m_values.find (key) != m_values.end ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
json::object::clear (void)
|
||||
{ m_values.clear (); }
|
||||
|
1
json.hpp
1
json.hpp
@ -106,6 +106,7 @@ namespace json {
|
||||
|
||||
virtual void insert (const std::string &key, std::unique_ptr<node>&& value);
|
||||
virtual const node& operator[](const std::string &key) const;
|
||||
virtual bool has (const std::string&) const;
|
||||
|
||||
virtual void clear (void);
|
||||
virtual void erase (const std::string &key);
|
||||
|
Loading…
Reference in New Issue
Block a user