LibreOffice Module oox (master)  1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
oox::BinaryStreamBase Class Referenceabstract

Base class for binary stream classes. More...

#include <binarystreambase.hxx>

Inheritance diagram for oox::BinaryStreamBase:
[legend]

Public Member Functions

virtual ~BinaryStreamBase ()
 
virtual sal_Int64 size () const =0
 Implementations return the size of the stream, if possible. More...
 
virtual sal_Int64 tell () const =0
 Implementations return the current stream position, if possible. More...
 
virtual void seek (sal_Int64 nPos)=0
 Implementations seek the stream to the passed position, if the stream is seekable. More...
 
virtual void close ()=0
 Implementations close the stream. More...
 
bool isSeekable () const
 Returns true, if the implementation supports the seek() operation. More...
 
bool isEof () const
 Returns true, if the stream position is invalid (EOF). More...
 
sal_Int64 getRemaining () const
 Returns the size of the remaining data available in the stream, if stream supports size() and tell(), otherwise -1. More...
 
void seekToStart ()
 Seeks the stream to the beginning, if stream is seekable. More...
 
void alignToBlock (sal_Int32 nBlockSize, sal_Int64 nAnchorPos)
 Seeks the stream forward to a position that is a multiple of the passed block size, if stream is seekable. More...
 

Protected Member Functions

 BinaryStreamBase (bool bSeekable)
 

Protected Attributes

bool mbEof
 End of stream flag. More...
 

Private Member Functions

 BinaryStreamBase (const BinaryStreamBase &)=delete
 
BinaryStreamBaseoperator= (const BinaryStreamBase &)=delete
 

Private Attributes

const bool mbSeekable
 True = implementation supports seeking. More...
 

Detailed Description

Base class for binary stream classes.

Definition at line 39 of file binarystreambase.hxx.

Constructor & Destructor Documentation

oox::BinaryStreamBase::~BinaryStreamBase ( )
virtual

Definition at line 32 of file binarystreambase.cxx.

oox::BinaryStreamBase::BinaryStreamBase ( bool  bSeekable)
inlineexplicitprotected

Definition at line 106 of file binarystreambase.hxx.

oox::BinaryStreamBase::BinaryStreamBase ( const BinaryStreamBase )
privatedelete

Member Function Documentation

void oox::BinaryStreamBase::alignToBlock ( sal_Int32  nBlockSize,
sal_Int64  nAnchorPos 
)

Seeks the stream forward to a position that is a multiple of the passed block size, if stream is seekable.

Parameters
nBlockSizeThe size of the data blocks the streams needs to be aligned to.
nAnchorPosPosition in the stream the data blocks are aligned to.

Definition at line 44 of file binarystreambase.cxx.

References mbSeekable, seek(), and tell().

Referenced by oox::ole::VbaFormControl::importEmbeddedSiteModels().

virtual void oox::BinaryStreamBase::close ( )
pure virtual
sal_Int64 oox::BinaryStreamBase::getRemaining ( ) const

Returns the size of the remaining data available in the stream, if stream supports size() and tell(), otherwise -1.

Definition at line 36 of file binarystreambase.cxx.

References nPos, size(), and tell().

Referenced by oox::crypto::DocumentDecryption::readEncryptionInfo(), and oox::RelativeInputStream::RelativeInputStream().

bool oox::BinaryStreamBase::isEof ( ) const
inline

Returns true, if the stream position is invalid (EOF).

This flag turns true after the first attempt to seek/read beyond the stream end.

Definition at line 83 of file binarystreambase.hxx.

