librevenge::RVNGDirectoryStream Class Reference

A stream representation of a directory. More...

#include <RVNGDirectoryStream.h>

Inheritance diagram for librevenge::RVNGDirectoryStream:
librevenge::RVNGInputStream

Public Member Functions

 RVNGDirectoryStream (const char *path)
 Construct a stream for directory path. More...
 
virtual ~RVNGDirectoryStream ()
 
virtual bool isStructured ()
 Analyses the content of the input stream to see whether it is an OLE2 storage. More...
 
virtual unsigned subStreamCount ()
 
virtual const char * subStreamName (unsigned id)
 
virtual bool existsSubStream (const char *name)
 
virtual RVNGInputStreamgetSubStreamByName (const char *name)
 Extracts a named stream from an OLE2 storage. More...
 
virtual RVNGInputStreamgetSubStreamById (unsigned id)
 
virtual 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...
 
virtual int seek (long offset, RVNG_SEEK_TYPE seekType)
 Moves to the next location inside the input stream. More...
 
virtual long tell ()
 Returns the actual position inside the input stream. More...
 
virtual bool isEnd ()
 Determines whether the current position is at the end of the stream. More...
 
- Public Member Functions inherited from librevenge::RVNGInputStream
 RVNGInputStream ()
 
virtual ~RVNGInputStream ()
 

Static Public Member Functions

static RVNGDirectoryStreamcreateForParent (const char *path)
 Create a stream for parent directory of path. More...
 
static bool isDirectory (const char *path)
 Test whether path is a directory. More...
 

Private Member Functions

 RVNGDirectoryStream (const RVNGDirectoryStream &)
 
RVNGDirectoryStreamoperator= (const RVNGDirectoryStream &)
 

Private Attributes

RVNGDirectoryStreamImplm_impl
 

Detailed Description

A stream representation of a directory.

A valid stream (i.e., one created for an existing directory) is always structured. The content handling operations (read, seek, tell, isEnd) are always empty.

Constructor & Destructor Documentation

librevenge::RVNGDirectoryStream::RVNGDirectoryStream ( const RVNGDirectoryStream )
private
librevenge::RVNGDirectoryStream::RVNGDirectoryStream ( const char *  path)
explicit

Construct a stream for directory path.

If path is not a directory, only an empty shell is constructed and isStructured() returns false.

librevenge::RVNGDirectoryStream::~RVNGDirectoryStream ( )
virtual

Member Function Documentation

RVNGDirectoryStream * librevenge::RVNGDirectoryStream::createForParent ( const char *  path)
static

Create a stream for parent directory of path.

The stream is always structured. If the parent directory does not exist, 0 is returned.

Returns
a structured stream or 0
bool librevenge::RVNGDirectoryStream::existsSubStream ( const char *  name)
virtual
RVNGInputStream * librevenge::RVNGDirectoryStream::getSubStreamById ( unsigned  id)
virtual
RVNGInputStream * librevenge::RVNGDirectoryStream::getSubStreamByName ( const char *  name)
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.

bool librevenge::RVNGDirectoryStream::isDirectory ( const char *  path)
static

Test whether path is a directory.

Returns
true if path is a directory, false otherwise.
bool librevenge::RVNGDirectoryStream::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.

bool librevenge::RVNGDirectoryStream::isStructured ( )
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.

RVNGDirectoryStream& librevenge::RVNGDirectoryStream::operator= ( const RVNGDirectoryStream )
private
const unsigned char * librevenge::RVNGDirectoryStream::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
numBytesNumber of bytes desired to be read.
numBytesReadNumber 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.

int librevenge::RVNGDirectoryStream::seek ( long  offset,
RVNG_SEEK_TYPE  seekType 
)
virtual

Moves to the next location inside the input stream.

Parameters
offsetThe 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.
seekTypeDetermines 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.

unsigned librevenge::RVNGDirectoryStream::subStreamCount ( )
virtual
const char * librevenge::RVNGDirectoryStream::subStreamName ( unsigned  id)
virtual
long librevenge::RVNGDirectoryStream::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


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

Generated for librevenge by doxygen 1.8.10