stdex
Additional custom or not Standard C++ covered algorithms
|
Helper class for read/write of records to/from memory. More...
#include <stdex/idrec.hpp>
Public Member Functions | |
record (T &d) | |
Constructs the class. | |
record (const T &d) | |
Constructs the class. | |
const record< T, T_id, ID, T_size, N_align > & | operator= (const record< T, T_id, ID, T_size, N_align > &r) |
Assignment operator. | |
Static Public Member Functions | |
static constexpr T_id | id () |
Returns record id. | |
static std::streamoff | open (std::ostream &stream) |
Writes record header. | |
static stdex::stream::fpos_t | open (stdex::stream::basic_file &stream) |
Writes record header. | |
static std::streamoff | close (std::ostream &stream, std::streamoff start) |
Updates record header. | |
static stdex::stream::fpos_t | close (stdex::stream::basic_file &stream, stdex::stream::fpos_t start) |
Updates record header. | |
static bool | find (std::istream &stream, std::streamoff end=(std::streamoff) -1) |
Finds record data. | |
static bool | find (stdex::stream::basic_file &stream, stdex::stream::fpos_t end=stdex::stream::fpos_max) |
Finds record data. | |
Public Attributes | |
T & | data |
Record data reference. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const record< T, T_id, ID, T_size, N_align > r) |
Writes record to a stream. | |
stdex::stream::basic_file & | operator<< (stdex::stream::basic_file &stream, const record< T, T_id, ID, T_size, N_align > r) |
Writes record to a file. | |
stdex::stream::basic & | operator<< (stdex::stream::basic &stream, const record< T, T_id, ID, T_size, N_align > r) |
Writes record to a stream. | |
std::istream & | operator>> (std::istream &stream, record< T, T_id, ID, T_size, N_align > r) |
Reads record from a stream. | |
stdex::stream::basic_file & | operator>> (stdex::stream::basic_file &stream, record< T, T_id, ID, T_size, N_align > r) |
Reads record from a file. | |
stdex::stream::basic & | operator>> (stdex::stream::basic &stream, record< T, T_id, ID, T_size, N_align > r) |
Reads record from a stream. | |
Helper class for read/write of records to/from memory.
|
inline |
Constructs the class.
[in] | d | Reference to record data |
|
inline |
Constructs the class.
[in] | d | Reference to record data |
|
inlinestatic |
Updates record header.
[in] | stream | Output stream |
[in] | start | Start position of the record in stream |
stream
|
inlinestatic |
Updates record header.
[in] | stream | Output stream |
[in] | start | Start position of the record in stream |
stream
|
inlinestatic |
Finds record data.
[in] | stream | Input stream |
[in] | end | Position limit. Default is -1 (no limit). |
true
when foundfalse
otherwise
|
inlinestatic |
Finds record data.
[in] | stream | Input stream |
[in] | end | Position limit. Default is stdex::stream::fpos_max (no limit). |
true
when foundfalse
otherwise
|
inlinestatic |
Writes record header.
[in] | stream | Output stream |
stream
. Save for later close
call.
|
inlinestatic |
Writes record header.
[in] | stream | Output stream |
stream
. Save for later close
call.
|
inline |
Assignment operator.
[in] | r | Source record |
|
friend |
Writes record to a stream.
[in] | stream | Output stream |
[in] | r | Record |
stream
|
friend |
Writes record to a stream.
[in] | stream | Output stream |
[in] | r | Record |
stream
|
friend |
Writes record to a file.
[in] | stream | Output file |
[in] | r | Record |
stream
|
friend |
Reads record from a stream.
[in] | stream | Input stream |
[out] | r | Record |
stream
|
friend |
Reads record from a stream.
[in] | stream | Input stream |
[out] | r | Record |
stream
|
friend |
Reads record from a file.
[in] | stream | Input file |
[out] | r | Record |
stream