Tkrzw
|
Flat record structure in the file. More...
#include <tkrzw_file_util.h>
Public Types | |
enum | RecordType : int32_t { RECORD_NORMAL = 0 , RECORD_METADATA = 1 } |
Enumeration of record types. More... | |
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 () const |
Gets the data. More... | |
RecordType | GetRecordType () const |
Gets the record type. 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, RecordType rec_type=RECORD_NORMAL) |
Writes the record in the file. More... | |
Friends | |
class | FlatRecordReader |
Flat record structure in the file.
enum tkrzw::FlatRecord::RecordType : int32_t |
|
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 | ( | ) | const |
Gets the data.
RecordType tkrzw::FlatRecord::GetRecordType | ( | ) | const |
Gets the record type.
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, |
RecordType | rec_type = RECORD_NORMAL |
||
) |
Writes the record in the file.
data | The record data. |
rec_type | The record type. |