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

SqliteDatabaseLayer.h

Go to the documentation of this file.
00001 #ifndef __SQLITE_DATABASE_LAYER_H__
00002 #define __SQLITE_DATABASE_LAYER_H__
00003 
00004 // For compilers that support precompilation, includes "wx.h".
00005 #include "wx/wxprec.h"
00006 
00007 #ifdef __BORLANDC__
00008     #pragma hdrstop
00009 #endif
00010 
00011 #ifndef WX_PRECOMP
00012     #include "wx/wx.h"
00013 #endif
00014 
00015 #include "wx/arrstr.h"
00016 
00017 #include "DatabaseLayer.h"
00018 
00019 #include "sqlite3.h"
00020 
00021 
00022 class PreparedStatement;
00023 
00024 class SqliteDatabaseLayer : public DatabaseLayer
00025 {
00026 public:
00027   // ctor()
00028   SqliteDatabaseLayer();
00029   SqliteDatabaseLayer(const wxString& strDatabase);
00030   SqliteDatabaseLayer(sqlite3* pDatabase) { m_pDatabase = pDatabase; }
00031   
00032   // dtor()
00033   virtual ~SqliteDatabaseLayer();
00034   
00035   // open database
00036   virtual bool Open(const wxString& strDatabase);
00037   
00038   // close database  
00039   virtual bool Close();
00040   
00041   // transaction support
00042   virtual void BeginTransaction();
00043   virtual void Commit();
00044   virtual void RollBack();
00045   
00046   // query database
00047   virtual bool RunQuery(const wxString& strQuery, bool bParseQuery);
00048   virtual DatabaseResultSet* RunQueryWithResults(const wxString& strQuery);
00049   
00050   // PreparedStatement support
00051   virtual PreparedStatement* PrepareStatement(const wxString& strQuery);
00052   PreparedStatement* PrepareStatement(const wxString& strQuery, bool bLogForCleanup);
00053   
00054   static int TranslateErrorCode(int nCode);
00055 
00056 private:
00057   
00058   sqlite3* m_pDatabase;
00059 };
00060 
00061 #endif // __SQLITE_DATABASE_LAYER_H__
00062 

Generated on Sat May 13 17:31:34 2006 for databaselayer by  doxygen 1.4.1