• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

spl/data/SqlLiteCommand.h

00001 /*
00002  *   This file is part of the Standard Portable Library (SPL).
00003  *
00004  *   SPL is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   SPL is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with SPL.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 #ifndef _sqllitecommand_h
00018 #define _sqllitecommand_h
00019 
00020 #include <spl/data/Command.h>
00021 #include <spl/WeakReference.h>
00022 
00029 class SqlLiteCommand;
00030 typedef RefCountPtrCast<SqlLiteCommand, Command, CommandPtr> SqlLiteCommandPtr;
00031 typedef WeakReference<SqlLiteCommand, SqlLiteCommandPtr> SqlLiteCommandRef;
00032 
00042 class SqlLiteCommand : public Command
00043 {
00044 protected:
00045         void *m_db;
00046         void *m_stmt;
00047 
00048         void BindParameters();
00049 
00050 public:
00051         SqlLiteCommand();
00052         SqlLiteCommand(const SqlLiteCommand& cmd);
00053         SqlLiteCommand(void *db, const String& cmdtxt);
00054         virtual ~SqlLiteCommand();
00055 
00056         SqlLiteCommand& operator =(const SqlLiteCommand& cmd);
00057         
00058         virtual void Clear();
00059 
00060         virtual void Prepare();
00061         virtual int ExecuteNonQuery();
00062         virtual RecordSetPtr ExecuteQuery();
00063 };
00064 
00065 REGISTER_TYPEOF( 422, SqlLiteCommand );
00066 REGISTER_TYPEOF( 424, SqlLiteCommandPtr );
00067 REGISTER_TYPEOF( 426, SqlLiteCommandRef );
00068 
00071 #endif