00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 namespace stactiverecord {
00029
00035 class Q {
00036 private:
00037 std::string key;
00038 std::string value;
00039 int ivalue;
00040 DateTime dtvalue;
00041 SarVector<Q> ored;
00042 SarVector<Q> anded;
00043 coltype ct;
00044 public:
00045 Where *where;
00046 void to_string(std::string& query);
00051 Q(std::string _key, Where *_w) : key(_key) { ct = _w->ct; where = _w; };
00052
00057 Q(std::string _key, std::string _value) : key(_key), value(_value) { ct = STRING; where = equals(_value); };
00058
00059 Q(std::string _key, const char * _value) : key(_key), value(std::string(_value)) { ct = STRING; where = equals(std::string(_value)); };
00060
00065 Q(std::string _key, int _ivalue) : key(_key), ivalue(_ivalue) { ct = INTEGER; where = equals(_ivalue); };
00066
00071 Q(std::string _key, DateTime _dtvalue) : key(_key), dtvalue(_dtvalue) { ct = DATETIME; where = equals(_dtvalue); };
00072
00077 Q(std::string _key, bool _bvalue) : key(_key) {
00078 ivalue = (_bvalue) ? 1 : 0;
00079 ct = INTEGER;
00080
00081 where = (_bvalue) ? nequals(0) : equals(0);
00082 };
00083
00084 Q(Where *_w) { ct = _w->ct; where = _w; };
00085
00087 Q & operator||(Q other);
00088
00090 Q & operator&&(Q other);
00091
00095 SarVector<int> test(std::string classname);
00096
00098 void dump();
00099
00103 void free();
00104 };
00105 };