Merged JsonArrayIterator and JsonObjectIterator into a one template class

This commit is contained in:
Benoit Blanchon
2014-10-24 18:53:03 +02:00
parent 1f6cd8e56e
commit 582216e004
11 changed files with 45 additions and 69 deletions

View File

@ -22,7 +22,7 @@ JsonValue JsonObject::operator[](char const *key) {
}
void JsonObject::remove(char const *key) {
for (JsonObjectIterator it = begin(); it != end(); ++it) {
for (iterator it = begin(); it != end(); ++it) {
if (!strcmp(it->key(), key)) {
removeChild(it->_node);
}
@ -46,7 +46,7 @@ JsonObject JsonObject::createNestedObject(char const *key) {
}
JsonNode *JsonObject::getOrCreateNodeAt(const char *key) {
for (JsonObjectIterator it = begin(); it != end(); ++it) {
for (iterator it = begin(); it != end(); ++it) {
if (!strcmp(it->key(), key)) return it->value()._node;
}