Implemented JSON ==/!= comparison for arrays.
This commit is contained in:
		
							parent
							
								
									ca25787c45
								
							
						
					
					
						commit
						785fcb693b
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		|  | @ -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; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma