Added JsonObjectBase::remove()

This commit is contained in:
Benoit Blanchon committed 2014-08-03 13:16:35 +02:00
1 parent 817cc09975
commit 8e81b9bb26
4 files changed
+61 -6

No files matched your search

+8
View File
@@ -81,4 +81,12 @@ JsonValue& JsonObjectBase::operator[](JsonKey key)
bool JsonObjectBase::containsKey(JsonKey key) const
{
return getMatchingPair(key) != 0;
}
void JsonObjectBase::remove(JsonKey key)
{
KeyValuePair* match = getMatchingPair(key);
if (match == 0) return;
*match = items[--count];
}