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

cComplexQuery.cpp

Go to the documentation of this file.
00001 /******************************************************************************/
00002 /*                                                                            */
00003 /* POLiTe - Persistent Object Library Test                                    */
00004 /*                                        Ph.D. Thesis by Mgr. Michal Kopecky */
00005 /*                                                                            */
00006 /* Charles University Prague                                                  */
00007 /*                                                                            */
00008 /******************************************************************************/
00009 /*                                                                            */
00010 /* File name: ...                                                             */
00011 /* Module: ......                                                             */
00012 /*                                                                            */
00013 /******************************************************************************/
00014 
00015 // Standard Header(s)
00016 #include <malloc.h>
00017 
00018 // Common POLiTe Header(s)
00019 #include <lTrace.h>
00020 #include <lDefs.h>
00021 
00022 // Own Header
00023 #include <cComplexQuery.h>
00024 
00025 ComplexQuery::ComplexQuery(
00026         const QueRefProto &X
00027         ): Query(X)
00028 {
00029         _select = X._Select();
00030         _from = X._From();
00031         };
00032 
00033 ComplexQuery::ComplexQuery()
00034 : Query()
00035 {
00036         _select = NULL;
00037         _from = NULL;
00038 };
00039 
00040 ComplexQuery::ComplexQuery(
00041         const char *const a_where
00042         )
00043 : Query(a_where)
00044 {
00045         _select = NULL;
00046         _from = NULL;
00047 };
00048 
00049 ComplexQuery::ComplexQuery(
00050         const char *const a_where,
00051         const char *const a_order_by
00052         )
00053 : Query(a_where,a_order_by)
00054 {
00055         _select = NULL;
00056         _from = NULL;
00057 };
00058 
00059 ComplexQuery::ComplexQuery(
00060         const char *const a_where,
00061         const char *const a_order_by,
00062         const char *const a_select,
00063         const char *const a_from
00064         )
00065 : Query(a_where,a_order_by)
00066 {
00067         StrCpy(_select = NULL,a_select);
00068         StrCpy(_from = NULL,a_from);
00069 };
00070 
00071 ComplexQuery::~ComplexQuery()
00072 {
00073         StrFree(_select);
00074         StrFree(_from);
00075 };
00076 
00077 ComplexQuery &ComplexQuery::operator =(const ComplexQuery &X)
00078 {
00079         if (&X != this) {
00080                 StrCpy(_where,X._where);
00081                 StrCpy(_order_by,X._order_by);
00082                 StrCpy(_select = NULL,X._select);
00083                 StrCpy(_from = NULL,X._from);
00084         };
00085         return *this;
00086 };
00087 
00088 char *ComplexQuery::_Select() const
00089         //replace columns selected, when not NULL
00090 {
00091         char *_retval = NULL;
00092         return StrCpy(_retval,_select);
00093 };
00094 
00095 char *ComplexQuery::_From() const
00096         //add to list of tables, when not null
00097 {
00098         char *_retval = NULL;
00099         return StrCpy(_retval,_from);
00100 };

Generated on Sun Jul 14 20:51:13 2002 for POLiTe by doxygen1.2.16