ThinSQLite++
A thin, safe and convenient modern C++ wrapper for SQLite API.
|
Access blob as a byte stream. More...
Public Member Functions | |
~blob () noexcept | |
Equivalent to sqlite3_blob_close. | |
void | reopen (int64_t rowid) |
Move the object to a new row. | |
size_t | bytes () const noexcept |
Returns the size of the blob. | |
void | read (size_t offset, span< std::byte > dest) const |
Read data from the blob. | |
template<std::ranges::contiguous_range R> requires (std::is_trivially_copyable_v<std::ranges::range_value_t<R>> && !std::is_const_v<std::remove_reference_t<std::ranges::range_reference_t<R>>>) | |
void | read (size_t offset, R &range) const |
Read data from the blob. | |
void | write (size_t offset, span< const std::byte > src) |
Write data to the blob. | |
void | write (size_t offset, span< std::byte > src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<std::ranges::contiguous_range R> requires (std::is_trivially_copyable_v<std::ranges::range_value_t<R>>) | |
void | write (size_t offset, R range) const |
Write data to the blob. | |
void | operator delete (void *) noexcept |
Operator delete for a fake pointer is no-op. | |
sqlite3_blob * | c_ptr () const noexcept |
Access the real underlying SQLite type. | |
Static Public Member Functions | |
static blob * | from (sqlite3_blob *obj) noexcept |
Create fake pointer from the underlying SQLite one. | |
Access blob as a byte stream.
This is a fake wrapper class for sqlite3_blob.
Use database::open_blob to create blob objects.
#include <thinsqlitepp/blob.hpp>
|
inline |
Move the object to a new row.
Equivalent to sqlite3_blob_reopen
|
inlinenoexcept |
Returns the size of the blob.
Equivalent to sqlite3_blob_bytes
Read data from the blob.
Equivalent to sqlite3_blob_read
|
inline |
Read data from the blob.
This overload is only available in C++20 and allows you to read into any compatible range.
Equivalent to sqlite3_blob_read
Write data to the blob.
This function may only modify the contents of the blob; it is not possible to increase the size of a blob using this API
Equivalent to sqlite3_blob_write
|
inline |
Write data to the blob.
This function may only modify the contents of the blob; it is not possible to increase the size of a blob using this API
This overload is only available in C++20 and allows you to write from any compatible range.
Equivalent to sqlite3_blob_write