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

Base class for binary input and output streams wrapping a UNO stream, seekable via the com.sun.star.io.XSeekable interface. More...

#include <binarystreambase.hxx>

Inheritance diagram for oox::BinaryXSeekableStream:
[legend]
Collaboration diagram for oox::BinaryXSeekableStream:
[legend]

Public Member Functions

virtual ~BinaryXSeekableStream () override
 
virtual sal_Int64 size () const override
 Returns the size of the stream, if wrapped stream is seekable, otherwise -1. More...
 
virtual sal_Int64 tell () const override
 Returns the current stream position, if wrapped stream is seekable, otherwise -1. More...
 
virtual void seek (sal_Int64 nPos) override
 Seeks the stream to the passed position, if wrapped stream is seekable. More...
 
virtual void close () override
 Releases the reference to the UNO XSeekable interface. More...
 
- Public Member Functions inherited from oox::BinaryStreamBase
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

 BinaryXSeekableStream (const css::uno::Reference< css::io::XSeekable > &rxSeekable)
 
- Protected Member Functions inherited from oox::BinaryStreamBase
 BinaryStreamBase (bool bSeekable)
 

Private Attributes

css::uno::Reference< css::io::XSeekable > mxSeekable
 Stream seeking interface. More...
 

Additional Inherited Members

- Protected Attributes inherited from oox::BinaryStreamBase
bool mbEof
 End of stream flag. More...
 

Detailed Description

Base class for binary input and output streams wrapping a UNO stream, seekable via the com.sun.star.io.XSeekable interface.

Definition at line 123 of file binarystreambase.hxx.

Constructor & Destructor Documentation

◆ ~BinaryXSeekableStream()

oox::BinaryXSeekableStream::~BinaryXSeekableStream ( )
overridevirtual

Definition at line 63 of file binarystreambase.cxx.

◆ BinaryXSeekableStream()

oox::BinaryXSeekableStream::BinaryXSeekableStream ( const css::uno::Reference< css::io::XSeekable > &  rxSeekable)
explicitprotected

Definition at line 57 of file binarystreambase.cxx.

Member Function Documentation

◆ close()

void oox::BinaryXSeekableStream::close ( )
overridevirtual

Releases the reference to the UNO XSeekable interface.

Implements oox::BinaryStreamBase.

Reimplemented in oox::BinaryXInputStream, and oox::BinaryXOutputStream.

Definition at line 106 of file binarystreambase.cxx.

References oox::BinaryStreamBase::mbEof, and mxSeekable.

Referenced by oox::BinaryXInputStream::close(), and oox::BinaryXOutputStream::close().

◆ seek()

void oox::BinaryXSeekableStream::seek ( sal_Int64  nPos)
overridevirtual

Seeks the stream to the passed position, if wrapped stream is seekable.

Implements oox::BinaryStreamBase.

Definition at line 93 of file binarystreambase.cxx.

References Exception, oox::BinaryStreamBase::mbEof, mxSeekable, and nPos.

Referenced by oox::ole::MSConvertOCXControls::ReadOCXCtlsStream(), and oox::ole::VbaModule::readSourceCode().

◆ size()

sal_Int64 oox::BinaryXSeekableStream::size ( ) const
overridevirtual

Returns the size of the stream, if wrapped stream is seekable, otherwise -1.

Implements oox::BinaryStreamBase.

Definition at line 67 of file binarystreambase.cxx.

References Exception, mxSeekable, and TOOLS_WARN_EXCEPTION.

Referenced by oox::crypto::DocumentDecryption::DocumentDecryption(), and oox::ole::MSConvertOCXControls::ReadOCXStorage().

◆ tell()

sal_Int64 oox::BinaryXSeekableStream::tell ( ) const
overridevirtual

Returns the current stream position, if wrapped stream is seekable, otherwise -1.

Implements oox::BinaryStreamBase.

Definition at line 80 of file binarystreambase.cxx.

References Exception, mxSeekable, and TOOLS_WARN_EXCEPTION.

Member Data Documentation

◆ mxSeekable

css::uno::Reference< css::io::XSeekable > oox::BinaryXSeekableStream::mxSeekable
private

Stream seeking interface.

Definition at line 143 of file binarystreambase.hxx.

Referenced by close(), seek(), size(), and tell().


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