|
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 171 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 174 of file ProjectFileIO.cpp.
177 {
178 if (db == nullptr)
179 return {};
180
181 sqlite3_blob* blob = nullptr;
182
183 const int rc = sqlite3_blob_open(
184 db, schema, table, column, rowID, readOnly ? 0 : 1, &blob);
185
186 if (rc != SQLITE_OK)
187 return {};
188
189 return std::make_optional<SQLiteBlobStream>(blob, readOnly);
190 }
Referenced by BufferedProjectBlobStream::OpenBlob(), and ProjectFileIO::WriteDoc().
◆ operator=()
◆ Read()
int SQLiteBlobStream::Read |
( |
void * |
ptr, |
|
|
int & |
size |
|
) |
| |
|
inlinenoexcept |
Definition at line 254 of file ProjectFileIO.cpp.
255 {
256 if (!
IsOpen() || ptr ==
nullptr)
257 return SQLITE_MISUSE;
258
260
261 if (availableBytes == 0)
262 {
264 return SQLITE_OK;
265 }
266 else if (availableBytes <
size)
267 {
268 size = availableBytes;
269 }
270
272
273 if (rc == SQLITE_OK)
275
276 return rc;
277 }
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: