Go to the documentation of this file.00001 #ifndef         __PG_DATABASE_H__
00002 #define         __PG_DATABASE_H__
00003 
00004 #include        <string>
00005 
00006 #include        <db/database.h>
00007 #include        <utilities/exception.h>
00008 
00009 #if !defined( WIN32_PLATFORM ) && !defined( NIX_PLATFORM ) && !defined( MINGW_PLATFORM ) && !defined( CYGWIN_PLATFORM )
00010         #define WIN32_PLATFORM
00011 #endif
00012 
00013 #ifdef PG_DATABASE
00014         #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM )
00015                 #define PG_DATABASE_DLL_ENTITY __declspec( dllexport )
00016         #endif
00017 
00018         #if defined( NIX_PLATFORM )
00019                 #define PG_DATABASE_DLL_ENTITY
00020         #endif
00021 #else
00022         #if defined( WIN32_PLATFORM )
00023                 #define PG_DATABASE_DLL_ENTITY __declspec( dllimport )
00024                 #pragma comment( lib , "pg_database.lib" )
00025         #endif
00026 
00027         #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM )
00028                 #define PG_DATABASE_DLL_ENTITY __declspec( dllimport )
00029         #endif
00030 
00031         #if defined( NIX_PLATFORM )
00032                 #define PG_DATABASE_DLL_ENTITY
00033         #endif
00034 #endif
00035 
00036 namespace       nitro{
00037 
00050         class PG_DATABASE_DLL_ENTITY PGDatabase : public Database{
00051 
00052         public:
00053 
00068                 PGDatabase( void );
00069 
00088                 PGDatabase( const std::string & theConnectionString );
00089 
00108                 void                                                                                    Connect( const std::string & theConnectionString );
00109 
00124                 void                                                                                    Disconnect( void );
00125 
00144                 void                                                                                    Query( const std::string & theQueryString );
00145 
00164                 virtual std::size_t                                                             RecordCount( void );
00165 
00184                 virtual std::size_t                                                             FieldCount( void );
00185                 
00212                 virtual const char *                                                    GetRecordField( std::size_t i , std::size_t j );
00213                 
00236                 virtual const char *                                                    GetFieldName( std::size_t j );
00237 
00252                 virtual void                                                                    ClearResult( void );
00253                 
00264                 virtual ~PGDatabase();
00265 
00266         private:
00267         
00282                 PGDatabase( const PGDatabase & DBObject ){}
00283 
00298                 PGDatabase                                                                      operator=( const PGDatabase & DBObject ){return( *this );}
00299         
00310                 void *                                                                                  Connection;
00311 
00322                 void *                                                                                  Result;
00323 
00324         };
00325 
00326 };
00327 
00328 #endif