src/include/common/filter/WhereClause.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #ifndef INCL_WHERECLAUSE
00020 #define INCL_WHERECLAUSE
00021 
00023 #include "base/fscapi.h"
00024 #include "filter/Clause.h"
00025 
00026 typedef enum {
00027     EQ       =  0,
00028     NE       =  1,
00029     GT       =  2,
00030     LT       =  3,
00031     GE       =  4,
00032     LE       =  5,
00033     CONTAIN  =  6,
00034     NCONTAIN =  7,
00035     UNKNOWN  = -1
00036 } WhereClauseOperator;
00037 
00038 class WhereClause : public Clause {
00039 
00040     // ------------------------------------------------------- Private interface
00041 private:
00042 
00043     char*             property     ;
00044     char*             value        ;
00045     WhereClauseOperator op           ;
00046     BOOL                caseSensitive;
00047 
00048     // ----------------------------------------------------- Protected interface
00049 protected:
00050 
00051     // -------------------------------------------------------- Public interface
00052 public:
00053 
00054     /*
00055      * WhereClause constructor
00056      *
00057      */
00058     WhereClause();
00059 
00060 
00061     /*
00062      * WhereClause constructor
00063      *
00064      * @param property
00065      * @param value
00066      * @param o
00067      * @param s
00068      */
00069     WhereClause(const char*  property, const char*  value, WhereClauseOperator o, BOOL p3);
00070 
00071 
00072     /*
00073      * WhereClause destructor
00074      *
00075      */
00076     ~WhereClause();
00077 
00078     /*
00079      * setProperty
00080      *
00081      * @param p0
00082      */
00083     void setProperty(const char* p);
00084 
00085 
00086     /*
00087      * getProperty
00088      *
00089      */
00090     const char* getProperty();
00091 
00092 
00093 
00094     /*
00095      * setValue
00096      *
00097      * @param p0
00098      */
00099     void setValue(const char* v);
00100 
00101 
00102     /*
00103      * getvalue
00104      *
00105      */
00106     const char* getValue();
00107 
00108 
00109     /*
00110      * getOperator
00111      *
00112      */
00113     WhereClauseOperator getOperator();
00114 
00115 
00116     /*
00117      * setOperator
00118      *
00119      * @param o
00120      */
00121     void setOperator(WhereClauseOperator o);
00122 
00123 
00124     /*
00125      * isCaseSensitive
00126      *
00127      */
00128     BOOL isCaseSensitive();
00129 
00130 
00131     /*
00132      * setCaseSensitive
00133      *
00134      * @param s
00135      */
00136     void setCaseSensitive(BOOL s);
00137 
00138     /*
00139      * Creates a new instance of this Clause
00140      *
00141      * @return the clone
00142      */
00143     ArrayElement* clone();
00144 
00145 
00146 };
00147 
00148 
00150 #endif

Generated on Fri Apr 27 12:29:18 2007 for Funambol C++ Client Library by  doxygen 1.5.2