20#ifndef INCLUDED_OOX_HELPER_BINARYSTREAMBASE_HXX
21#define INCLUDED_OOX_HELPER_BINARYSTREAMBASE_HXX
23#include <com/sun/star/uno/Reference.hxx>
24#include <com/sun/star/uno/Sequence.hxx>
29 namespace io {
class XSeekable; }
52 virtual sal_Int64
size()
const = 0;
62 virtual sal_Int64
tell()
const = 0;
67 virtual void seek( sal_Int64 nPos ) = 0;
83 bool isEof()
const {
return mbEof; }
88 sal_Int64 getRemaining()
const;
103 void alignToBlock( sal_Int32 nBlockSize, sal_Int64 nAnchorPos );
129 virtual sal_Int64
size()
const override;
131 virtual sal_Int64
tell()
const override;
133 virtual void seek( sal_Int64
nPos )
override;
135 virtual void close()
override;
139 const css::uno::Reference< css::io::XSeekable >& rxSeekable );
142 css::uno::Reference< css::io::XSeekable >
158 virtual sal_Int64
size()
const override;
160 virtual sal_Int64 tell()
const override;
162 virtual void seek( sal_Int64
nPos )
override;
164 virtual void close()
override;
Base class for binary stream classes.
bool isSeekable() const
Returns true, if the implementation supports the seek() operation.
BinaryStreamBase & operator=(const BinaryStreamBase &)=delete
virtual sal_Int64 size() const =0
Implementations return the size of the stream, if possible.
virtual void close()=0
Implementations close the stream.
void seekToStart()
Seeks the stream to the beginning, if stream is seekable.
const bool mbSeekable
True = implementation supports seeking.
BinaryStreamBase(const BinaryStreamBase &)=delete
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.
BinaryStreamBase(bool bSeekable)
Base class for binary input and output streams wrapping a UNO stream, seekable via the com....
BinaryXSeekableStream(const css::uno::Reference< css::io::XSeekable > &rxSeekable)
virtual ~BinaryXSeekableStream() override
virtual void close() override
Releases the reference to the UNO XSeekable interface.
virtual sal_Int64 tell() const override
Returns the current stream position, if wrapped stream is seekable, otherwise -1.
css::uno::Reference< css::io::XSeekable > mxSeekable
Stream seeking interface.
virtual sal_Int64 size() const override
Returns the size of the stream, if wrapped stream is seekable, otherwise -1.
virtual void seek(sal_Int64 nPos) override
Seeks the stream to the passed position, if wrapped stream is seekable.
Base class for binary input and output streams wrapping a StreamDataSequence, which is always seekabl...
sal_Int32 mnPos
Current position in the sequence.
const StreamDataSequence * mpData
Wrapped data sequence.
css::uno::Sequence< sal_Int8 > StreamDataSequence