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

◆ ~BinaryStreamBase()

oox::BinaryStreamBase::~BinaryStreamBase ( )
virtual

Definition at line 31 of file binarystreambase.cxx.

◆ BinaryStreamBase() [1/2]

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

Definition at line 106 of file binarystreambase.hxx.

◆ BinaryStreamBase() [2/2]

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

Member Function Documentation

◆ alignToBlock()

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 43 of file binarystreambase.cxx.

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

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

◆ close()

virtual void oox::BinaryStreamBase::close ( )
pure virtual

◆ getRemaining()

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 35 of file binarystreambase.cxx.

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

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

◆ isEof()

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::VbaUserForm::importForm(), oox::ole::VbaFormControl::importModelOrStorage(), oox::ole::ComCtlModelBase::importSizePart(), oox::ole::OleHelper::importStdFont(), oox::ole::OleHelper::importStdPic(), oox::ole::VbaFormControl::importStorage(), oox::ole::AxControlFragment::onCreateContext(), oox::RelativeInputStream::readData(), oox::ole::AxAlignedInputStream::readData(), oox::ole::VbaHelper::readDirRecord(), oox::crypto::DocumentDecryption::readEncryptionInfo(), oox::crypto::Standard2007Engine::readEncryptionInfo(), oox::RelativeInputStream::readMemory(), oox::ole::AxAlignedInputStream::readMemory(), oox::ole::ComCtlModelBase::readPartHeader(), oox::ole::VbaModule::readSourceCode(), oox::ole::VbaProject::readVbaModules(), oox::RelativeInputStream::RelativeInputStream(), oox::RelativeInputStream::seek(), oox::ole::AxAlignedInputStream::skip(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().

◆ isSeekable()

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().

◆ operator=()

BinaryStreamBase & oox::BinaryStreamBase::operator= ( const BinaryStreamBase )
privatedelete

◆ seek()

virtual void oox::BinaryStreamBase::seek ( sal_Int64  nPos)
pure virtual

◆ seekToStart()

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().

◆ size()

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::BinaryXSeekableStream, oox::SequenceSeekableStream, 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().

◆ tell()

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

Member Data Documentation

◆ mbEof

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::RelativeInputStream::close(), oox::SequenceOutputStream::close(), oox::BinaryXSeekableStream::close(), oox::SequenceSeekableStream::close(), oox::ole::AxAlignedInputStream::close(), oox::ole::AxAlignedOutputStream::close(), oox::ole::VbaInputStream::close(), oox::BinaryInputStream::readArray(), oox::BinaryXInputStream::readData(), oox::SequenceInputStream::readData(), oox::RelativeInputStream::readData(), oox::ole::AxAlignedInputStream::readData(), oox::ole::VbaInputStream::readData(), oox::BinaryXInputStream::readMemory(), oox::SequenceInputStream::readMemory(), oox::RelativeInputStream::readMemory(), oox::ole::AxAlignedInputStream::readMemory(), oox::BinaryInputStream::readNulUnicodeArray(), oox::RelativeInputStream::RelativeInputStream(), oox::RelativeInputStream::seek(), oox::SequenceOutputStream::seek(), oox::BinaryXSeekableStream::seek(), oox::SequenceSeekableStream::seek(), oox::ole::AxAlignedInputStream::seek(), oox::ole::AxAlignedOutputStream::seek(), oox::BinaryXInputStream::skip(), oox::SequenceInputStream::skip(), oox::RelativeInputStream::skip(), oox::ole::AxAlignedInputStream::skip(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().

◆ mbSeekable

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: