nt nField); const char* fieldValue(const char* szField); int getIntField(int nField, int nNullValue=0); int getIntField(const char* szField, int nNullValue=0); sqlite_int64 getInt64Field(int nField, sqlite_int64 nNullValue=0); sqlite_int64 getInt64Field(const char* szField, sqlite_int64 nNullValue=0); double getFloatField(int nField, double fNullValue=0.0); double getFloatField(const char* szField, double fNullValue=0.0); const char* getStringField(int nField, const char* szNullValue=""); const char* getStringField(const char* szField, const char* szNullValue=""); const unsigned char* getBlobField(int nField, int& nLen); const unsigned char* getBlobField(const char* szField, int& nLen); bool fieldIsNull(int nField); bool fieldIsNull(const char* szField); bool eof(); void nextRow(); void finalize(); private: void checkVM(); sqlite3* mpDB; sqlite3_stmt* mpVM; bool mbEof; int mnCols; bool mbOwnVM; }; class CppSQLite3Table { public: CppSQLite3Table(); CppSQLite3Table(const CppSQLite3Table& rTable); CppSQLite3Table(char** paszResults, int nRows, int nCols); virtual ~CppSQLite3Table(); CppSQLite3Table& operator=(const CppSQLite3Table& rTable); int numFields(); int numRows(); const char* fieldName(int nCol); const char* fieldValue(int nField); const char* fieldValue(const char* szField); int getIntField(int nField, int nNullValue=0); int getIntField(const char* szField, int nNullValue=0); double getFloatField(int nField, double fNullValue=0.0); double getFloatField(const char* szField, double fNullValue=0.0); const char* getStringField(int nField, const char* szNullValue=""); const char* getStringField(const char* szField, const char* szNullValue=""); bool fieldIsNull(int nField); bool fieldIsNull(const char* szField); void setRow(int nRow); void finalize(); private: void checkResults(); int mnCols; int mnRows; int mnCurrentRow; char** mpaszResults; }; class CppSQLite3Statement { public: CppSQLite3Statement(); CppSQLite3Statement(const CppSQLite3Statement& rStatement); CppSQLite3Statement(sqlite3* pDB, sqlite3_stmt* pVM); virtual ~CppSQLite3Statement(); CppSQLite3Statement& operator=(const CppSQLite3Statement& rStatement); int execDML(); CppSQLite3Query execQuery(); void bind(int nParam, const char* szValue); void bind(int nParam, const int nValue); void bind(int nParam, const double dwValue); void bind(int nParam, const unsigned char* blobValue, int nLen); void bindNull(int nParam); int bindParameterIndex(const char* szParam); void bind(const char* szParam, const char* szValue); void bind(const char* szParam, const int nValue); void bind(const char* szParam, const double dwValue); void bind(const char* szParam, const unsigned char* blobValue, int nLen); void bindNull(const char* szParam); void reset(); void finalize(); private: void checkDB(); void checkVM(); sqlite3* mpDB; sqlite3_stmt* mpVM; }; class CppSQLite3DB { public: CppSQLite3DB(); virtual ~CppSQLite3DB(); void open(const char* szFile); void close(); bool tableExists(const char* szTable); int execDML(const char* szSQL); CppSQLite3Query execQuery(const char* szSQL); int execScalar(const char* szSQL, int nNullValue=0); CppSQLite3Table getTable(const char* szSQL); CppSQLite3Statement compileStatement(const char* szSQL); sqlite_int64 lastRowId(); void interrupt() { sqlite3_interrupt(mpDB); } void setBusyTimeout(int nMillisecs); static const |