dvi2bitmap dvi2bitmap1.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
FileByteStream Class Reference

An input file. More...

`#include <FileByteStream.h>`

Inheritance diagram for FileByteStream:

## Public Member Functions
| FileByteStream (string &filename, string tryext="", bool preload=false) throw (InputByteStreamError)
| Opens the requested file. More...
| ~FileByteStream ()
void | seek (int pos) throw (InputByteStreamError)
| Sets the position of the file pointer. More...
Public Member Functions inherited from InputByteStream
| InputByteStream (int fileno) throw (InputByteStreamError)
| Prepares to read a stream from the specified file descriptor, which must be open. More...
| InputByteStream (string srcspec) throw (InputByteStreamError)
| Prepares to read a stream from the specified source. More...
| ~InputByteStream ()
| Closes the file and reclaims any buffers. More...
bool | eof ()
| Indicates whether we are at the end of the file. More...
virtual void | close ()
| Closes the stream, releasing all resources. More...
Byte | getByte (void) throw (InputByteStreamError)
| Reads a byte from the stream. More...
const Byte * | getBlock (unsigned int length) throw (InputByteStreamError)
| Retrieves a block from the current position in the stream. More...
void | skip (unsigned int) throw (InputByteStreamError)
| Skips a given number of bytes forward in the stream. More...
signed int | getSIU (int) throw (InputByteStreamError)
| Obtains an n-byte unsigned integer from the stream, as a signed int. More...
signed int | getSIS (int) throw (InputByteStreamError)
| Obtains an n-byte signed integer from the stream, as a signed int. More...
unsigned int | getUIU (int) throw (InputByteStreamError)
| Obtains an n-byte unsigned integer from the stream, as an unsigned int. More...

## Additional Inherited Members
Static Public Member Functions inherited from InputByteStream
static unsigned int | getUIU (int, const Byte *) throw (InputByteStreamError)
| Obtains an n-byte unsigned integer from the beginning of a `Byte` array, as an unsigned int. More...
static void | setDefaultBufferSize (unsigned int length)
| Sets the default buffer size to be used for reading files. More...
static void | verbosity (const verbosities level)
| Sets the verbosity of this module. More...
static verbosities | getVerbosity (void)
| Returns the verbosity setting of this class. More...
Protected Member Functions inherited from InputByteStream
| InputByteStream ()
| No-argument constructor creates a new InputByteStream object, but does not associate it with any source of bytes. More...
bool | bindToFileDescriptor (int fileno, string filename="", int bufsize=0, bool fillBufferAndClose=false, bool assertIsSeekable=false) throw (InputByteStreamError)
| Binds this stream to a given file descriptor. More...
int | openSourceSpec (string srcspec) throw (InputByteStreamError)
| Opens a source. More...
int | getFD (void) const
| Returns the file descriptor this stream is bound to. More...
void | bufferSeek (unsigned int pos) throw (InputByteStreamError)
| Seeks to a specific point in the buffer. More...
void | reloadBuffer (void)
| Reloads the buffer, presumably after the file descriptor has been adjusted by an extending class. More...

## Detailed Description

An input file.

## 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

References normal.

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

References normal.

The documentation for this class was generated from the following files:

- FileByteStream.h
- FileByteStream.cc