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 | |
DatagramInputFile () | |
close () | |
Closes the file. | |
istream | getStream () |
Returns the istream represented by the input file. | |
bool | open (FileReference const file) |
Opens the indicated filename for reading. | |
bool | open (Filename const filename) |
Opens the indicated filename for reading. | |
bool | open (istream in, Filename const filename) |
Starts reading from the indicated stream. | |
bool | open (istream in) |
Starts reading from the indicated stream. | |
bool | readHeader (basic_stringchar header, unsigned int num_bytes) |
Reads a sequence of bytes from the beginning of the datagram file. |
This class can be used to read a binary file that consists of an arbitrary header followed by a number of datagrams.
close | ( | ) |
Closes the file.
This is also implicitly done when the DatagramInputFile destructs.
bool open | ( | FileReference const | file | ) |
Opens the indicated filename for reading.
Returns true on success, false on failure.
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.
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.
bool readHeader | ( | basic_stringchar | header, |
unsigned int | num_bytes | ||
) |
Reads a sequence of bytes from the beginning of the datagram file.
This may be called any number of times after the file has been opened and before the first datagram is read. It may not be called once the first datagram has been read.