Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

O3DBIDataField.h

Go to the documentation of this file.
00001 
00041 #if !defined(O3DBI_O3DBIDATAFIELD_H)
00042 #define O3DBI_O3DBIDATAFIELD_H
00043 
00044 #include "O3DBITimestamp.h"
00045 #include "O3DBIClob.h"
00046 #include "O3DBIBlob.h"
00047 #include "O3DBIBfile.h"
00048 #include "O3DBIXml.h"
00049 
00050 #pragma warning(push, 4)
00051 
00057 class O3DBIDataField : public O3DBIObject
00058 {
00059 // Construction/destruction
00060 public:
00064     O3DBIDataField();
00073     O3DBIDataField(PC_TCHAR pchFieldname, TOracleDataType type);
00082     O3DBIDataField(PC_TCHAR pchFieldname, int iValue);
00091     O3DBIDataField(PC_TCHAR pchFieldname, unsigned int uValue);
00100     O3DBIDataField(PC_TCHAR pchFieldname, long lValue);
00109     O3DBIDataField(PC_TCHAR pchFieldname, unsigned long ulValue);
00119     O3DBIDataField(PC_TCHAR pchFieldname, float fValue);
00129     O3DBIDataField(PC_TCHAR pchFieldname, double dValue);
00138     O3DBIDataField(PC_TCHAR pchFieldname, const TO3DBIString& strValue);
00146     O3DBIDataField(PC_TCHAR pchFieldname, PC_TCHAR pchValue);
00154     O3DBIDataField(PC_TCHAR pchFieldname, const O3DBIDate& dtValue);
00162     O3DBIDataField(PC_TCHAR pchFieldname, const O3DBITimestamp& tsValue);
00170     O3DBIDataField(PC_TCHAR pchFieldname, const O3DBIClob& value);
00178     O3DBIDataField(PC_TCHAR pchFieldname, const O3DBIBlob& value);
00186     O3DBIDataField(PC_TCHAR pchFieldname, const O3DBIBfile& value);
00194     O3DBIDataField(PC_TCHAR pchFieldname, const O3DBIXml& value);
00199     O3DBIDataField(const O3DBIDataField& other);
00203     virtual ~O3DBIDataField();
00204 
00205 // Assignment
00206 public:
00207     O3DBIDataField& operator=(const O3DBIDataField& other);
00208     O3DBIDataField& operator=(int iValue);
00209     O3DBIDataField& operator=(unsigned int uValue);
00210     O3DBIDataField& operator=(long lValue);
00211     O3DBIDataField& operator=(unsigned long ulValue);
00212     O3DBIDataField& operator=(float fValue);
00213     O3DBIDataField& operator=(double dValue);
00214     O3DBIDataField& operator=(const TO3DBIString& strValue);
00215     O3DBIDataField& operator=(const PC_TCHAR pchValue);
00216     O3DBIDataField& operator=(const O3DBIDate& dtValue);
00217     O3DBIDataField& operator=(const O3DBITimestamp& tsValue);
00218     O3DBIDataField& operator=(const O3DBIClob& value);
00219     O3DBIDataField& operator=(const O3DBIBlob& value);
00220     O3DBIDataField& operator=(const O3DBIBfile& value);
00221     O3DBIDataField& operator=(const O3DBIXml& value);
00222 
00223 // Operations
00224 public:
00230     bool IsNullable(void) const;
00236     bool IsNull(void) const;
00245     TO3DBIResult SetNull(void);
00252     void SetModified(void);
00256     void CancelModified(void);
00263     bool IsModified(void) const;
00269     TOracleDataType GetType(void) const;
00270     int GetInt(void) const;
00271     unsigned int GetUnsignedInt(void) const;
00272     long GetLong(void) const;
00273     unsigned long GetUnsignedLong(void) const;
00274     float GetFloat(void) const; 
00275     double GetDouble(void) const; 
00276     TO3DBIString GetString(void) const;
00277     O3DBIDate GetDate(void) const;
00278     O3DBITimestamp GetTimestamp(void) const;
00279     O3DBIClob GetClob(void) const;
00280     O3DBIBlob GetBlob(void) const;
00281     O3DBIBfile GetBfile(void) const;
00282     O3DBIXml GetXml(void) const; 
00288     virtual TO3DBIString ToString(void) const;
00289 
00290     bool operator==(const O3DBIDataField& other) const;
00291 
00292 // Internal implementation
00293 protected:
00294     void SetNullable(bool bIsNullable = true);
00295     bool AllocateAndSetFieldname(PC_TCHAR pchName);
00296     TO3DBIString TypeToString(void) const;
00297     TO3DBIString ValueToString(void) const;
00298 
00299 // Data members
00300 protected:
00301     TOracleDataType             _type;
00302     P_TCHAR                     _pchFieldname;
00303     bool                        _isNullable;
00304     bool                        _isNull;
00305     bool                        _isModified;
00306     struct Value
00307     {
00308         double              _number;
00309         TO3DBIString        _s;
00310         O3DBIDate           _date;
00311         O3DBITimestamp      _ts;
00312         O3DBIClob           _clob;
00313         O3DBIBlob           _blob;
00314         O3DBIBfile          _bfile;
00315         O3DBIXml            _xml;
00316     }                           _value;
00317 };
00318 
00319 #pragma warning(pop)
00320 #endif // !defined(O3DBI_O3DBIDATAFIELD_H)



SourceForge.net Logo Generated on Sun Jan 23 11:36:34 2005 for Oracle Object Oriented Database Interface (O3DBI) by  doxygen 1.3.9.1