Class Hierarchy   Class Index   Method Index  

CHMtableClass.h

00001 #ifndef __CHM_TABLE_CLASS_H__
00002 #define __CHM_TABLE_CLASS_H__
00003 //---------------------------------------------------------------------------
00004 // Copyright (C) 1997-2007 iNTERFACEWARE Inc.  All Rights Reserved
00005 //
00006 // Module: CHMtableClass
00007 //
00008 // Author: Greg Norman
00009 // Revision: $Revision: 1.32 $
00010 //
00011 // Last Edit Date: $Date: 2008-10-31 16:17:12 $
00012 // Source: $Source: /home/cvs/cvsroot/CHM/CHMtableClass.h,v $
00013 //---------------------------------------------------------------------------
00014 #include <CHM/CHMminimumInclude.h>
00015 #include <CHM/CHMdataType.h>
00016 class CHMtablePrivate;
00017 class CHMtableRow;
00018 class CHMdateTime;
00019 class CHMstring;
00020 
00027 class CHMtable 
00028 {
00029 public:
00031    CHMtable();
00032    explicit CHMtable(CHMtableHandle Handle);
00033 
00034    enum State
00035    {
00036       CHM_VALID = 0,
00037       CHM_PRESENT_BUT_NULL = 1,
00038       CHM_EMPTY = 2,
00039       CHM_INVALID = 3
00040    };
00041 
00043    virtual ~CHMtable();
00044       
00046    const CHMtableRow* operator[](size_t RowIndex) const;
00047    
00049    CHMtableRow* operator[](size_t RowIndex);
00050 
00052    void AddRow();
00053    
00057    size_t ColumnIndex(const char* ColumnName) const;
00058    
00060    const char* ColumnName(size_t ColumnIndex) const;
00061       
00064    CHMdataType ColumnType(size_t ColumnIndex) const;
00065       
00067    size_t CountOfColumn() const;
00068    
00073    size_t CountOfRow() const;
00074    
00076    size_t CountOfSubTable() const;
00077 
00081    CHMstring Dump() const;
00082  
00087    const CHMdateTime GetDateTime(size_t RowIndex, size_t ColumnIndex) const;
00088    
00093    double GetDouble  (size_t RowIndex, size_t ColumnIndex) const;
00094    
00099    long GetInteger (size_t RowIndex, size_t ColumnIndex) const;
00100       
00105    const CHMchar* GetString  (size_t RowIndex, size_t ColumnIndex) const;
00106    
00110    CHMboolean IsKey(size_t ColumnIndex) const; 
00111       
00115    CHMboolean IsNode() const;
00116 
00122    State GetState(size_t RowIndex, size_t ColumnIndex) const;   
00123 
00133    CHMboolean IsNull(size_t RowIndex, size_t ColumnIndex) const;
00134       
00139    void SetDateTime(size_t RowIndex, size_t ColumnIndex, const CHMdateTime& DateTime);
00140    
00145    void SetDouble(size_t RowIndex, size_t ColumnIndex, double Value);
00146       
00151    void SetInteger(size_t RowIndex, size_t ColumnIndex, long Value);
00152       
00156    void setNull(size_t RowIndex, size_t ColumnIndex) const;
00157       
00162    void SetString(size_t RowIndex, size_t ColumnIndex, const CHMchar* pValue);
00163    
00165    CHMtable* SubTable(size_t RowIndex, size_t SubTableIndex) const;
00166 
00170    CHMtableHandle TableHandle() const;
00171 
00173    const char* TableName() const;
00174 
00175 private:
00176    CHMtablePrivate* pMember;
00177    CHMtable(const CHMtable& Orig);             // not allowed
00178    CHMtable& operator=(const CHMtable& Orig);  // not allowed
00179 };
00180 
00181 #endif // end of defensive include