Public Member Functions | Private Member Functions | Private Attributes | List of all members
librevenge::RVNGMemoryInputStream Class Reference

`#include <RVNGMemoryStream.h>`

Inheritance diagram for librevenge::RVNGMemoryInputStream:

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

## Private Member Functions
| RVNGMemoryInputStream (const RVNGMemoryInputStream &)
RVNGMemoryInputStream & | operator= (const RVNGMemoryInputStream &)

## Private Attributes
long | m_offset
unsigned long | m_size
unsigned char * | m_data

## Constructor & Destructor Documentation

## ◆ RVNGMemoryInputStream() [1/2]

librevenge::RVNGMemoryInputStream::RVNGMemoryInputStream | ( | unsigned char * | data,
|  | unsigned long | size
| ) |  |

## ◆ ~RVNGMemoryInputStream()

librevenge::RVNGMemoryInputStream::~RVNGMemoryInputStream | ( |  | ) |

## ◆ RVNGMemoryInputStream() [2/2]

librevenge::RVNGMemoryInputStream::RVNGMemoryInputStream | ( | const RVNGMemoryInputStream & |  | ) |
| private

## Member Function Documentation

## ◆ existsSubStream()

bool librevenge::RVNGMemoryInputStream::existsSubStream | ( | const char * |  | ) |
| inline virtual

Implements librevenge::RVNGInputStream.

## ◆ getSize()

unsigned long librevenge::RVNGMemoryInputStream::getSize | ( |  | ) | const
| inline

## ◆ getSubStreamById()

RVNGInputStream* librevenge::RVNGMemoryInputStream::getSubStreamById | ( | unsigned |  | ) |
| inline virtual

Implements librevenge::RVNGInputStream.

## ◆ getSubStreamByName()

RVNGInputStream* librevenge::RVNGMemoryInputStream::getSubStreamByName | ( | const char * | name | ) |
| inline 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.

Implements librevenge::RVNGInputStream.

## ◆ isEnd()

bool librevenge::RVNGMemoryInputStream::isEnd | ( |  | ) |
| 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.

Implements librevenge::RVNGInputStream.

## ◆ isStructured()

bool librevenge::RVNGMemoryInputStream::isStructured | ( |  | ) |
| inline 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

Implements librevenge::RVNGInputStream.

## ◆ operator=()

RVNGMemoryInputStream& librevenge::RVNGMemoryInputStream::operator= | ( | const RVNGMemoryInputStream & |  | ) |
| private

## ◆ read()

const unsigned char * librevenge::RVNGMemoryInputStream::read | ( | unsigned long | numBytes,
|  | unsigned long & | numBytesRead
| ) |  |
| 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.

Implements librevenge::RVNGInputStream.

## ◆ seek()

int librevenge::RVNGMemoryInputStream::seek | ( | long | offset,
|  | RVNG_SEEK_TYPE | seekType
| ) |  |
| 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).

Implements librevenge::RVNGInputStream.

## ◆ subStreamCount()

unsigned librevenge::RVNGMemoryInputStream::subStreamCount | ( |  | ) |
| inline virtual

Implements librevenge::RVNGInputStream.

## ◆ subStreamName()

const char* librevenge::RVNGMemoryInputStream::subStreamName | ( | unsigned |  | ) |
| inline virtual

Implements librevenge::RVNGInputStream.

## ◆ tell()

long librevenge::RVNGMemoryInputStream::tell | ( |  | ) |
| 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.

Implements librevenge::RVNGInputStream.

## Member Data Documentation

## ◆ m_data

unsigned char* librevenge::RVNGMemoryInputStream::m_data
| private

Referenced by read().

## ◆ m_offset

long librevenge::RVNGMemoryInputStream::m_offset
| private

Referenced by isEnd(), read(), seek(), and tell().

## ◆ m_size

unsigned long librevenge::RVNGMemoryInputStream::m_size
| private

Referenced by getSize(), isEnd(), read(), and seek().

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

- RVNGMemoryStream.h
- RVNGMemoryStream.cpp