int Compare(const SortValue& other) const { if (cmp.type == EMPTY && other.cmp.type == EMPTY) { return value->Compare(*other.value); } return cmp.Compare(other.cmp); }
bool MatchValue(const ValueObject& v, int& cmpret) { int ret = v.Compare(keyvalue); cmpret = ret; switch (cmp) { case CMP_EQAUL: return ret == 0; case CMP_GREATE: return ret > 0; case CMP_GREATE_EQ: return ret >= 0; case CMP_LESS: return ret < 0; case CMP_LESS_EQ: return ret <= 0; case CMP_NOTEQ: return ret != 0; default: return false; } }