This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extracting the opcode from each one. More...
#include "fltRecordReader.h"
Public Member Functions | |
FltRecordReader (std::istream &in) | |
FltError | advance (bool ok_eof=false) |
Extracts the next record from the file. More... | |
bool | eof () const |
Returns true if end-of-file has been reached without error. More... | |
bool | error () const |
Returns true if some error has been encountered while reading (for instance, a truncated file). More... | |
const Datagram & | get_datagram () |
Returns the datagram representing the entire record, less the four-byte header. More... | |
DatagramIterator & | get_iterator () |
Returns an iterator suitable for extracting data from the current record. More... | |
FltOpcode | get_opcode () const |
Returns the opcode associated with the current record. More... | |
int | get_record_length () const |
Returns the entire length of the record, including the four-byte header. More... | |
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extracting the opcode from each one.
It remembers where it is in the file and what the current record is.
Definition at line 30 of file fltRecordReader.h.
FltError FltRecordReader::advance | ( | bool | ok_eof = false | ) |
Extracts the next record from the file.
Returns true if there is another record, or false if the end of file has been reached.
Definition at line 95 of file fltRecordReader.cxx.
Referenced by FltHeader::read_flt().
bool FltRecordReader::eof | ( | ) | const |
Returns true if end-of-file has been reached without error.
Definition at line 199 of file fltRecordReader.cxx.
bool FltRecordReader::error | ( | ) | const |
Returns true if some error has been encountered while reading (for instance, a truncated file).
Definition at line 208 of file fltRecordReader.cxx.
const Datagram & FltRecordReader::get_datagram | ( | ) |
Returns the datagram representing the entire record, less the four-byte header.
Definition at line 74 of file fltRecordReader.cxx.
DatagramIterator & FltRecordReader::get_iterator | ( | ) |
Returns an iterator suitable for extracting data from the current record.
Definition at line 64 of file fltRecordReader.cxx.
FltOpcode FltRecordReader::get_opcode | ( | ) | const |
Returns the opcode associated with the current record.
Definition at line 55 of file fltRecordReader.cxx.
int FltRecordReader::get_record_length | ( | ) | const |
Returns the entire length of the record, including the four-byte header.
Definition at line 86 of file fltRecordReader.cxx.