Referenced by oox::ole::AxAlignedInputStream::AxAlignedInputStream(), oox::ole::AxAlignedOutputStream::AxAlignedOutputStream(), oox::ole::AxBinaryPropertyWriter::ensureValid(), oox::ole::AxBinaryPropertyReader::ensureValid(), oox::dump::StorageObjectBase::extractStream(), oox::dump::DffStreamObject::implReadRecordHeader(), oox::dump::VbaDirStreamObject::implReadRecordHeader(), oox::dump::SequenceRecordObjectBase::implStartRecord(), oox::core::FilterBase::importBinaryData(), oox::ole::ComCtlModelBase::importBinaryModel(), oox::ole::ComCtlModelBase::importCommonPart(), oox::ole::ComCtlModelBase::importComplexPart(), oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::ole::VbaFormControl::importModelOrStorage(), oox::ole::ComCtlModelBase::importSizePart(), oox::ole::OleHelper::importStdFont(), oox::ole::OleHelper::importStdPic(), oox::ole::AxControlFragment::onCreateContext(), oox::ole::AxAlignedInputStream::readData(), oox::RelativeInputStream::readData(), oox::ole::VbaHelper::readDirRecord(), oox::crypto::Standard2007Engine::readEncryptionInfo(), oox::crypto::DocumentDecryption::readEncryptionInfo(), oox::ole::AxAlignedInputStream::readMemory(), oox::RelativeInputStream::readMemory(), oox::ole::ComCtlModelBase::readPartHeader(), oox::RelativeInputStream::RelativeInputStream(), oox::RelativeInputStream::seek(), oox::ole::AxAlignedInputStream::skip(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().

bool oox::BinaryStreamBase::isSeekable ( ) const
inline

Returns true, if the implementation supports the seek() operation.

Implementations may still implement size() and tell() even if the stream is not seekable.

Definition at line 78 of file binarystreambase.hxx.

Referenced by oox::dump::SequenceRecordObjectBase::implStartRecord(), and oox::RelativeInputStream::seek().

BinaryStreamBase& oox::BinaryStreamBase::operator= ( const BinaryStreamBase )
privatedelete
virtual void oox::BinaryStreamBase::seek ( sal_Int64  nPos)
pure virtual
void oox::BinaryStreamBase::seekToStart ( )
inline

Seeks the stream to the beginning, if stream is seekable.

Definition at line 92 of file binarystreambase.hxx.

Referenced by oox::core::RecordParser::parseStream().

virtual sal_Int64 oox::BinaryStreamBase::size ( ) const
pure virtual

Implementations return the size of the stream, if possible.

This function may be implemented for some types of unseekable streams, and MUST be implemented for all seekable streams.

Returns
The size of the stream in bytes, or -1, if not implemented.

Implemented in oox::RelativeInputStream, oox::SequenceOutputStream, oox::SequenceSeekableStream, oox::BinaryXSeekableStream, oox::ole::AxAlignedInputStream, oox::ole::AxAlignedOutputStream, and oox::ole::VbaInputStream.

Referenced by getRemaining(), oox::dump::SequenceRecordObjectBase::implStartRecord(), oox::ole::HtmlSelectModel::importBinaryModel(), and oox::ole::HtmlTextBoxModel::importBinaryModel().

virtual sal_Int64 oox::BinaryStreamBase::tell ( ) const
pure virtual

Member Data Documentation

bool oox::BinaryStreamBase::mbEof
protected

End of stream flag.

Definition at line 113 of file binarystreambase.hxx.

Referenced by oox::ole::AxAlignedInputStream::AxAlignedInputStream(), oox::ole::AxAlignedOutputStream::AxAlignedOutputStream(), oox::BinaryXInputStream::BinaryXInputStream(), oox::BinaryXOutputStream::BinaryXOutputStream(), oox::ole::VbaInputStream::close(), oox::ole::AxAlignedOutputStream::close(), oox::ole::AxAlignedInputStream::close(), oox::BinaryXSeekableStream::close(), oox::SequenceSeekableStream::close(), oox::SequenceOutputStream::close(), oox::RelativeInputStream::close(), oox::BinaryInputStream::readArray(), oox::ole::VbaInputStream::readData(), oox::ole::AxAlignedInputStream::readData(), oox::BinaryXInputStream::readData(), oox::SequenceInputStream::readData(), oox::RelativeInputStream::readData(), oox::ole::AxAlignedInputStream::readMemory(), oox::BinaryXInputStream::readMemory(), oox::SequenceInputStream::readMemory(), oox::RelativeInputStream::readMemory(), oox::BinaryInputStream::readNulUnicodeArray(), oox::RelativeInputStream::RelativeInputStream(), oox::ole::AxAlignedOutputStream::seek(), oox::ole::AxAlignedInputStream::seek(), oox::BinaryXSeekableStream::seek(), oox::SequenceSeekableStream::seek(), oox::SequenceOutputStream::seek(), oox::RelativeInputStream::seek(), oox::ole::AxAlignedInputStream::skip(), oox::BinaryXInputStream::skip(), oox::SequenceInputStream::skip(), oox::RelativeInputStream::skip(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().

const bool oox::BinaryStreamBase::mbSeekable
private

True = implementation supports seeking.

Definition at line 116 of file binarystreambase.hxx.

Referenced by alignToBlock().


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