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

Base class for binary input and output streams wrapping a StreamDataSequence, which is always seekable. More...

#include <binarystreambase.hxx>

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

Public Member Functions

virtual sal_Int64 size () const override
 Returns the size of the wrapped data sequence. More...
 
virtual sal_Int64 tell () const override
 Returns the current stream position. More...
 
virtual void seek (sal_Int64 nPos) override
 Seeks the stream to the passed position. More...
 
virtual void close () override
 Releases the reference to the data sequence. 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

 SequenceSeekableStream (const StreamDataSequence &rData)
 
- Protected Member Functions inherited from oox::BinaryStreamBase
 BinaryStreamBase (bool bSeekable)
 

Protected Attributes

const StreamDataSequencempData
 Wrapped data sequence. More...
 
sal_Int32 mnPos
 Current position in the sequence. More...
 
- 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 StreamDataSequence, which is always seekable.

The wrapped data sequence MUST live at least as long as this stream wrapper. The data sequence MUST NOT be changed from outside as long as this stream wrapper is used to modify it.

Definition at line 154 of file binarystreambase.hxx.

Constructor & Destructor Documentation

◆ SequenceSeekableStream()

oox::SequenceSeekableStream::SequenceSeekableStream ( const StreamDataSequence rData)
explicitprotected

Definition at line 112 of file binarystreambase.cxx.

Member Function Documentation

◆ close()

void oox::SequenceSeekableStream::close ( )
overridevirtual

Releases the reference to the data sequence.

Implements oox::BinaryStreamBase.

Definition at line 138 of file binarystreambase.cxx.

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

◆ seek()

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

Seeks the stream to the passed position.

Implements oox::BinaryStreamBase.

Definition at line 129 of file binarystreambase.cxx.

References oox::BinaryStreamBase::mbEof, mnPos, mpData, and nPos.

◆ size()

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

Returns the size of the wrapped data sequence.

Implements oox::BinaryStreamBase.

Definition at line 119 of file binarystreambase.cxx.

References mpData.

◆ tell()

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

Returns the current stream position.

Implements oox::BinaryStreamBase.

Definition at line 124 of file binarystreambase.cxx.

References mnPos, and mpData.

Member Data Documentation

◆ mnPos

sal_Int32 oox::SequenceSeekableStream::mnPos
protected

◆ mpData

const StreamDataSequence* oox::SequenceSeekableStream::mpData
protected

Wrapped data sequence.

Definition at line 170 of file binarystreambase.hxx.

Referenced by close(), oox::SequenceInputStream::readData(), oox::SequenceInputStream::readMemory(), seek(), size(), and tell().


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