From 0e56df30f13a027cf49a4fa2f15817944b04aafc Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 29 Mar 2011 14:18:56 +0200 Subject: Namespace ZipUtils for the Inflater / Deflater classes. --- package/inc/Deflater.hxx | 11 +++++++---- package/inc/Inflater.hxx | 12 ++++++++---- package/inc/ZipFile.hxx | 2 +- package/inc/ZipOutputStream.hxx | 2 +- package/source/zipapi/Deflater.cxx | 1 + package/source/zipapi/Inflater.cxx | 1 + package/source/zipapi/XUnbufferedStream.hxx | 2 +- package/source/zipapi/ZipFile.cxx | 1 + 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/package/inc/Deflater.hxx b/package/inc/Deflater.hxx index cf1229d8a9fa..6c1cf4456d30 100644 --- a/package/inc/Deflater.hxx +++ b/package/inc/Deflater.hxx @@ -31,13 +31,14 @@ #include #include "packagedllapi.hxx" -extern "C" -{ - typedef struct z_stream_s z_stream; -} +struct z_stream_s; + +namespace ZipUtils { class DLLPUBLIC_PACKAGE Deflater { + typedef struct z_stream_s z_stream; + protected: com::sun::star::uno::Sequence< sal_Int8 > sInBuffer; sal_Bool bFinish; @@ -65,6 +66,8 @@ public: void SAL_CALL end( ); }; +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/Inflater.hxx b/package/inc/Inflater.hxx index a7adcf371477..f5241df133d2 100644 --- a/package/inc/Inflater.hxx +++ b/package/inc/Inflater.hxx @@ -31,12 +31,14 @@ #include #include "packagedllapi.hxx" -extern "C" -{ - typedef struct z_stream_s z_stream; -} +struct z_stream_s; + +namespace ZipUtils { + class DLLPUBLIC_PACKAGE Inflater { + typedef struct z_stream_s z_stream; + protected: sal_Bool bFinish, bFinished, bSetParams, bNeedDict; sal_Int32 nOffset, nLength, nLastInflateError; @@ -56,6 +58,8 @@ public: sal_Int32 getLastInflateError() { return nLastInflateError; } }; +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 0e182ae6900c..8193eef68a5d 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -66,7 +66,7 @@ protected: ::rtl::OUString sComment; /* zip file comment */ EntryHash aEntries; ByteGrabber aGrabber; - Inflater aInflater; + ZipUtils::Inflater aInflater; com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xFactory; diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index 3ea34339428b..9cd58d74e657 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -49,7 +49,7 @@ protected: ::std::vector < ZipEntry * > aZipList; com::sun::star::uno::Sequence < sal_Int8 > aBuffer, aEncryptionBuffer; ::rtl::OUString sComment; - Deflater aDeflater; + ZipUtils::Deflater aDeflater; rtlCipher aCipher; rtlDigest aDigest; CRC32 aCRC; diff --git a/package/source/zipapi/Deflater.cxx b/package/source/zipapi/Deflater.cxx index b2c1edb07cbc..cd90de5b09e3 100644 --- a/package/source/zipapi/Deflater.cxx +++ b/package/source/zipapi/Deflater.cxx @@ -41,6 +41,7 @@ using namespace com::sun::star::packages::zip::ZipConstants; using namespace com::sun::star; +using namespace ZipUtils; /** Provides general purpose compression using the ZLIB compression * library. diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx index 26ba278cc9de..a32a0007f541 100644 --- a/package/source/zipapi/Inflater.cxx +++ b/package/source/zipapi/Inflater.cxx @@ -39,6 +39,7 @@ #include // for memset using namespace com::sun::star::uno; +using namespace ZipUtils; /** Provides general purpose decompression using the ZLIB library */ diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx index 0de13efd6340..320031f515dd 100644 --- a/package/source/zipapi/XUnbufferedStream.hxx +++ b/package/source/zipapi/XUnbufferedStream.hxx @@ -59,7 +59,7 @@ protected: ZipEntry maEntry; rtl::Reference < EncryptionData > mxData; rtlCipher maCipher; - Inflater maInflater; + ZipUtils::Inflater maInflater; sal_Bool mbRawStream, mbWrappedRaw, mbFinished; sal_Int16 mnHeaderToRead; sal_Int64 mnZipCurrent, mnZipEnd, mnZipSize, mnMyCurrent; diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 080005b66128..4c6115f21768 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -62,6 +62,7 @@ using namespace com::sun::star::packages::zip; using namespace com::sun::star::packages::zip::ZipConstants; using rtl::OUString; +using ZipUtils::Inflater; /** This class is used to read entries from a zip file */ -- cgit v1.2.3