15const sal_uInt32 AX_STRING_COMPRESSED = 0x80000000;
21 mpOutStrm( &rOutStrm ),
23 mnStrmSize( rOutStrm.getRemaining() ),
24 mnWrappedBeginPos( rOutStrm.tell() )
70 css::uno::Sequence< sal_Int8 >
aData( nBytes );
74 memset(
static_cast<void*
>(
aData.getArray() ), 0, nBytes );
81 pad(
static_cast< sal_Int32
>( (nSize - (
mnStrmPos % nSize)) % nSize ) );
88 bool bCompressed =
getFlag( nSize, AX_STRING_COMPRESSED );
106 lclWriteString( rOutStrm, mrValue,
mnSize );
116 sal_uInt16
nId( 0x0200 );
144 sal_uInt32 nSize = orValue.getLength() * 2;
145 setFlag( nSize, AX_STRING_COMPRESSED,
false );
Interface for binary output stream classes.
BinaryOutputStream & WriteUInt32(sal_uInt32 x)
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.
BinaryOutputStream & WriteInt32(sal_Int32 x)
BinaryOutputStream & WriteInt16(sal_Int16 x)
BinaryOutputStream & WriteUInt16(sal_uInt16 x)
void writeCompressedUnicodeArray(const OUString &rString, bool bCompressed)
BinaryOutputStream & WriteInt64(sal_Int64 x)
virtual void writeData(const StreamDataSequence &rData, size_t nAtomSize=1)=0
Derived classes implement writing the contents of the passed data sequence.
Base class for binary stream classes.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
virtual sal_Int64 tell() const =0
Implementations return the current stream position, if possible.
virtual void seek(sal_Int64 nPos)=0
Implementations seek the stream to the passed position, if the stream is seekable.
bool mbEof
End of stream flag.
container_type::value_type value_type
A wrapper for a binary output stream that supports aligned write operations.
void align(size_t nSize)
Aligns the stream to a multiple of the passed size (relative to the position of the wrapped stream at...
void pad(sal_Int32 nBytes)
virtual void writeMemory(const void *pMem, sal_Int32 nBytes, size_t nAtomSize=1) override
Reads nBytes bytes to the (existing) buffer opMem.
BinaryOutputStream * mpOutStrm
The wrapped input stream.
virtual void close() override
Closes the input stream but not the wrapped stream.
sal_Int64 mnStrmPos
Tracks relative position in the stream.
virtual sal_Int64 tell() const override
Return the current relative stream position (relative to position of the wrapped stream at constructi...
void writeAligned(Type nVal)
Aligns the stream according to the passed type and reads a value.
virtual void writeData(const StreamDataSequence &orData, size_t nAtomSize=1) override
Reads nBytes bytes to the passed sequence.
AxAlignedOutputStream(BinaryOutputStream &rOutStrm)
sal_Int64 mnStrmSize
Size of the wrapped stream data.
sal_Int64 mnWrappedBeginPos
starting pos or wrapped stream
virtual sal_Int64 size() const override
Returns the size of the data this stream represents, if the wrapped stream supports the size() operat...
virtual void seek(sal_Int64 nPos) override
Seeks the stream to the passed relative position, if it is behind the current position.
ComplexPropVector maStreamProps
Stores info for all used stream data properties.
void finalizeExport()
Final processing, write contents of all complex properties, writes record size.
void writeBoolProperty(bool orbValue)
Write a boolean property value to the stream, the respective flag in the property mask is set.
sal_Int64 mnPropFlagsStart
pos of Prop flags
ComplexPropVector maLargeProps
Stores info for all used large properties.
void writePairProperty(AxPairData &orPairData)
Write a pair property the stream, the respective flag in the property mask is set.
bool mbValid
True = stream still valid.
AxBinaryPropertyWriter(BinaryOutputStream &rOutStrm, bool b64BitPropFlags=false)
AxAlignedOutputStream maOutStrm
The input stream to read from.
sal_Int64 mnPropFlags
Flags specifying existing properties.
void startNextProperty(bool bSkip=false)
void writeStringProperty(OUString &orValue)
Write a string property to the stream, the respective flag in the property mask is set.
sal_Int64 mnNextProp
Next property to read.
::std::pair< sal_Int32, sal_Int32 > AxPairData
A pair of integer values as a property.
void setFlag(Type &ornBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in ornBitField.
css::uno::Sequence< sal_Int8 > StreamDataSequence
bool getFlag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
virtual ~ComplexProperty()
virtual bool writeProperty(AxAlignedOutputStream &rOutStrm) override
virtual bool writeProperty(AxAlignedOutputStream &rOutStrm) override