Panda3D
Public Member Functions | List of all members
FltRecordReader Class Reference

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 Datagramget_datagram ()
 Returns the datagram representing the entire record, less the four-byte header. More...
 
DatagramIteratorget_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...
 

Detailed Description

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.

Member Function Documentation

◆ advance()

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().

◆ eof()

bool FltRecordReader::eof ( ) const

Returns true if end-of-file has been reached without error.

Definition at line 199 of file fltRecordReader.cxx.

◆ error()

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.

◆ get_datagram()

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.

◆ get_iterator()

DatagramIterator & FltRecordReader::get_iterator ( )

Returns an iterator suitable for extracting data from the current record.

Definition at line 64 of file fltRecordReader.cxx.

◆ get_opcode()

FltOpcode FltRecordReader::get_opcode ( ) const

Returns the opcode associated with the current record.

Definition at line 55 of file fltRecordReader.cxx.

◆ get_record_length()

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.


The documentation for this class was generated from the following files: