Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

search_condition.hh

00001 /*
00002 *  Name:      search_condition.hh
00003 *  Author:    Rafael Jesus Alcantara Perez
00004 *  Summary:   UESQLC base SQL type identifier
00005 *  Date:      $Date: 2003/10/06 13:21:35 $
00006 *  Revision:  $Revision: 1.1 $
00007 *
00008 *  Copyright (C) 2002  Rafael Jesus Alcantara Perez <rafa@dedalo-ing.com>
00009 *
00010 *  This program is free software; you can redistribute it and/or modify
00011 *  it under the terms of the GNU General Public License as published by
00012 *  the Free Software Foundation; either version 2 of the License, or
00013 *  (at your option) any later version.
00014 *
00015 *  This program is distributed in the hope that it will be useful,
00016 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 *  GNU General Public License for more details.
00019 *
00020 *  You should have received a copy of the GNU General Public License
00021 *  along with this program; if not, write to the Free Software
00022 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00023 *  MA 02111-1307, USA.
00024 */
00025 
00026 #ifndef _UESQL_SEARCH_CONDITION__
00027 #define _UESQL_SEARCH_CONDITION__
00028 
00029 #include <mpcl/text/string.hh>
00030 #include "type.hh"
00031 
00032 
00034 namespace uesqlc
00035 {
00036 
00038   class TSearchCondition       :
00039     public IType               ,
00040     public mpcl::text::TString
00041   {
00042 
00043     public:
00044 
00046       typedef
00047         mpcl::text::TString::size_type
00048         size_type;
00049 
00050 
00051     public:
00052 
00053       //
00054       //  C O N S T R U C T O R S
00055       //
00056 
00057       explicit TSearchCondition (void) :
00058         IType               ()         ,
00059         mpcl::text::TString ()         {}
00060 
00062       TSearchCondition (const TSearchCondition& rktSEARCH_CONDITION) :
00063         IType               ()                                       ,
00064         mpcl::text::TString (rktSEARCH_CONDITION)                    {}
00065 
00066       TSearchCondition& operator = (const TSearchCondition& rktSEARCH_CONDITION)
00067       {
00068         mpcl::text::TString::operator = (rktSEARCH_CONDITION);
00069         setNull (rktSEARCH_CONDITION.isNull());
00070         return *this;
00071       }
00072 
00079       void set (const char* pkcVALUE)
00080       {
00081         if ( !pkcVALUE )
00082         {
00083           erase();
00084           setNull (true);
00085         }
00086         else
00087         {
00088           assign (pkcVALUE);
00089           setNull (false);
00090         }
00091       }
00092 
00097       void set (const std::string& rkyVALUE)
00098       {
00099         assign (rkyVALUE);
00100         setNull (false);
00101       }
00102 
00103 
00104     public:
00105 
00106       //
00107       //  S E L E C T O R S
00108       //
00109 
00114       mpcl::text::TString get (void) const
00115       {
00116         mpcl::text::TString   yResult;
00117 
00118         if ( isNull() )
00119         {
00120           yResult = "null";
00121         }
00122         else
00123         {
00124           yResult = *this;
00125         }
00126         return yResult;
00127       }
00128 
00129   };  // class TSearchCondition
00130 
00131 }  // namespace uesqlc
00132 
00133 
00134 #endif  // not _UESQL_SEARCH_CONDITION__

Generated on Mon Oct 13 02:40:10 2003 for UESQLC by doxygen1.2.18