LibreOffice Module oox (master) 1
|
Wraps a UNO output stream and provides convenient access functions. More...
#include <binaryoutputstream.hxx>
Public Member Functions | |
BinaryXOutputStream (const css::uno::Reference< css::io::XOutputStream > &rxOutStrm, bool bAutoClose) | |
Constructs the wrapper object for the passed output stream. More... | |
virtual | ~BinaryXOutputStream () override |
void | close () override |
Flushes and closes the output stream. 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... | |
Public Member Functions inherited from oox::BinaryXSeekableStream | |
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... | |
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) |
Private Attributes | |
StreamDataSequence | maBuffer |
Data buffer used in writeMemory() function. More... | |
css::uno::Reference< css::io::XOutputStream > | mxOutStrm |
Reference to the output stream. More... | |
bool | mbAutoClose |
True = automatically close stream on destruction. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from oox::BinaryXSeekableStream | |
BinaryXSeekableStream (const css::uno::Reference< css::io::XSeekable > &rxSeekable) | |
Protected Member Functions inherited from oox::BinaryStreamBase | |
BinaryStreamBase (bool bSeekable) | |
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 Attributes inherited from oox::BinaryStreamBase | |
bool | mbEof |
End of stream flag. More... | |
Wraps a UNO output stream and provides convenient access functions.
The binary data in the stream is written in little-endian format.
Definition at line 128 of file binaryoutputstream.hxx.
|
explicit |
Constructs the wrapper object for the passed output stream.
rxOutStream | The com.sun.star.io.XOutputStream interface of the output stream to be wrapped. |
bAutoClose | True = automatically close the wrapped output stream on destruction of this wrapper or when close() is called. |
Definition at line 38 of file binaryoutputstream.cxx.
References oox::BinaryStreamBase::mbEof, mxOutStrm, and Reference.
|
overridevirtual |
Definition at line 48 of file binaryoutputstream.cxx.
References close().
|
overridevirtual |
Flushes and closes the output stream.
Does also close the wrapped UNO output stream if bAutoClose has been set to true in the constructor.
Reimplemented from oox::BinaryXSeekableStream.
Definition at line 53 of file binaryoutputstream.cxx.
References oox::BinaryXSeekableStream::close(), Exception, mbAutoClose, and mxOutStrm.
Referenced by oox::crypto::DocumentEncryption::encrypt(), and ~BinaryXOutputStream().
|
overridevirtual |
Writes the passed data sequence.
Implements oox::BinaryOutputStream.
Definition at line 71 of file binaryoutputstream.cxx.
References Exception, and mxOutStrm.
Referenced by oox::crypto::DocumentEncryption::encrypt(), and writeMemory().
|
overridevirtual |
Write nBytes bytes from the (preallocated!) buffer pMem.
Implements oox::BinaryOutputStream.
Definition at line 83 of file binaryoutputstream.cxx.
References maBuffer, mxOutStrm, and writeData().
Referenced by oox::crypto::AgileEngine::decrypt(), oox::crypto::Standard2007Engine::decrypt(), oox::crypto::AgileEngine::encrypt(), oox::crypto::Standard2007Engine::encrypt(), oox::crypto::AgileEngine::writeEncryptionInfo(), and oox::crypto::Standard2007Engine::writeEncryptionInfo().
|
private |
Data buffer used in writeMemory() function.
Definition at line 158 of file binaryoutputstream.hxx.
Referenced by writeMemory().
|
private |
True = automatically close stream on destruction.
Definition at line 161 of file binaryoutputstream.hxx.
Referenced by close().
|
private |
Reference to the output stream.
Definition at line 160 of file binaryoutputstream.hxx.
Referenced by BinaryXOutputStream(), close(), writeData(), and writeMemory().