Tkrzw
|
Flat record structure in the file. More...
#include <tkrzw_file_util.h>
Public Member Functions | |
FlatRecord (File *file) | |
Constructor. More... | |
~FlatRecord () | |
Destructor. More... | |
Status | Read (int64_t offset) |
Reads the next data. More... | |
std::string_view | GetData () |
Gets the data. More... | |
size_t | GetOffset () const |
Gets the offset of the record. More... | |
size_t | GetWholeSize () const |
Gets the whole size of the record. More... | |
Status | Write (std::string_view data) |
Writes the record in the file. More... | |
Static Public Attributes | |
static constexpr uint8_t | RECORD_MAGIC = 0xFF |
The magic number of the record. More... | |
Flat record structure in the file.
|
explicit |
Constructor.
file | The pointer to the file object. The ownership is not taken. |
tkrzw::FlatRecord::~FlatRecord | ( | ) |
Destructor.
Status tkrzw::FlatRecord::Read | ( | int64_t | offset | ) |
Reads the next data.
offset | The offset of the record. |
std::string_view tkrzw::FlatRecord::GetData | ( | ) |
Gets the data.
size_t tkrzw::FlatRecord::GetOffset | ( | ) | const |
Gets the offset of the record.
size_t tkrzw::FlatRecord::GetWholeSize | ( | ) | const |
Gets the whole size of the record.
Status tkrzw::FlatRecord::Write | ( | std::string_view | data | ) |
Writes the record in the file.
data | The record data. |
|
static |
The magic number of the record.