Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KompexSQLiteBlob_H
00020 #define KompexSQLiteBlob_H
00021
00022 #include "sqlite3.h"
00023
00024 #include "KompexSQLitePrerequisites.h"
00025
00026 namespace Kompex
00027 {
00028 class SQLiteDatabase;
00029
00030 enum BLOB_ACCESS_MODE
00031 {
00032 BLOB_READONLY = 0,
00033 BLOB_READWRITE
00034 };
00035
00037 class _SQLiteWrapperExport SQLiteBlob
00038 {
00039 public:
00041 SQLiteBlob();
00057 SQLiteBlob(SQLiteDatabase *db, std::string symbolicDatabaseName, std::string tableName, std::string columnName, int64 rowId, BLOB_ACCESS_MODE accessMode = BLOB_READWRITE);
00060 virtual ~SQLiteBlob();
00061
00076 void OpenBlob(SQLiteDatabase *db, std::string symbolicDatabaseName, std::string tableName, std::string columnName, int64 rowId, BLOB_ACCESS_MODE accessMode = BLOB_READWRITE);
00077
00082 void CloseBlob();
00083
00085 int GetBlobSize() const;
00086
00094 void ReadBlob(void *buffer, int numberOfBytes, int offset = 0);
00095
00106 void WriteBlob(const void *buffer, int numberOfBytes, int offset = 0);
00107
00108 protected:
00110 sqlite3_blob *GetBlobHandle() const {return mBlobHandle;}
00111
00112 private:
00114 sqlite3_blob *mBlobHandle;
00116 SQLiteDatabase *mDatabase;
00117
00118 };
00119
00120 };
00121
00122 #endif // KompexSQLiteBlob_H