LibreOffice Module oox (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
oox::BinaryOutputStream Class Referenceabstract

Interface for binary output stream classes. More...

#include <binaryoutputstream.hxx>

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

Public Member Functions

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...
 
BinaryOutputStreamWriteInt16 (sal_Int16 x)
 
BinaryOutputStreamWriteUInt16 (sal_uInt16 x)
 
BinaryOutputStreamWriteInt32 (sal_Int32 x)
 
BinaryOutputStreamWriteUInt32 (sal_uInt32 x)
 
BinaryOutputStreamWriteInt64 (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...
 

Protected Member Functions

 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)
 

Private Member Functions

 BinaryOutputStream (BinaryOutputStream const &)=delete
 
BinaryOutputStreamoperator= (BinaryOutputStream const &)=delete
 

Additional Inherited Members

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

Detailed Description

Interface for binary output stream classes.

The binary data in the stream is written in little-endian format.

Definition at line 45 of file binaryoutputstream.hxx.

Constructor & Destructor Documentation

◆ BinaryOutputStream() [1/2]

oox::BinaryOutputStream::BinaryOutputStream ( )
inlineprotected

This dummy default c'tor will never call the c'tor of the virtual base class BinaryStreamBase as this class cannot be instantiated directly.

Definition at line 93 of file binaryoutputstream.hxx.

◆ BinaryOutputStream() [2/2]

oox::BinaryOutputStream::BinaryOutputStream ( BinaryOutputStream const &  )
privatedelete

Member Function Documentation

◆ operator=()

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

◆ writeArray() [1/2]

template<typename Type >
void oox::BinaryOutputStream::writeArray ( const Type opnArray,
sal_Int32  nElemCount 
)

Definition at line 109 of file binaryoutputstream.hxx.

References writeArray().

◆ writeArray() [2/2]

template<typename Type >
void oox::BinaryOutputStream::writeArray ( Type opnArray,
sal_Int32  nElemCount 
)

◆ writeCharArrayUC()

void oox::BinaryOutputStream::writeCharArrayUC ( std::u16string_view  rString,
rtl_TextEncoding  eTextEnc 
)

Definition at line 102 of file binaryoutputstream.cxx.

References OUStringToOString(), and writeMemory().

Referenced by writeCompressedUnicodeArray().

◆ writeCompressedUnicodeArray()

void oox::BinaryOutputStream::writeCompressedUnicodeArray ( const OUString &  rString,
bool  bCompressed 
)

Definition at line 123 of file binaryoutputstream.cxx.

References writeCharArrayUC(), and writeUnicodeArray().

◆ writeData()

virtual void oox::BinaryOutputStream::writeData ( const StreamDataSequence rData,
size_t  nAtomSize = 1 
)
pure virtual

Derived classes implement writing the contents of the passed data sequence.

Parameters
nAtomSizeThe size of the elements in the memory block, if available. Derived classes may be interested in this information.

Implemented in oox::ole::AxAlignedOutputStream, oox::BinaryXOutputStream, and oox::SequenceOutputStream.

Referenced by oox::BinaryInputStream::copyToStream(), oox::ole::AxAlignedOutputStream::pad(), and oox::ole::AxAlignedOutputStream::writeData().

◆ WriteInt16()

BinaryOutputStream & oox::BinaryOutputStream::WriteInt16 ( sal_Int16  x)
inline

Definition at line 78 of file binaryoutputstream.hxx.

References writeValue(), and x.

Referenced by oox::ole::AxBinaryPropertyWriter::finalizeExport().

◆ WriteInt32()

BinaryOutputStream & oox::BinaryOutputStream::WriteInt32 ( sal_Int32  x)
inline

◆ WriteInt64()

BinaryOutputStream & oox::BinaryOutputStream::WriteInt64 ( sal_Int64  x)
inline

◆ writeMemory()

virtual void oox::BinaryOutputStream::writeMemory ( const void *  pMem,
sal_Int32  nBytes,
size_t  nAtomSize = 1 
)
pure virtual

◆ WriteUInt16()

BinaryOutputStream & oox::BinaryOutputStream::WriteUInt16 ( sal_uInt16  x)
inline

◆ WriteUInt32()

BinaryOutputStream & oox::BinaryOutputStream::WriteUInt32 ( sal_uInt32  x)
inline

◆ writeUnicodeArray()

void oox::BinaryOutputStream::writeUnicodeArray ( const OUString &  rString)

◆ writeValue()

template<typename Type >
void oox::BinaryOutputStream::writeValue ( Type  nValue)

Writes a value to the stream and converts it to platform byte order.

All data types supported by the ByteOrderConverter class can be used.

Definition at line 117 of file binaryoutputstream.hxx.

References oox::ByteOrderConverter::convertLittleEndian(), nValue, and writeMemory().

Referenced by oox::ole::AxAlignedOutputStream::writeAligned(), WriteInt16(), WriteInt32(), WriteInt64(), WriteUInt16(), and WriteUInt32().


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