From 785fcb693b2342aa204496a68ffa83a459ae439f Mon Sep 17 00:00:00 2001 From: Thulinma <jaron@vietors.com> Date: Mon, 24 Sep 2012 11:36:40 +0200 Subject: [PATCH] Implemented JSON ==/!= comparison for arrays. --- lib/json.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/json.cpp b/lib/json.cpp index 6a783bc4..de0ec66c 100644 --- a/lib/json.cpp +++ b/lib/json.cpp @@ -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; }