Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

FileByteStream Class Reference

#include <FileByteStream.h>

Inheritance diagram for FileByteStream:

InputByteStream List of all members.

Public Member Functions

 FileByteStream (string &filename, string tryext="", bool preload=false) throw (InputByteStreamError)
 Opens the requested file.
 ~FileByteStream ()
void seek (int pos) throw (InputByteStreamError)
 Sets the position of the file pointer.

Constructor & Destructor Documentation

FileByteStream::FileByteStream string &  filename,
string  tryext = "",
bool  preload = false
throw (InputByteStreamError)
 

Opens the requested file.

If preload is true, then open the file and read it entire into memory (possibly helpful if the client will be seeking a lot). If the file can't be opened, then try adding tryext to the end of it.

The file to be opened must be a seekable object -- that is, it must be a regular file, rather than a named pipe or a socket. The constructor checks this, and throws an exception if this is not the case. If you wish to open a named pipe, you can do so using InputByteStream#InputByteStream(string).

Parameters:
filename the file to be opened
tryext a file extension, including any dot, which should be added to the end of filename if that cannot be opened; default "" suppresses this
preload if true, then the file is read entirely into memory
Exceptions:
InputByteStreamError if there is a problem opening the file, including the discovery that it is not a seekable object

FileByteStream::~FileByteStream  ) 
 


Member Function Documentation

void FileByteStream::seek int  pos  )  throw (InputByteStreamError)
 

Sets the position of the file pointer.

Parameters:
pos if positive, the offset from the beginning of the file; if negative, the offset from the end of the file
Exceptions:
InputByteStreamError if the offset is larger than the size of the file


The documentation for this class was generated from the following files:
Generated on Sun Aug 21 18:21:07 2005 for dvi2bitmap by doxygen 1.3.8