GME  13
Attribute.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <regex>
00004 
00005 /*
00006 This class represents an attribute expression
00007 */
00008 class Attribute
00009 {
00010 public:
00011     Attribute(void);
00012     Attribute(CString& str);
00013     ~Attribute(void);
00014     BOOL Compare(CString &rhs,int type);
00015     BOOL LogicalCompare(BOOL lhs,const Attribute & oper,BOOL rhs);
00016     std::tr1::wregex GetRegExp(CString& str,BOOL full);
00017     BOOL CheckInteger(int lhs,int rhs);
00018     BOOL CheckDouble(double lhs,double rhs);
00019     BOOL CheckBool(BOOL lhs,BOOL rhs);
00020     BOOL CheckString(BOOL lhs);
00021     BOOL IsOperator(){ return name=="&" || name=="|";    }
00022 private:
00023     void Parse(const CString& inputString,const CString& str);
00024 public:
00025     //name of the attribute
00026     CString name;
00027 
00028     //operator can be <=, >= etc
00029     CString operation;
00030 
00031     //represents value
00032     CString value;
00033 
00034     //the evaluation result defaulted to false
00035     BOOL eval;
00036 };