Implemented JSON ==/!= comparison for arrays.

This commit is contained in:
Thulinma 2012-09-24 11:36:40 +02:00
parent ca25787c45
commit 785fcb693b

View file

@ -213,6 +213,15 @@ bool JSON::Value::operator==(const JSON::Value & rhs) const{
}
return true;
}
if (myType == ARRAY){
if (arrVal.size() != rhs.arrVal.size()) return false;
int i = 0;
for (std::deque<Value>::const_iterator it = arrVal.begin(); it != arrVal.end(); ++it){
if (*it != rhs.arrVal[i]){return false;}
i++;
}
return true;
}
return true;
}