diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/seekableinput.hxx | 6 | ||||
-rw-r--r-- | include/package/Inflater.hxx | 22 |
2 files changed, 27 insertions, 1 deletions
diff --git a/include/comphelper/seekableinput.hxx b/include/comphelper/seekableinput.hxx index 0c2092f7b849..2287b506e9e2 100644 --- a/include/comphelper/seekableinput.hxx +++ b/include/comphelper/seekableinput.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <cppuhelper/implbase.hxx> +#include <comphelper/bytereader.hxx> #include <comphelper/comphelperdllapi.h> #include <mutex> @@ -37,7 +38,7 @@ class SAL_DLLPUBLIC_TEMPLATE OSeekableInputWrapper_BASE {}; class COMPHELPER_DLLPUBLIC OSeekableInputWrapper final - : public OSeekableInputWrapper_BASE + : public OSeekableInputWrapper_BASE, public comphelper::ByteReader { std::mutex m_aMutex; @@ -47,6 +48,7 @@ class COMPHELPER_DLLPUBLIC OSeekableInputWrapper final css::uno::Reference< css::io::XInputStream > m_xCopyInput; css::uno::Reference< css::io::XSeekable > m_xCopySeek; + comphelper::ByteReader* m_pCopyByteReader { nullptr }; private: COMPHELPER_DLLPRIVATE void PrepareCopy_Impl(); @@ -74,6 +76,8 @@ public: virtual sal_Int64 SAL_CALL getPosition() override; virtual sal_Int64 SAL_CALL getLength() override; +// comphelper::ByteReader + virtual sal_Int32 readSomeBytes(sal_Int8* aData, sal_Int32 nBytesToRead) override; }; } // namespace comphelper diff --git a/include/package/Inflater.hxx b/include/package/Inflater.hxx index e0d44d21d6f6..d59d220acfc4 100644 --- a/include/package/Inflater.hxx +++ b/include/package/Inflater.hxx @@ -51,6 +51,28 @@ public: sal_Int32 getLastInflateError() const { return nLastInflateError; } }; +class UNLESS_MERGELIBS(DLLPUBLIC_PACKAGE) InflaterBytes final +{ + typedef struct z_stream_s z_stream; + + bool bFinished, bNeedDict; + sal_Int32 nOffset, nLength, nLastInflateError; + std::unique_ptr<z_stream> pStream; + const sal_Int8* sInBuffer; + sal_Int32 doInflateBytes (sal_Int8* pOutBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength); + +public: + InflaterBytes(bool bNoWrap); + ~InflaterBytes(); + void setInput( const sal_Int8* pBuffer, sal_Int32 nLen ); + bool needsDictionary() const { return bNeedDict; } + bool finished() const { return bFinished; } + sal_Int32 doInflateSegment( sal_Int8* pOutBuffer, sal_Int32 nBufLen, sal_Int32 nNewOffset, sal_Int32 nNewLength ); + void end( ); + + sal_Int32 getLastInflateError() const { return nLastInflateError; } +}; + } #endif |