9 #ifndef _STRUS_BASE_DATA_RECORD_FILE_HPP_INCLUDED
10 #define _STRUS_BASE_DATA_RECORD_FILE_HPP_INCLUDED
45 bool open(
const std::string& filename,
const Mode& mode_,
unsigned int recordsize_,
unsigned int headersize_=0,
const void* headerstruct=0);
50 const void*
read( std::size_t fpos);
63 bool append(
const void* recbuf);
83 unsigned int m_recordsize;
84 unsigned int m_headersize;
85 std::size_t m_recordindex;
90 #if __cplusplus >= 201103L
bool open(const std::string &filename, const Mode &mode_, unsigned int recordsize_, unsigned int headersize_=0, const void *headerstruct=0)
Open a file.
std::size_t recordsize() const
Get the size of one record of this file.
Definition: dataRecordFile.hpp:74
DataRecordFile()
Constructor.
bool append(const void *recbuf)
Append a record at the end of the file.
Definition: dataRecordFile.hpp:30
const void * header()
Get a pointer to the header of of the file.
Definition: dataRecordFile.hpp:30
Basic portable file type for collections of equal sized records with random access.
Definition: dataRecordFile.hpp:26
const void * read()
Read the record at the current file position of the file.
~DataRecordFile()
Destructor.
int error() const
Get the error of the last operation to this file.
std::size_t size()
Get the number of records stored in the file.
Definition: dataRecordFile.hpp:30
Mode
Implemented modes to access a data record file.
Definition: dataRecordFile.hpp:30
bool close()
Close the file.