|
|
|
This class can be used to read a binary file that consists of an arbitrary header followed by a number of datagrams.
More...
#include "datagramInputFile.h"
List of all members.
Public Member Functions |
| void | close () |
| | Closes the file.
|
| virtual bool | get_datagram (Datagram &data) |
| | Reads the next datagram from the file.
|
| virtual const FileReference * | get_file () |
| | 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.
|
| virtual streampos | get_file_pos () |
| | Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined.
|
| virtual const Filename & | get_filename () |
| | 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.
|
| istream & | get_stream () |
| | Returns the istream represented by the input file.
|
| virtual time_t | get_timestamp () const |
| | 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.
|
| virtual VirtualFile * | get_vfile () |
| | Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagrams do not originate from a VirtualFile.
|
| virtual bool | is_eof () |
| | Returns true if the file has reached the end-of-file.
|
| virtual bool | is_error () |
| | Returns true if the file has reached an error condition.
|
| bool | open (const FileReference *file) |
| | Opens the indicated filename for reading.
|
| bool | open (const Filename &filename) |
| | Opens the indicated filename for reading.
|
| bool | open (istream &in, const Filename &filename=Filename()) |
| | Starts reading from the indicated stream.
|
| bool | read_header (string &header, size_t num_bytes) |
| | Reads a sequence of bytes from the beginning of the datagram file.
|
| virtual bool | save_datagram (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.
|
Detailed Description
This class can be used to read a binary file that consists of an arbitrary header followed by a number of datagrams.
Definition at line 31 of file datagramInputFile.h.
Member Function Documentation
Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined.
For DatagramInputFiles that return a meaningful file position, this will be pointing to the first byte following the datagram returned after a call to get_datagram().
Reimplemented from DatagramGenerator.
Definition at line 364 of file datagramInputFile.cxx.
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.
Reimplemented from DatagramGenerator.
Definition at line 311 of file datagramInputFile.cxx.
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.
Reimplemented from DatagramGenerator.
Definition at line 323 of file datagramInputFile.cxx.
Opens the indicated filename for reading.
Returns true on success, false on failure.
Definition at line 47 of file datagramInputFile.I.
References open().
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.
Definition at line 64 of file datagramInputFile.cxx.
References close().
The documentation for this class was generated from the following files:
| | |