Go to the documentation of this file.00001 #ifndef __MYSQL_DATABASE_H__
00002 #define __MYSQL_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 MYSQL_DATABASE
00014 #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM )
00015 #define MYSQL_DATABASE_DLL_ENTITY __declspec( dllexport )
00016 #endif
00017
00018 #if defined( NIX_PLATFORM )
00019 #define MYSQL_DATABASE_DLL_ENTITY
00020 #endif
00021 #else
00022 #if defined( WIN32_PLATFORM )
00023 #define MYSQL_DATABASE_DLL_ENTITY __declspec( dllimport )
00024 #pragma comment( lib , "mysql_database.lib" )
00025 #endif
00026
00027 #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM )
00028 #define MYSQL_DATABASE_DLL_ENTITY __declspec( dllimport )
00029 #endif
00030
00031 #if defined( NIX_PLATFORM )
00032 #define MYSQL_DATABASE_DLL_ENTITY
00033 #endif
00034 #endif
00035
00036 namespace nitro{
00037
00050 class MYSQL_DATABASE_DLL_ENTITY MySQLDatabase : public Database{
00051
00052 public:
00053
00068 MySQLDatabase( void );
00069
00088 MySQLDatabase( 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 ~MySQLDatabase();
00265
00266 private:
00267
00282 MySQLDatabase( const MySQLDatabase & DBObject ){}
00283
00298 MySQLDatabase operator=( const MySQLDatabase & DBObject ){return( *this );}
00299
00310 void * Connection;
00311
00322 void * Result;
00323
00334 void * Row;
00335
00346 std::size_t RowId;
00347
00348 };
00349
00350 };
00351
00352 #endif