Example #1
0
static bool sIsSame(const Value& a, const Value& b)
{
	if(a.Is<ValueMap>() && b.Is<ValueMap>()) {
		ValueMap m = a;
		ValueMap n = b;
		for(int i = 0; i < m.GetCount(); i++)
			if(!sIsSame(n[m.GetKey(i)], m.GetValue(i)))
				return false;
		for(int i = 0; i < n.GetCount(); i++)
			if(!sIsSame(m[n.GetKey(i)], n.GetValue(i)))
				return false;
		return true;
	}
	else
	if(a.Is<ValueArray>() && b.Is<ValueArray>()) {
		if(a.GetCount() != b.GetCount())
			return false;
		for(int i = 0; i < a.GetCount(); i++)
			if(!sIsSame(a[i], b[i]))
				return false;
		return true;
	}
	else
		return a == b;
}
Example #2
0
void S_info::Set(const void *s, const ValueMap& m) const
{
	for(int i = 0; i < m.GetCount(); i++) {
		Value v = m.GetKey(i);
		if(IsString(v))
			Set(s, (String)v, m.GetValue(i));
	}
}