#include <DatabaseBlob.hpp>
|
virtual std::vector< uint8_t > | read (int64_t offset, int64_t length)=0 |
|
virtual int64_t | write (int64_t offset, const std::vector< uint8_t > &data)=0 |
|
virtual int64_t | append (const std::vector< uint8_t > &data)=0 |
|
virtual int64_t | trim (int64_t newLen)=0 |
|
virtual int64_t | size ()=0 |
|
A wrapper around SQL blob type. BLOB (Binary Large Object) is a builtin SQL type to store bytes.
◆ append()
virtual int64_t ledger::core::api::DatabaseBlob::append |
( |
const std::vector< uint8_t > & |
data | ) |
|
|
pure virtual |
Append the given bytes to the BLOB.
- Parameters
-
The | data to append to the BLOB |
- Returns
- the number of bytes written
Implemented in Blob.
◆ read()
virtual std::vector<uint8_t> ledger::core::api::DatabaseBlob::read |
( |
int64_t |
offset, |
|
|
int64_t |
length |
|
) |
| |
|
pure virtual |
Reads bytes from the blob at the given offset and of the a given length and return them in a byte array.
- Parameters
-
offset | Start to read bytes from the blob at offset value. |
length | Maximum number of byte read from the blob |
Implemented in Blob.
◆ size()
virtual int64_t ledger::core::api::DatabaseBlob::size |
( |
| ) |
|
|
pure virtual |
Get the size of the BLOB.
- Returns
- the size of the BLOB in bytes.
Implemented in Blob.
◆ trim()
virtual int64_t ledger::core::api::DatabaseBlob::trim |
( |
int64_t |
newLen | ) |
|
|
pure virtual |
Truncate the BLOB to the length given by the newLen parameter (in bytes).
- Parameters
-
newLen | The final size of the BLOB |
- Returns
- The number of byte truncated
Implemented in Blob.
◆ write()
virtual int64_t ledger::core::api::DatabaseBlob::write |
( |
int64_t |
offset, |
|
|
const std::vector< uint8_t > & |
data |
|
) |
| |
|
pure virtual |
Write the given bytes at the given offset in the BLOB.
- Returns
- The number of written bytes
Implemented in Blob.
The documentation for this class was generated from the following file: