Kompex SQLite Wrapper  1.11.14
KompexSQLiteBlob.h
Go to the documentation of this file.
1 /*
2  This file is part of Kompex SQLite Wrapper.
3  Copyright (c) 2008-2015 Sven Broeske
4 
5  Kompex SQLite Wrapper is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Kompex SQLite Wrapper is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Kompex SQLite Wrapper. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef KompexSQLiteBlob_H
20 #define KompexSQLiteBlob_H
21 
22 #include "sqlite3.h"
23 
25 
26 namespace Kompex
27 {
28  class SQLiteDatabase;
29 
31  {
34  };
35 
38  {
39  public:
41  SQLiteBlob();
57  SQLiteBlob(SQLiteDatabase *db, std::string symbolicDatabaseName, std::string tableName, std::string columnName, int64 rowId, BLOB_ACCESS_MODE accessMode = BLOB_READWRITE);
60  virtual ~SQLiteBlob();
61 
76  void OpenBlob(SQLiteDatabase *db, std::string symbolicDatabaseName, std::string tableName, std::string columnName, int64 rowId, BLOB_ACCESS_MODE accessMode = BLOB_READWRITE);
77 
82  void CloseBlob();
83 
85  int GetBlobSize() const;
86 
94  void ReadBlob(void *buffer, int numberOfBytes, int offset = 0);
95 
106  void WriteBlob(const void *buffer, int numberOfBytes, int offset = 0);
107 
108  protected:
110  sqlite3_blob *GetBlobHandle() const {return mBlobHandle;}
111 
112  private:
114  sqlite3_blob *mBlobHandle;
117 
118  };
119 
120 };
121 
122 #endif // KompexSQLiteBlob_H
Definition: KompexSQLiteBlob.h:33
sqlite3_blob * mBlobHandle
BLOB handle.
Definition: KompexSQLiteBlob.h:114
SQLiteDatabase * mDatabase
Database pointer.
Definition: KompexSQLiteBlob.h:116
Administration of the database and all concerning settings.
Definition: KompexSQLiteDatabase.h:31
long long int int64
Definition: KompexSQLitePrerequisites.h:41
#define _SQLiteWrapperExport
Definition: KompexSQLitePrerequisites.h:32
Definition: KompexSQLiteBlob.h:32
Administration of existing BLOBs.
Definition: KompexSQLiteBlob.h:37
BLOB_ACCESS_MODE
Definition: KompexSQLiteBlob.h:30
Definition: KompexSQLiteBlob.h:26
sqlite3_blob * GetBlobHandle() const
Returns the BLOB handle.
Definition: KompexSQLiteBlob.h:110