LibreOffice Module oox (master) 1
|
Wraps a StreamDataSequence and provides convenient access functions. More...
#include <binaryoutputstream.hxx>
Public Member Functions | |
SequenceOutputStream (StreamDataSequence &rData) | |
Constructs the wrapper object for the passed data sequence. More... | |
virtual void | writeData (const StreamDataSequence &rData, size_t nAtomSize=1) override |
Writes the passed data sequence. More... | |
virtual void | writeMemory (const void *pMem, sal_Int32 nBytes, size_t nAtomSize=1) override |
Write nBytes bytes from the (preallocated!) buffer pMem. More... | |
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::BinaryOutputStream | |
virtual void | writeData (const StreamDataSequence &rData, size_t nAtomSize=1)=0 |
Derived classes implement writing the contents of the passed data sequence. More... | |
virtual void | writeMemory (const void *pMem, sal_Int32 nBytes, size_t nAtomSize=1)=0 |
Derived classes implement writing the contents of the (preallocated!) memory buffer pMem. More... | |
template<typename Type > | |
void | writeArray (Type *opnArray, sal_Int32 nElemCount) |
template<typename Type > | |
void | writeArray (const Type *opnArray, sal_Int32 nElemCount) |
template<typename Type > | |
void | writeValue (Type nValue) |
Writes a value to the stream and converts it to platform byte order. More... | |
BinaryOutputStream & | WriteInt16 (sal_Int16 x) |
BinaryOutputStream & | WriteUInt16 (sal_uInt16 x) |
BinaryOutputStream & | WriteInt32 (sal_Int32 x) |
BinaryOutputStream & | WriteUInt32 (sal_uInt32 x) |
BinaryOutputStream & | WriteInt64 (sal_Int64 x) |
void | writeCompressedUnicodeArray (const OUString &rString, bool bCompressed) |
void | writeCharArrayUC (std::u16string_view rString, rtl_TextEncoding eTextEnc) |
void | writeUnicodeArray (const OUString &rString) |
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... | |
Private Attributes | |
StreamDataSequence * | mpData |
Wrapped data sequence. More... | |
sal_Int32 | mnPos |
Current position in the sequence. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from oox::BinaryOutputStream | |
BinaryOutputStream () | |
This dummy default c'tor will never call the c'tor of the virtual base class BinaryStreamBase as this class cannot be instantiated directly. More... | |
Protected Member Functions inherited from oox::BinaryStreamBase | |
BinaryStreamBase (bool bSeekable) | |
Protected Attributes inherited from oox::BinaryStreamBase | |
bool | mbEof |
End of stream flag. More... | |
Wraps a StreamDataSequence and provides convenient access functions.
The binary data in the stream is written in little-endian format. After construction, the stream points to the beginning of the passed data sequence. The data sequence is expanded automatically while writing to it.
Definition at line 171 of file binaryoutputstream.hxx.
|
explicit |
Constructs the wrapper object for the passed data sequence.
Definition at line 132 of file binaryoutputstream.cxx.
|
overridevirtual |
Releases the reference to the data sequence.
Implements oox::BinaryStreamBase.
Definition at line 175 of file binaryoutputstream.cxx.
References oox::BinaryStreamBase::mbEof, and mpData.
|
overridevirtual |
Seeks the stream to the passed position.
Implements oox::BinaryStreamBase.
Definition at line 166 of file binaryoutputstream.cxx.
References oox::BinaryStreamBase::mbEof, mnPos, mpData, and nPos.
|
overridevirtual |
Returns the size of the wrapped data sequence.
Implements oox::BinaryStreamBase.
Definition at line 156 of file binaryoutputstream.cxx.
References mpData.
|
overridevirtual |
Returns the current stream position.
Implements oox::BinaryStreamBase.
Definition at line 161 of file binaryoutputstream.cxx.
|
overridevirtual |
Writes the passed data sequence.
Implements oox::BinaryOutputStream.
Definition at line 139 of file binaryoutputstream.cxx.
References mpData, and writeMemory().
|
overridevirtual |
Write nBytes bytes from the (preallocated!) buffer pMem.
Implements oox::BinaryOutputStream.
Definition at line 145 of file binaryoutputstream.cxx.
Referenced by writeData().
|
private |
Current position in the sequence.
Definition at line 200 of file binaryoutputstream.hxx.
Referenced by seek(), tell(), and writeMemory().
|
private |
Wrapped data sequence.
Definition at line 199 of file binaryoutputstream.hxx.
Referenced by close(), seek(), size(), tell(), writeData(), and writeMemory().