WPXInputStream Class Reference

#include <WPXStream.h>

Inheritance diagram for WPXInputStream:
WPXFileStream WPXMemoryInputStream WPXStringStream

Public Member Functions

 WPXInputStream ()
virtual ~WPXInputStream ()
virtual bool isOLEStream ()=0
 Analyses the content of the input stream to see whether it is an OLE2 storage.
virtual WPXInputStreamgetDocumentOLEStream (const char *name)=0
 Extracts a PerfectOffice_MAIN stream from an OLE2 storage.
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, WPX_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 atEOS ()=0
 Determines whether the current position is at the end of the stream.

Constructor & Destructor Documentation

WPXInputStream::WPXInputStream ( )
inline
virtual WPXInputStream::~WPXInputStream ( )
inlinevirtual

Member Function Documentation

virtual WPXInputStream* WPXInputStream::getDocumentOLEStream ( const char *  name)
pure 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.

Implemented in WPXStringStream, WPXFileStream, and WPXMemoryInputStream.

Referenced by WPDocument::isFileFormatSupported(), WPDocument::parse(), and WPDocument::verifyPassword().

virtual bool WPXInputStream::isOLEStream ( )
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 WPXStringStream, WPXFileStream, and WPXMemoryInputStream.

Referenced by WPDocument::isFileFormatSupported(), WPDocument::parse(), and WPDocument::verifyPassword().

virtual const unsigned char* WPXInputStream::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
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.

Implemented in WPXStringStream, WPXMemoryInputStream, and WPXFileStream.

Referenced by WPXEncryption::readAndDecrypt(), readU16(), readU32(), and readU8().

virtual int WPXInputStream::seek ( long  offset,
WPX_SEEK_TYPE  seekType 
)
pure 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).

Implemented in WPXStringStream, WPXMemoryInputStream, and WPXFileStream.

Referenced by WP1FixedLengthGroup::_read(), WP5GeneralPacketData::_read(), WP1VariableLengthGroup::_read(), WP3VariableLengthGroup::_read(), WP6FixedLengthGroup::_read(), WP5FixedLengthGroup::_read(), WP3FixedLengthGroup::_read(), WP6VariableLengthGroup::_read(), WP5VariableLengthGroup::_read(), WP6PrefixDataPacket::_read(), WP1BottomMarginGroup::_readContents(), WP1PointSizeGroup::_readContents(), WP1SetTabsGroup::_readContents(), WP1JustificationGroup::_readContents(), WP1SpacingResetGroup::_readContents(), WP1TopMarginGroup::_readContents(), WP42DefineColumnsGroup::_readContents(), WP42HeaderFooterGroup::_readContents(), WP6PageGroup::_readContents(), WP3DisplayGroup::_readContents(), WP6TabGroup::_readContents(), WP42MarginResetGroup::_readContents(), WP3HeaderFooterGroup::_readContents(), WP5HeaderFooterGroup::_readContents(), WP5ListFontsUsedPacket::_readContents(), WP5TableEOLGroup::_readContents(), WP3TablesGroup::_readContents(), WP6EOLGroup::_readContents(), WP1HeaderFooterGroup::_readContents(), WP6OutlineStylePacket::_readContents(), WP5FontGroup::_readContents(), WP3FontGroup::_readContents(), WP3FootnoteEndnoteGroup::_readContents(), WP6GraphicsBoxStylePacket::_readContents(), WP1MarginResetGroup::_readContents(), WP5BoxGroup::_readContents(), WP5FootnoteEndnoteGroup::_readContents(), WP3MiscellaneousGroup::_readContents(), WP1FootnoteEndnoteGroup::_readContents(), WP6GeneralTextPacket::_readContents(), WP6BoxGroup::_readContents(), WP1PictureGroup::_readContents(), WP5IndentGroup::_readContents(), WP5PageFormatGroup::_readContents(), WP3PageFormatGroup::_readContents(), WP5TabGroup::_readContents(), WP3DefinitionGroup::_readContents(), WP6FillStylePacket::_readContents(), WP3WindowGroup::_readContents(), WP6Header::_readIndexInformation(), WPXHeader::constructHeader(), WP6FixedLengthGroup::isGroupConsistent(), WP5FixedLengthGroup::isGroupConsistent(), WP3FixedLengthGroup::isGroupConsistent(), WP1VariableLengthGroup::isGroupConsistent(), WP3VariableLengthGroup::isGroupConsistent(), WP6VariableLengthGroup::isGroupConsistent(), WP5VariableLengthGroup::isGroupConsistent(), WP1Heuristics::isWP1FileFormat(), WP42Heuristics::isWP42FileFormat(), WP42Parser::parse(), WP1Parser::parse(), WPDocument::parse(), WP3Parser::parse(), WP5Parser::parse(), WP6Parser::parse(), WP3Parser::parseSubDocument(), WP5Parser::parseSubDocument(), WP1Parser::parseSubDocument(), WP6Parser::parseSubDocument(), WP42Heuristics::verifyPassword(), WP1Heuristics::verifyPassword(), WPDocument::verifyPassword(), WP3ResourceFork::WP3ResourceFork(), WP5DefinitionGroup_DefineTablesSubGroup::WP5DefinitionGroup_DefineTablesSubGroup(), WP5Header::WP5Header(), WP5PrefixData::WP5PrefixData(), WP61Header::WP61Header(), and WP6Header::WP6Header().

virtual long WPXInputStream::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 WPXStringStream, WPXMemoryInputStream, and WPXFileStream.

Referenced by WP1FixedLengthGroup::_read(), WP1VariableLengthGroup::_read(), WP3VariableLengthGroup::_read(), WP6FixedLengthGroup::_read(), WP5FixedLengthGroup::_read(), WP3FixedLengthGroup::_read(), WP6VariableLengthGroup::_read(), WP5VariableLengthGroup::_read(), WP42HeaderFooterGroup::_readContents(), WP3TablesGroup::_readContents(), WP6EOLGroup::_readContents(), WP5FontNameStringPoolPacket::_readContents(), WP6GraphicsBoxStylePacket::_readContents(), WP6GeneralTextPacket::_readContents(), WP1PictureGroup::_readContents(), WP6BoxGroup::_readContents(), WP1Part::constructPart(), WP42Part::constructPart(), WP6FixedLengthGroup::isGroupConsistent(), WP5FixedLengthGroup::isGroupConsistent(), WP3FixedLengthGroup::isGroupConsistent(), WP1VariableLengthGroup::isGroupConsistent(), WP3VariableLengthGroup::isGroupConsistent(), WP6VariableLengthGroup::isGroupConsistent(), WP5VariableLengthGroup::isGroupConsistent(), WP1Heuristics::isWP1FileFormat(), WP42Heuristics::isWP42FileFormat(), WP42Parser::parse(), WP1Parser::parse(), WP3Parser::parse(), WP5Parser::parse(), WP6Parser::parse(), WP42Parser::parseDocument(), WP1Parser::parseDocument(), WPXEncryption::readAndDecrypt(), WP3ResourceFork::WP3ResourceFork(), WP5DefinitionGroup_DefineTablesSubGroup::WP5DefinitionGroup_DefineTablesSubGroup(), and WP6CharacterGroup_FontFaceChangeSubGroup::WP6CharacterGroup_FontFaceChangeSubGroup().


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

Generated for libwpd by doxygen 1.8.1.2