Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

DbMetaData.h

00001 /* hey emacs! -*- Mode: C++; c-file-style: "stroustrup"; indent-tabs-mode: nil -*- */
00002 /*
00003  * DbMetaData.h
00004  *   description goes here
00005  *
00006  * $Id: DbMetaData.h,v 1.5 2000/12/27 16:59:27 rex Exp $
00007  *
00008  * Copyright (c) 2000 Benoit Joly <benoit@ddts.org>
00009  *                and Remi Lefebvre <remi@dhis.net>
00010  *                and Luca Filipozzi <lfilipoz@dhis.net>
00011  *
00012  * DDT comes with ABSOLUTELY NO WARRANTY and is licenced under the
00013  * GNU General Public License (version 2 or later). This license
00014  * can be retrieved from http://www.gnu.org/copyleft/gnu.html.
00015  *
00016  */
00017 
00018 #ifndef DBMETADATA_H
00019 #define DBMETADATA_H
00020 
00021 #include <vector>
00022 #include <map>
00023 #include <string>
00024 
00025 class DbMetaData
00026 {
00027  public:
00028     typedef enum enumDataType
00029         {
00030             UNDEFINED = 0,
00031             STRING,
00032             INT,
00033             FLOAT,
00034             BOOL,
00035             DATE,
00036             TIME
00037         } eDataType;
00038 
00039     DbMetaData();
00040     ~DbMetaData();
00041     
00042     int findColumnID(const char *name);
00043     const char *getColumnName(unsigned int colNo);
00044     eDataType getColumnType(unsigned int colNo);
00045     int getColumnSize(unsigned int colNo);
00046 
00047  protected:
00048     class ColumnPosition
00049         {
00050         public:
00051             ColumnPosition();
00052             ColumnPosition(int pos);
00053 
00054             int pos;
00055         };
00056     
00057     class ColumnMetaData
00058         {
00059         public:
00060             ColumnMetaData();
00061             ColumnMetaData(const string &name, int size,
00062                            DbMetaData::eDataType dataType);
00063             ColumnMetaData(const ColumnMetaData &columnMetaData);
00064             ~ColumnMetaData();
00065       
00066             string name;
00067             int size;
00068             eDataType dataType;        
00069         };
00070 
00071     vector<ColumnMetaData> metaDataVector;
00072     map<string, ColumnPosition> columnNameToPosition;
00073 };
00074 
00075 #endif // DBMETADATA_H

Generated on Tue Sep 13 01:32:46 2005 for DDT Project by  doxygen 1.4.4