Panda3D
|
This class can be used to read a binary file that consists of an arbitrary header followed by a number of datagrams. More...
Public Member Functions | |
__init__ () | |
close () | |
Closes the file. More... | |
Istream | getStream () |
Returns the istream represented by the input file. More... | |
bool | open (const Filename filename) |
Opens the indicated filename for reading. More... | |
bool | open (const FileReference file) |
Opens the indicated filename for reading. More... | |
bool | open (Istream in, const Filename filename) |
Starts reading from the indicated stream. More... | |
![]() | |
bool | getDatagram (Datagram data) |
const FileReference | getFile () |
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagrams do not originate from a file on disk. More... | |
const Filename | getFilename () |
Returns the filename that provides the source for these datagrams, if any, or empty string if the datagrams do not originate from a file on disk. More... | |
Streamoff | getFilePos () |
Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined. More... | |
time_t | getTimestamp () |
Returns the on-disk timestamp of the file that was read, at the time it was opened, if that is available, or 0 if it is not. More... | |
VirtualFile | getVfile () |
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagrams do not originate from a VirtualFile. More... | |
bool | isEof () |
bool | isError () |
bool | saveDatagram (SubfileInfo info) |
Skips over the next datagram without extracting it, but saves the relevant file information in the SubfileInfo object so that its data may be read later. More... | |
This class can be used to read a binary file that consists of an arbitrary header followed by a number of datagrams.
__init__ | ( | ) |
close | ( | ) |
Closes the file.
This is also implicitly done when the DatagramInputFile destructs.
Istream getStream | ( | ) |
Returns the istream represented by the input file.
bool open | ( | const Filename | filename | ) |
Opens the indicated filename for reading.
Returns true on success, false on failure.
bool open | ( | const FileReference | file | ) |
Opens the indicated filename for reading.
Returns true on success, false on failure.
Starts reading from the indicated stream.
Returns true on success, false on failure. The DatagramInputFile does not take ownership of the stream; you are responsible for closing or deleting it when you are done.