Changeset 337 for cpp/frams/util/extvalue.h
- Timestamp:
- 03/12/15 04:21:46 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.h
r333 r337 140 140 enum CompareResult 141 141 { 142 ResultLower=-1, ResultEqual=0, ResultHigher=1,143 144 145 146 147 142 ResultLower = -1, ResultEqual = 0, ResultHigher = 1, 143 ResultEqualUnordered, 144 ResultUnequal_RelaxedEqual, 145 ResultUnequal_RelaxedUnequal, 146 ResultMismatch_RelaxedUnequal, 147 ResultMismatch 148 148 }; 149 149 // performs all script value comparisons. … … 152 152 CompareResult compare(const ExtValue& src) const; 153 153 154 enum CmpOperator { CmpFIRST, CmpEQ=CmpFIRST,CmpNE,CmpGE,CmpLE,CmpGT,CmpLT,/*relaxed (not)equal*/CmpREQ,CmpRNE };154 enum CmpOperator { CmpFIRST, CmpEQ = CmpFIRST, CmpNE, CmpGE, CmpLE, CmpGT, CmpLT,/*relaxed (not)equal*/CmpREQ, CmpRNE }; 155 155 static const char* cmp_op_names[]; 156 class CmpMessageHandler { public: virtual void cmpMessage(SString& text); }; 157 struct CmpContext { const ExtValue *v1,*v2; CmpMessageHandler *handler; }; 158 static CmpMessageHandler default_cmp_message; 159 static CmpContext default_cmp_context; 156 struct CmpContext { const ExtValue *v1, *v2; }; 160 157 // interpret compare() result, optional context controls error messages 161 158 // @return 0=false, 1=true, -1=undefined (null in script) 162 static int interpretCompare(CmpOperator op,CompareResult result,CmpContext *context=&default_cmp_context); 159 static int interpretCompare(CmpOperator op, CompareResult result, CmpContext *context = NULL); 160 161 void divInt(paInt a); 162 void divDouble(double a); 163 163 164 164 int operator==(const ExtValue& src) const; … … 197 197 bool isNull() const { return (type == TUnknown) || ((type == TObj) && odata().isEmpty()); } 198 198 SString typeDescription() const;//< @return human readable type name (used in error messages) 199 SString typeAndValue() const;//< @return type and value (used in error messages) 199 200 const char* parseNumber(const char* in, ExtPType strict_type = TUnknown); 200 201 const char* deserialize(const char* in);//< @return first character after the succesfully parsed string or NULL if failed
Note: See TracChangeset
for help on using the changeset viewer.