Public Member Functions | Private Member Functions | Private Attributes

WPXMemoryInputStream Class Reference

#include <WPXMemoryStream.h>

Inheritance diagram for WPXMemoryInputStream:
WPXInputStream

List of all members.

Public Member Functions

 WPXMemoryInputStream (unsigned char *data, unsigned long size)
virtual ~WPXMemoryInputStream ()
virtual bool isOLEStream ()
 Analyses the content of the input stream to see whether it is an OLE2 storage.
virtual WPXInputStreamgetDocumentOLEStream (const char *)
 Extracts a PerfectOffice_MAIN stream from an OLE2 storage.
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.
virtual int seek (long offset, WPX_SEEK_TYPE seekType)
 Moves to the next location inside the input stream.
virtual long tell ()
 Returns the actual position inside the input stream.
virtual bool atEOS ()
 Determines whether the current position is at the end of the stream.
virtual unsigned long getSize () const

Private Member Functions

 WPXMemoryInputStream (const WPXMemoryInputStream &)
WPXMemoryInputStreamoperator= (const WPXMemoryInputStream &)

Private Attributes

long m_offset
unsigned long m_size
unsigned char * m_data

Constructor & Destructor Documentation

WPXMemoryInputStream::WPXMemoryInputStream ( unsigned char *  data,
unsigned long  size 
)
WPXMemoryInputStream::~WPXMemoryInputStream (  ) [virtual]
WPXMemoryInputStream::WPXMemoryInputStream ( const WPXMemoryInputStream  ) [private]

Member Function Documentation

bool WPXMemoryInputStream::atEOS (  ) [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 WPXInputStream.

Referenced by WP6ExtendedDocumentSummaryPacket::parse().

virtual WPXInputStream* WPXMemoryInputStream::getDocumentOLEStream ( const char *  name ) [inline, virtual]

Extracts a PerfectOffice_MAIN stream from an OLE2 storage.

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

Implements WPXInputStream.

virtual unsigned long WPXMemoryInputStream::getSize (  ) const [inline, virtual]
virtual bool WPXMemoryInputStream::isOLEStream (  ) [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 WPXInputStream.

WPXMemoryInputStream& WPXMemoryInputStream::operator= ( const WPXMemoryInputStream  ) [private]
const unsigned char * WPXMemoryInputStream::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 WPXInputStream.

int WPXMemoryInputStream::seek ( long  offset,
WPX_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 (WPX_SEEK_SET) or to the current position (WPX_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 WPXInputStream.

Referenced by WP6SubDocument::parse(), WP6ExtendedDocumentSummaryPacket::parse(), WP5SubDocument::parse(), WP42SubDocument::parse(), WP3SubDocument::parse(), and WP1SubDocument::parse().

long WPXMemoryInputStream::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 WPXInputStream.


Member Data Documentation

unsigned char* WPXMemoryInputStream::m_data [private]

Referenced by read().

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

unsigned long WPXMemoryInputStream::m_size [private]

Referenced by atEOS(), read(), and seek().


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

Generated on Tue Dec 28 2010 12:10:01 for libwpd by doxygen 1.7.2