|
static std::optional< SQLiteBlobStream > | Open (sqlite3 *db, const char *schema, const char *table, const char *column, int64_t rowID, bool readOnly) noexcept |
|
Definition at line 216 of file ProjectFileIO.cpp.
◆ SQLiteBlobStream() [1/2]
SQLiteBlobStream::SQLiteBlobStream |
( |
sqlite3_blob * |
blob, |
|
|
bool |
readOnly |
|
) |
| |
|
inlinenoexcept |
◆ SQLiteBlobStream() [2/2]
◆ ~SQLiteBlobStream()
SQLiteBlobStream::~SQLiteBlobStream |
( |
| ) |
|
|
inlinenoexcept |
◆ Close()
int SQLiteBlobStream::Close |
( |
| ) |
|
|
inlinenoexcept |
◆ IsEof()
bool SQLiteBlobStream::IsEof |
( |
| ) |
const |
|
inlinenoexcept |
◆ IsOpen()
bool SQLiteBlobStream::IsOpen |
( |
| ) |
const |
|
inlinenoexcept |
◆ Open()
static std::optional< SQLiteBlobStream > SQLiteBlobStream::Open |
( |
sqlite3 * |
db, |
|
|
const char * |
schema, |
|
|
const char * |
table, |
|
|
const char * |
column, |
|
|
int64_t |
rowID, |
|
|
bool |
readOnly |
|
) |
| |
|
inlinestaticnoexcept |
Definition at line 219 of file ProjectFileIO.cpp.
222 {
223 if (db == nullptr)
224 return {};
225
226 sqlite3_blob* blob = nullptr;
227
228 const int rc = sqlite3_blob_open(
229 db, schema, table, column, rowID, readOnly ? 0 : 1, &blob);
230
231 if (rc != SQLITE_OK)
232 return {};
233
234 return std::make_optional<SQLiteBlobStream>(blob, readOnly);
235 }
Referenced by BufferedProjectBlobStream::OpenBlob(), and ProjectFileIO::WriteDoc().
◆ operator=()
◆ Read()
int SQLiteBlobStream::Read |
( |
void * |
ptr, |
|
|
int & |
size |
|
) |
| |
|
inlinenoexcept |
Definition at line 299 of file ProjectFileIO.cpp.
300 {
301 if (!
IsOpen() || ptr ==
nullptr)
302 return SQLITE_MISUSE;
303
305
306 if (availableBytes == 0)
307 {
309 return SQLITE_OK;
310 }
311 else if (availableBytes <
size)
312 {
313 size = availableBytes;
314 }
315
317
318 if (rc == SQLITE_OK)
320
321 return rc;
322 }
bool IsOpen() const noexcept
References IsOpen(), mBlob, mBlobSize, mOffset, and size.
◆ Write()
int SQLiteBlobStream::Write |
( |
const void * |
ptr, |
|
|
int |
size |
|
) |
| |
|
inlinenoexcept |
◆ mBlob
sqlite3_blob* SQLiteBlobStream::mBlob { nullptr } |
|
private |
◆ mBlobSize
size_t SQLiteBlobStream::mBlobSize { 0 } |
|
private |
◆ mIsReadOnly
bool SQLiteBlobStream::mIsReadOnly { false } |
|
private |
◆ mOffset
int SQLiteBlobStream::mOffset { 0 } |
|
private |
The documentation for this class was generated from the following file: