librevenge::RVNGInputStream Class Reference documentation

librevenge::RVNGInputStream Class Referenceabstract

`#include <RVNGStream.h>`

Inheritance diagram for librevenge::RVNGInputStream:

## Public Member Functions
| RVNGInputStream ()
virtual | ~RVNGInputStream ()
virtual bool | isStructured ()=0
| Analyses the content of the input stream to see whether it is an OLE2 storage.
virtual unsigned | subStreamCount ()=0
virtual const char * | subStreamName (unsigned id)=0
virtual bool | existsSubStream (const char *name)=0
virtual RVNGInputStream * | getSubStreamByName (const char *name)=0
| Extracts a `named` stream from an OLE2 storage.
virtual RVNGInputStream * | getSubStreamById (unsigned id)=0
virtual const unsigned char * | read (unsigned long numBytes, unsigned long &numBytesRead)=0
| Tries to read a given number of bytes starting from the current position inside the input stream.
virtual int | seek (long offset, RVNG_SEEK_TYPE seekType)=0
| Moves to the next location inside the input stream.
virtual long | tell ()=0
| Returns the actual position inside the input stream.
virtual bool | isEnd ()=0
| Determines whether the current position is at the end of the stream.

## Constructor & Destructor Documentation

## ◆ RVNGInputStream()

librevenge::RVNGInputStream::RVNGInputStream | ( |  | ) |
| inline

Referenced by librevenge::RVNGDirectoryStream::getSubStreamById(), librevenge::RVNGFileStream::getSubStreamById(), getSubStreamById(), librevenge::RVNGMemoryInputStream::getSubStreamById(), librevenge::RVNGStringStream::getSubStreamById(), librevenge::RVNGDirectoryStream::getSubStreamByName(), librevenge::RVNGFileStream::getSubStreamByName(), getSubStreamByName(), librevenge::RVNGMemoryInputStream::getSubStreamByName(), librevenge::RVNGStringStream::getSubStreamByName(), librevenge::RVNGDirectoryStream::operator=(), librevenge::RVNGFileStream::RVNGFileStream(), librevenge::RVNGMemoryInputStream::RVNGMemoryInputStream(), and librevenge::RVNGStringStream::RVNGStringStream().

## ◆ ~RVNGInputStream()

virtual librevenge::RVNGInputStream::~RVNGInputStream | ( |  | ) |
| inlinevirtual

## Member Function Documentation

## ◆ existsSubStream()

virtual bool librevenge::RVNGInputStream::existsSubStream | ( | const char * | name | ) |
| pure virtual

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ getSubStreamById()

virtual RVNGInputStream * librevenge::RVNGInputStream::getSubStreamById | ( | unsigned | id | ) |
| pure virtual

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ getSubStreamByName()

virtual RVNGInputStream * librevenge::RVNGInputStream::getSubStreamByName | ( | const char * | name | ) |
| pure virtual

Extracts a `named` stream from an OLE2 storage.

Returns
  Should be a pointer to RVNGInputStream constructed from the `named` stream if it exists.
  Should be 0, if the `named` stream does not exist inside the OLE2 storage or if the input stream is not an OLE2 storage.

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ isEnd()

virtual bool librevenge::RVNGInputStream::isEnd | ( |  | ) |
| pure virtual

Determines whether the current position is at the end of the stream.

Returns
  A boolean value that should be true if the next location to be read in the input stream is beyond its end. In all other cases, it should be false.

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ isStructured()

virtual bool librevenge::RVNGInputStream::isStructured | ( |  | ) |
| pure virtual

Analyses the content of the input stream to see whether it is an OLE2 storage.

Returns
  A boolean value that should be true if the input stream is an OLE2 storage and false if it is not the case

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ read()

virtual const unsigned char * librevenge::RVNGInputStream::read | ( | unsigned long | numBytes,
|  | unsigned long & | numBytesRead )
| pure virtual

Tries to read a given number of bytes starting from the current position inside the input stream.

Parameters

  numBytes | Number of bytes desired to be read.
  numBytesRead | Number of bytes that were possible to be read.

Returns
  Should be a pointer to an array of numBytesRead bytes (unsigned char[numBytesRead]).
  Optionally it could be 0 if the desired number of bytes could not be read.

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

Referenced by librevenge::RVNGZipStream::getSubstream().

## ◆ seek()

virtual int librevenge::RVNGInputStream::seek | ( | long | offset,
|  | RVNG_SEEK_TYPE | seekType )
| pure virtual

Moves to the next location inside the input stream.

Parameters

  offset | The offset of the location inside the input stream to move to. It is relative either to the current position or to the beginning of the input stream depending on the value of the `seekType` parameter.
  seekType | Determines whether the `offset` is relative to the beginning of the input stream (`RVNG_SEEK_SET`) or to the current position (`RVNG_SEEK_CUR`).

Returns
  An integer value that should be 0 (zero) if the seek was successful and any other value if it failed (i.e. the requested `offset` is beyond the end of the input stream or before its beginning).

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

Referenced by librevenge::getLength(), and librevenge::RVNGZipStream::isZipFile().

## ◆ subStreamCount()

virtual unsigned librevenge::RVNGInputStream::subStreamCount | ( |  | ) |
| pure virtual

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ subStreamName()

virtual const char * librevenge::RVNGInputStream::subStreamName | ( | unsigned | id | ) |
| pure virtual

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

## ◆ tell()

virtual long librevenge::RVNGInputStream::tell | ( |  | ) |
| pure virtual

Returns the actual position inside the input stream.

Returns
  A long integer value that should correspond to the position of the next location to be read in the input stream.

Implemented in librevenge::RVNGDirectoryStream, librevenge::RVNGFileStream, librevenge::RVNGMemoryInputStream, and librevenge::RVNGStringStream.

Referenced by librevenge::getLength().

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

- RVNGStream.h