00001 // /******************************************************************************\ 00002 // * 00003 // * File: QueryField.h 00004 // * Creation date: May 17, 2001 14:41 00005 // * Author: ClassBuilder 00006 // * XXXX 00007 // * Purpose: Declaration of class 'DOQueryField' 00008 // * 00009 // * Modifications: @INSERT_MODIFICATIONS(* ) 00010 // * May 18, 2001 10:12 WERS 00011 // * Updated interface of method 'ConstructorInclude' 00012 // * Updated interface of method 'DOQueryField' 00013 // * Updated relation 'Query(DOQuery) <>-->> QueryField(DOQueryField)' 00014 // * Updated member 'm_number' 00015 // * Updated member 'm_pField' 00016 // * May 17, 2001 19:52 WERS 00017 // * Added method 'isPriKey' 00018 // * May 17, 2001 19:44 WERS 00019 // * Added method 'isNum' 00020 // * May 17, 2001 19:31 WERS 00021 // * Added method 'isNull' 00022 // * May 17, 2001 15:15 WERS 00023 // * Added method 'GetValue' 00024 // * May 17, 2001 14:41 WERS 00025 // * Added method 'DestructorInclude' 00026 // * Added method 'ConstructorInclude' 00027 // * Added method 'GetNumber' 00028 // * Added method 'GetName' 00029 // * Added method '~DOQueryField' 00030 // * Added method 'DOQueryField' 00031 // * Added relation 'Query(DOQuery) <>-->> QueryField(DOQueryField)' 00032 // * Added member 'm_number' 00033 // * Added member 'm_pField' 00034 // * 00035 // * 00036 // \******************************************************************************/ 00037 #ifndef _QUERYFIELD_H 00038 #define _QUERYFIELD_H 00039 00040 //@START_USER1 00045 /* -------------------------------------------------------------- 00046 Copyright (C) 2001 LifeLine Networks BV <soap2corba@lifeline.nl> 00047 00048 This program is free software; you can redistribute it and/or 00049 modify it under the terms of the GNU General Public License 00050 as published by the Free Software Foundation; either 00051 version 2 of the License, or (at your option) any later 00052 version. 00053 00054 This program is distributed in the hope that it will be useful, 00055 but WITHOUT ANY WARRANTY; without even the implied warranty of 00056 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00057 GNU General Public License for more details. 00058 00059 You should have received a copy of the GNU General Public License 00060 along with this program; if not, write to the Free Software 00061 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00062 -------------------------------------------------------------- */ 00063 //@END_USER1 00064 00065 00069 class DOQueryField 00070 { 00071 // RELATION_MULTI_OWNED_PASSIVE(DOQuery, Query, DOQueryField, QueryField) 00072 00073 public: 00074 DOQuery * _refQuery; 00075 DOQueryField * _prevQuery; 00076 DOQueryField * _nextQuery; 00077 00078 public: 00079 DOQuery* GetQuery() const { return _refQuery; }; 00080 00081 //@START_USER2 00082 //@END_USER2 00083 00084 // Members 00085 private: 00086 MYSQL_FIELD* m_pField; 00087 unsigned int m_number; 00088 00089 protected: 00090 00091 public: 00092 00093 // Methods 00094 private: 00095 void ConstructorInclude(DOQuery* pQuery); 00096 void DestructorInclude(); 00097 00098 protected: 00099 00100 public: 00101 DOQueryField(DOQuery* pQuery, unsigned int number, MYSQL_FIELD* pField); 00102 virtual ~DOQueryField(); 00103 const char* GetName(); 00104 CString GetValue(); 00105 bool isNull(); 00106 bool isNum(); 00107 bool isPriKey(); 00108 unsigned int GetNumber() const; 00109 }; 00110 00111 #endif 00112 00113 00114 #ifdef CB_INLINES 00115 #ifndef _QUERYFIELD_H_INLINES 00116 #define _QUERYFIELD_H_INLINES 00117 00121 inline const char* DOQueryField::GetName() 00122 {//@CODE_159 00123 return m_pField->name; 00124 }//@CODE_159 00125 00126 00127 00131 inline bool DOQueryField::isNull() 00132 {//@CODE_284 00133 MYSQL_ROW row = GetQuery()->GetRow(); 00134 return !row || !row [m_number]; 00135 }//@CODE_284 00136 00137 00138 00142 inline bool DOQueryField::isNum() 00143 {//@CODE_285 00144 return IS_NUM (m_pField->type); 00145 }//@CODE_285 00146 00147 00148 00152 inline bool DOQueryField::isPriKey() 00153 {//@CODE_286 00154 return (m_pField->flags & PRI_KEY_FLAG) != 0; 00155 }//@CODE_286 00156 00157 00158 00162 inline unsigned int DOQueryField::GetNumber() const 00163 {//@CODE_158 00164 return m_number; 00165 }//@CODE_158 00166 00167 00168 00169 //@START_USER3 00170 //@END_USER3 00171 00172 #endif 00173 #endif 00174