20 assert(mBlob !=
nullptr);
27 sqlite3_blob_close(
mBlob);
34 *
this = std::move(rhs);
48 return sqlite3_blob_bytes(
mBlob);
52Blob::Read(
void* buffer, int64_t offset, int64_t bufferSize)
const noexcept
57 const int readSize = std::min<int>(bufferSize,
Size() - offset);
64 sqlite3_blob_read(mBlob, buffer, readSize,
static_cast<int>(offset)))
71Blob::Write(
const void* buffer, int64_t offset, int64_t bufferSize)
noexcept
76 const int writeSize = std::min<int>(bufferSize,
Size() - offset);
83 sqlite3_blob_write(mBlob, buffer, writeSize,
static_cast<int>(offset)))
A class representing a BLOB in a SQLite database.
Blob & operator=(const Blob &)=delete
int64_t Size() const noexcept
Returns the size of the BLOB.
Blob(sqlite3_blob *blob) noexcept
int64_t Read(void *buffer, int64_t offset, int64_t bufferSize) const noexcept
Reads up to bufferSize bytes from the BLOB into the buffer at the given offset.
int64_t Write(const void *buffer, int64_t offset, int64_t bufferSize) noexcept
Writes up to bufferSize bytes from the buffer into the BLOB at the given offset.
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
SizeType< float > Size
Alias for SizeType<float>