JSON::Iter::remove() now resets the internal state back to the beginning of the iteration on the root JSON::Value object.
This commit is contained in:
parent
55c03fd886
commit
2ffd320316
1 changed files with 4 additions and 2 deletions
|
@ -66,15 +66,17 @@ uint32_t JSON::Iter::num() const{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete the current indice from the parent JSON::Value.
|
/// Delete the current indice from the parent JSON::Value.
|
||||||
|
/// Resets the iterator to restart from the beginning
|
||||||
void JSON::Iter::remove(){
|
void JSON::Iter::remove(){
|
||||||
if (*this){
|
if (*this){
|
||||||
|
i = 0;
|
||||||
if (myType == JSON::ARRAY){
|
if (myType == JSON::ARRAY){
|
||||||
r->removeMember(aIt);
|
r->removeMember(aIt);
|
||||||
return;
|
aIt = r->arrVal.begin();
|
||||||
}
|
}
|
||||||
if (myType == JSON::OBJECT){
|
if (myType == JSON::OBJECT){
|
||||||
r->removeMember(oIt);
|
r->removeMember(oIt);
|
||||||
return;
|
oIt = r->objVal.begin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue