Panda3D
Public Member Functions
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"

List of all members.

Public Member Functions

 FltRecordReader (istream &in)
FltError advance (bool ok_eof=false)
 Extracts the next record from the file.
bool eof () const
 Returns true if end-of-file has been reached without error.
bool error () const
 Returns true if some error has been encountered while reading (for instance, a truncated file).
const Datagramget_datagram ()
 Returns the datagram representing the entire record, less the four-byte header.
DatagramIteratorget_iterator ()
 Returns an iterator suitable for extracting data from the current record.
FltOpcode get_opcode () const
 Returns the opcode associated with the current record.
int get_record_length () const
 Returns the entire length of the record, including the four-byte header.

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 34 of file fltRecordReader.h.


Member Function Documentation

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 114 of file fltRecordReader.cxx.

References Datagram::append_data().

Referenced by FltHeader::read_flt(), and FltRecord::read_record_and_children().

bool FltRecordReader::eof ( ) const

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

Definition at line 220 of file fltRecordReader.cxx.

Referenced by FltHeader::read_flt(), and FltRecord::read_record_and_children().

bool FltRecordReader::error ( ) const

Returns true if some error has been encountered while reading (for instance, a truncated file).

Definition at line 231 of file fltRecordReader.cxx.

Referenced by FltRecord::read_record_and_children().

Returns the datagram representing the entire record, less the four-byte header.

Definition at line 87 of file fltRecordReader.cxx.

References DatagramIterator::get_datagram().

Referenced by FltUnsupportedRecord::extract_record().

FltOpcode FltRecordReader::get_opcode ( ) const

Returns the entire length of the record, including the four-byte header.

Definition at line 102 of file fltRecordReader.cxx.

Referenced by FltHeader::extract_ancillary().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations