|
|
|
This class can be used to write a binary file that consists of an arbitrary header followed by a number of datagrams.
More...
#include "datagramOutputFile.h"
List of all members.
Public Member Functions |
| void | close () |
| | Closes the file.
|
| virtual bool | copy_datagram (SubfileInfo &result, const Filename &filename) |
| | Copies the file data from the entire indicated file (via the vfs) as the next datagram.
|
| virtual bool | copy_datagram (SubfileInfo &result, const SubfileInfo &source) |
| | Copies the file data from the range of the indicated file (outside of the vfs) as the next datagram.
|
| virtual void | flush () |
| | Ensures that all datagrams previously written will be visible in the output file.
|
| virtual const FileReference * | get_file () |
| | Returns the FileReference that provides the target for these datagrams, if any, or NULL if the datagrams do not written to 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 target for these datagrams, if any, or empty string if the datagrams do not get written to a file on disk.
|
| ostream & | get_stream () |
| | Returns the ostream represented by the output 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 writing.
|
| bool | open (const Filename &filename) |
| | Opens the indicated filename for writing.
|
| bool | open (ostream &out, const Filename &filename=Filename()) |
| | Starts writing to the indicated stream.
|
| virtual bool | put_datagram (const Datagram &data) |
| | Writes the given datagram to the file.
|
| bool | write_header (const string &header) |
| | Writes a sequence of bytes to the beginning of the datagram file.
|
Detailed Description
This class can be used to write a binary file that consists of an arbitrary header followed by a number of datagrams.
Definition at line 31 of file datagramOutputFile.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 DatagramOutputFiles that return a meaningful file position, this will be pointing to the first byte following the datagram returned after a call to put_datagram().
Reimplemented from DatagramSink.
Definition at line 327 of file datagramOutputFile.cxx.
Referenced by BamCache::store().
Returns the filename that provides the target for these datagrams, if any, or empty string if the datagrams do not get written to a file on disk.
Reimplemented from DatagramSink.
Definition at line 298 of file datagramOutputFile.cxx.
Opens the indicated filename for writing.
Returns true on success, false on failure.
Definition at line 46 of file datagramOutputFile.I.
References open().
Starts writing to the indicated stream.
Returns true on success, false on failure. The DatagramOutputFile does not take ownership of the stream; you are responsible for closing or deleting it when you are done.
Definition at line 56 of file datagramOutputFile.cxx.
References close().
The documentation for this class was generated from the following files:
| | |