summaryrefslogtreecommitdiff
path: root/package/inc
diff options
context:
space:
mode:
authorMartin Gallwey <mtg@openoffice.org>2001-04-27 13:56:07 +0000
committerMartin Gallwey <mtg@openoffice.org>2001-04-27 13:56:07 +0000
commitfa2de5099c00fabb952c039269f23f7f3689c586 (patch)
tree0476064e5fcd36451648736e4dcb6fccafd1f062 /package/inc
parent7ddd39239c37d8a9b58f4c8fc17ff2b47fe0a20b (diff)
#86409# Support encryption in package files + a couple of optimisations
Diffstat (limited to 'package/inc')
-rw-r--r--package/inc/ByteChucker.hxx20
-rw-r--r--package/inc/ByteGrabber.hxx22
-rw-r--r--package/inc/CRC32.hxx26
-rw-r--r--package/inc/Deflater.hxx50
-rw-r--r--package/inc/Inflater.hxx52
-rw-r--r--package/inc/ZipFile.hxx65
-rw-r--r--package/inc/ZipOutputStream.hxx65
-rw-r--r--package/inc/ZipPackage.hxx33
-rw-r--r--package/inc/ZipPackageBuffer.hxx6
-rw-r--r--package/inc/ZipPackageFolder.hxx21
10 files changed, 198 insertions, 162 deletions
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx
index 8e1a0699fba5..895317d5b0e4 100644
--- a/package/inc/ByteChucker.hxx
+++ b/package/inc/ByteChucker.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ByteChucker.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,27 +70,27 @@
class ByteChucker
{
-private:
+protected:
com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream;
com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek;
public:
ByteChucker (com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOstream);
- virtual ~ByteChucker();
+ ~ByteChucker();
// XOutputStream
- virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData )
+ void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL flush( )
+ void SAL_CALL flush( )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeOutput( )
+ void SAL_CALL closeOutput( )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
// XSeekable
- virtual sal_Int64 SAL_CALL seek( sal_Int64 location )
+ sal_Int64 SAL_CALL seek( sal_Int64 location )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getPosition( )
+ sal_Int64 SAL_CALL getPosition( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLength( )
+ sal_Int64 SAL_CALL getLength( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
ByteChucker& operator << (sal_Int8 nInt8);
diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx
index 3496cb7210a6..1c2f15ca5664 100644
--- a/package/inc/ByteGrabber.hxx
+++ b/package/inc/ByteGrabber.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ByteGrabber.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,7 +70,7 @@
class ByteGrabber
{
-private:
+protected:
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek;
public:
@@ -79,22 +79,22 @@ public:
void setInputStream (com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewStream);
// XInputStream
- virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
+ sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
+ sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
+ void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL available( )
+ sal_Int32 SAL_CALL available( )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( )
+ void SAL_CALL closeInput( )
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
// XSeekable
- virtual sal_Int64 SAL_CALL seek( sal_Int64 location )
+ sal_Int64 SAL_CALL seek( sal_Int64 location )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getPosition( )
+ sal_Int64 SAL_CALL getPosition( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int64 SAL_CALL getLength( )
+ sal_Int64 SAL_CALL getLength( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
ByteGrabber& operator >> (sal_Int8& rInt8);
diff --git a/package/inc/CRC32.hxx b/package/inc/CRC32.hxx
index 8ca85ffe6189..f92a16a3cc45 100644
--- a/package/inc/CRC32.hxx
+++ b/package/inc/CRC32.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: CRC32.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,29 +61,29 @@
#ifndef _CRC32_HXX
#define _CRC32_HXX
-#ifndef _CPPUHELPER_IMPLBASE1_HXX_
-#include <cppuhelper/implbase1.hxx>
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
+#include <com/sun/star/uno/Sequence.h>
#endif
-#ifndef _COM_SUN_STAR_PACKAGE_XCHECKSUM_HPP_
-#include <com/sun/star/packages/XChecksum.hpp>
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HDL_
+#include <com/sun/star/uno/RuntimeException.hdl>
#endif
-class CRC32 : public cppu::WeakImplHelper1<com::sun::star::packages::XChecksum>
+class CRC32
{
private:
sal_uInt32 nCRC;
public:
CRC32();
- virtual ~CRC32();
- virtual void SAL_CALL updateByte (sal_Int8 nByte)
+ ~CRC32();
+ void SAL_CALL updateByte (sal_Int8 nByte)
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateSegment(const ::com::sun::star::uno::Sequence< sal_Int8 > &b, sal_Int32 off, sal_Int32 len)
+ void SAL_CALL updateSegment(const ::com::sun::star::uno::Sequence< sal_Int8 > &b, sal_Int32 off, sal_Int32 len)
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL update(const ::com::sun::star::uno::Sequence< sal_Int8 > &b)
+ void SAL_CALL update(const ::com::sun::star::uno::Sequence< sal_Int8 > &b)
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getValue()
+ sal_Int32 SAL_CALL getValue()
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL reset()
+ void SAL_CALL reset()
throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/package/inc/Deflater.hxx b/package/inc/Deflater.hxx
index 5a0259056e31..7d787478ca53 100644
--- a/package/inc/Deflater.hxx
+++ b/package/inc/Deflater.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Deflater.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,21 +61,21 @@
#ifndef _DEFLATER_HXX_
#define _DEFLATER_HXX_
-#ifndef _COM_SUN_STAR_PACKAGE_XDEFLATER_HDL_
-#include <com/sun/star/packages/XDeflater.hpp>
+
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
#endif
-#ifndef _CPPUHELPER_IMPLBASE1_HXX_
-#include <cppuhelper/implbase1.hxx>
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HDL_
+#include <com/sun/star/uno/RuntimeException.hdl>
#endif
-
extern "C"
{
typedef struct z_stream_s z_stream;;
};
-class Deflater : public cppu::WeakImplHelper1 < com::sun::star::packages::XDeflater>
+class Deflater
{
-private:
+protected:
com::sun::star::uno::Sequence< sal_Int8 > sInBuffer;
sal_Bool bFinish;
sal_Bool bFinished;
@@ -92,37 +92,37 @@ public:
~Deflater();
Deflater(sal_Int32 nSetLevel);
Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap);
- virtual void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
+ void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDictionarySegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ void SAL_CALL setDictionarySegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDictionary( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
+ void SAL_CALL setDictionary( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setStrategy( sal_Int32 nNewStrategy )
+ void SAL_CALL setStrategy( sal_Int32 nNewStrategy )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLevel( sal_Int32 nNewLevel )
+ void SAL_CALL setLevel( sal_Int32 nNewLevel )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL needsInput( )
+ sal_Bool SAL_CALL needsInput( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL finish( )
+ void SAL_CALL finish( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL finished( )
+ sal_Bool SAL_CALL finished( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL doDeflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ sal_Int32 SAL_CALL doDeflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL doDeflate( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
+ sal_Int32 SAL_CALL doDeflate( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getAdler( )
+ sal_Int32 SAL_CALL getAdler( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTotalIn( )
+ sal_Int32 SAL_CALL getTotalIn( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTotalOut( )
+ sal_Int32 SAL_CALL getTotalOut( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL reset( )
+ void SAL_CALL reset( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL end( )
+ void SAL_CALL end( )
throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/package/inc/Inflater.hxx b/package/inc/Inflater.hxx
index b9b21eeb71e5..92d24dad83c5 100644
--- a/package/inc/Inflater.hxx
+++ b/package/inc/Inflater.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Inflater.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,20 +61,20 @@
#ifndef _INFLATER_HXX_
#define _INFLATER_HXX_
-#ifndef _COM_SUN_STAR_PACKAGE_XINFLATER_HDL_
-#include <com/sun/star/packages/XInflater.hpp>
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
#endif
-#ifndef _CPPUHELPER_IMPLBASE1_HXX_
-#include <cppuhelper/implbase1.hxx>
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HDL_
+#include <com/sun/star/uno/RuntimeException.hdl>
#endif
extern "C"
{
typedef struct z_stream_s z_stream;
}
-class Inflater : public cppu::WeakImplHelper1 < com::sun::star::packages::XInflater>
+class Inflater
{
-private:
+protected:
sal_Bool bFinish;
sal_Bool bFinished;
sal_Bool bSetParams;
@@ -82,44 +82,42 @@ private:
sal_Int32 nOffset, nLength;
z_stream* pStream;
com::sun::star::uno::Sequence < sal_Int8 > sInBuffer;
- void init (sal_Bool bNowrap);
sal_Int32 doInflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength);
public:
- Inflater(sal_Bool bNoWrap);
- Inflater();
+ Inflater(sal_Bool bNoWrap = sal_False);
~Inflater();
- virtual void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
+ void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDictionarySegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ void SAL_CALL setDictionarySegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDictionary( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
+ void SAL_CALL setDictionary( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRemaining( )
+ sal_Int32 SAL_CALL getRemaining( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL needsInput( )
+ sal_Bool SAL_CALL needsInput( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL needsDictionary( )
+ sal_Bool SAL_CALL needsDictionary( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL finish( )
+ void SAL_CALL finish( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL finished( )
+ sal_Bool SAL_CALL finished( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL doInflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ sal_Int32 SAL_CALL doInflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL doInflate( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
+ sal_Int32 SAL_CALL doInflate( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getAdler( )
+ sal_Int32 SAL_CALL getAdler( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTotalIn( )
+ sal_Int32 SAL_CALL getTotalIn( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getTotalOut( )
+ sal_Int32 SAL_CALL getTotalOut( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL reset( )
+ void SAL_CALL reset( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL end( )
+ void SAL_CALL end( )
throw(::com::sun::star::uno::RuntimeException);
};
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index 2db761a41edb..b09f683a1910 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipFile.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,12 +61,6 @@
#ifndef _ZIP_FILE_HXX
#define _ZIP_FILE_HXX
-#ifndef _COM_SUN_STAR_PACKAGE_XZIPFILE_HPP_
-#include <com/sun/star/packages/XZipFile.hpp>
-#endif
-#ifndef _CPPUHELPER_IMPLBASE1_HXX_
-#include <cppuhelper/implbase1.hxx> // helper for implementations
-#endif
#ifndef _BYTE_GRABBER_HXX_
#include <ByteGrabber.hxx>
#endif
@@ -76,18 +70,32 @@
#ifndef _INFLATER_HXX
#include <Inflater.hxx>
#endif
-
+#ifndef _COM_SUN_STAR_PACKAGES_ZIPEXCEPTION_HPP_
+#include <com/sun/star/packages/ZipException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_NOSUCHELEMENTEXCEPTION_HPP_
+#include <com/sun/star/container/NoSuchElementException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_WRAPPEDTARGETEXCEPTION_HPP_
+#include <com/sun/star/lang/WrappedTargetException.hpp>
+#endif
+#ifndef _VOS_REF_H_
+#include <vos/ref.hxx>
+#endif
/*
* We impose arbitrary but reasonable limit on ZIP files.
*/
+
#define ZIP_MAXNAMELEN 512
#define ZIP_MAXEXTRA 256
#define ZIP_MAXENTRIES (0x10000 - 2)
-class ZipFile : public cppu::WeakImplHelper1<
- com::sun::star::packages::XZipFile>
+class ZipEnumeration;
+class EncryptionData;
+
+class ZipFile
{
-private:
+protected:
::rtl::OUString sName; /* zip file name */
::rtl::OUString sComment; /* zip file comment */
EntryHash aEntries;
@@ -100,39 +108,40 @@ public:
void setInputStream ( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xNewStream );
sal_uInt32 SAL_CALL getHeader(const ::com::sun::star::packages::ZipEntry& rEntry)
throw(::com::sun::star::io::IOException, ::com::sun::star::packages::ZipException, ::com::sun::star::uno::RuntimeException);
- virtual ~ZipFile();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawStream( const ::com::sun::star::packages::ZipEntry& rEntry )
+ ~ZipFile();
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawStream(
+ ::com::sun::star::packages::ZipEntry& rEntry,
+ const vos::ORef < EncryptionData > &rData)
throw(::com::sun::star::io::IOException, ::com::sun::star::packages::ZipException, ::com::sun::star::uno::RuntimeException);
// XElementAccess
- virtual ::com::sun::star::uno::Type SAL_CALL getElementType( )
+ ::com::sun::star::uno::Type SAL_CALL getElementType( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasElements( )
+ sal_Bool SAL_CALL hasElements( )
throw(::com::sun::star::uno::RuntimeException);
// XZipFile
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( const ::com::sun::star::packages::ZipEntry& rEntry )
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream(
+ ::com::sun::star::packages::ZipEntry& rEntry,
+ const vos::ORef < EncryptionData > &rData)
throw(::com::sun::star::io::IOException, ::com::sun::star::packages::ZipException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getName( )
+ ::rtl::OUString SAL_CALL getName( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getSize( )
+ sal_Int32 SAL_CALL getSize( )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL close( )
+ void SAL_CALL close( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
// XNameAccess
- virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( )
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
throw(::com::sun::star::uno::RuntimeException);
- // XEnumerationAccess (except called with entries instead of
- // createEnumeration
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL entries( )
- throw(::com::sun::star::uno::RuntimeException);
+ ZipEnumeration * SAL_CALL entries( );
private:
- sal_Bool readLOC(const com::sun::star::packages::ZipEntry &rEntry)
+ sal_Bool readLOC (com::sun::star::packages::ZipEntry &rEntry)
throw(::com::sun::star::io::IOException, com::sun::star::packages::ZipException, com::sun::star::uno::RuntimeException);
sal_Int32 readCEN()
throw(::com::sun::star::io::IOException, com::sun::star::packages::ZipException, com::sun::star::uno::RuntimeException);
diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx
index f95299d791c7..75029ebdcd0e 100644
--- a/package/inc/ZipOutputStream.hxx
+++ b/package/inc/ZipOutputStream.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipOutputStream.hxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,64 +70,71 @@
#ifndef _CRC32_HXX
#include <CRC32.hxx>
#endif
-#ifndef _COM_SUN_STAR_PACKAGE_XZIPOUTPUTSTREAM_HPP_
-#include <com/sun/star/packages/XZipOutputStream.hpp>
-#endif
-#ifndef _CPPUHELPER_IMPLBASE1_HXX_
-#include <cppuhelper/implbase1.hxx> // helper for implementations
-#endif
#ifndef __SGI_STL_VECTOR
#include <vector>
#endif
+#ifndef _RTL_CIPHER_H_
+#include <rtl/cipher.h>
+#endif
+#ifndef _COM_SUN_STAR_PACKAGES_ZIPENTRY_HPP_
+#include <com/sun/star/packages/ZipEntry.hpp>
+#endif
+#ifndef _VOS_REF_H_
+#include <vos/ref.hxx>
+#endif
-
-class ZipOutputStream : public cppu::WeakImplHelper1< com::sun::star::packages::XZipOutputStream >
+class EncryptionData;
+class ZipOutputStream
{
private:
com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream;
- Deflater aDeflater;
+ ::std::vector < ::com::sun::star::packages::ZipEntry *> aZipList;
com::sun::star::uno::Sequence < sal_Int8 > aBuffer;
+ com::sun::star::uno::Sequence < sal_Int8 > aEncryptionBuffer;
::rtl::OUString sComment;
+ Deflater aDeflater;
+ rtlCipher aCipher;
+ CRC32 aCRC;
+ ByteChucker aChucker;
+ com::sun::star::packages::ZipEntry *pCurrentEntry;
sal_Int16 nMethod;
sal_Int16 nLevel;
- com::sun::star::packages::ZipEntry *pCurrentEntry;
- CRC32 aCRC;
sal_Bool bFinished;
- ByteChucker aChucker;
- ::std::vector < ::com::sun::star::packages::ZipEntry *> aZipList;
+ sal_Bool bEncryptCurrentEntry;
public:
ZipOutputStream( com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > &xOStream, sal_Int32 nNewBufferSize);
- virtual ~ZipOutputStream(void);
+ ~ZipOutputStream(void);
+ void SAL_CALL setEncryptionKey ( com::sun::star::uno::Sequence < sal_Int8 > &rKey, com::sun::star::packages::ZipEntry & rEntry );
+ static com::sun::star::uno::Sequence < sal_Int8 > getInitialisationVector();
// rawWrite to support a direct write to the output stream
void SAL_CALL rawWrite( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer)
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
void SAL_CALL rawCloseEntry( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setComment( const ::rtl::OUString& rComment )
+ // XZipOutputStream interfaces
+ void SAL_CALL setComment( const ::rtl::OUString& rComment )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setMethod( sal_Int32 nNewMethod )
+ void SAL_CALL setMethod( sal_Int32 nNewMethod )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLevel( sal_Int32 nNewLevel )
+ void SAL_CALL setLevel( sal_Int32 nNewLevel )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL putNextEntry( const ::com::sun::star::packages::ZipEntry& rEntry )
+ void SAL_CALL putNextEntry( ::com::sun::star::packages::ZipEntry& rEntry,
+ const vos::ORef < EncryptionData > &rData,
+ sal_Bool bEncrypt = sal_False )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeEntry( )
+ void SAL_CALL closeEntry( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL write( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
+ void SAL_CALL write( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL finish( )
+ void SAL_CALL finish( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL close( )
+ void SAL_CALL close( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
static sal_uInt32 getCurrentDosTime ( );
- /*
- static sal_uInt32 tmDateToDosDate ( tm *pTime);
- static void dosDateToTMDate ( tm &rTime, sal_uInt32 nDosDate);
- */
-private:
+protected:
void doDeflate();
void writeEND(sal_uInt32 nOffset, sal_uInt32 nLength)
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index 2bc794d1d0ef..f03bc6913a0d 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipPackage.hxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,8 +85,8 @@
#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
#include <com/sun/star/lang/XUnoTunnel.hpp>
#endif
-#ifndef _COM_SUN_STAR_PACKAGES_XZIPFILE_HPP_
-#include <com/sun/star/packages/XZipFile.hpp>
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
#endif
#ifndef _ZIP_PACKAGE_BUFFER_HXX
#include <ZipPackageBuffer.hxx>
@@ -109,13 +109,14 @@ class ZipPackage :
public com::sun::star::lang::XSingleServiceFactory,
public com::sun::star::lang::XUnoTunnel,
public com::sun::star::container::XHierarchicalNameAccess,
- public com::sun::star::util::XChangesBatch
+ public com::sun::star::util::XChangesBatch,
+ public com::sun::star::beans::XPropertySet
{
-private:
+protected:
ZipPackageFolder *pRootFolder;
ZipFile *pZipFile;
::ucb::Content *pContent;
- ::com::sun::star::uno::Reference < com::sun::star::packages::XZipFile > xZipFile;
+ ::com::sun::star::uno::Sequence < sal_Int8 > aEncryptionKey;
::com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > xRootFolder;
::com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xContentStream;
::com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xContentSeek;
@@ -126,6 +127,9 @@ private:
public:
ZipPackage (const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory);
virtual ~ZipPackage( void );
+ ZipFile& getZipFile() { return *pZipFile;}
+ const com::sun::star::uno::Sequence < sal_Int8 > & getEncryptionKey ( ) {return aEncryptionKey;}
+
// XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
throw(::com::sun::star::uno::RuntimeException);
@@ -160,6 +164,21 @@ public:
throw(::com::sun::star::uno::RuntimeException);
com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void )
throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// Uno componentiseralation
static ::rtl::OUString getImplementationName();
static ::com::sun::star::uno::Sequence < ::rtl::OUString > getSupportedServiceNames();
diff --git a/package/inc/ZipPackageBuffer.hxx b/package/inc/ZipPackageBuffer.hxx
index 40ee3a117282..62e9ef8ecf92 100644
--- a/package/inc/ZipPackageBuffer.hxx
+++ b/package/inc/ZipPackageBuffer.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipPackageBuffer.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -84,7 +84,7 @@ class ZipPackageBuffer :
public com::sun::star::io::XSeekable,
public cppu::OWeakObject
{
-private:
+protected:
sal_Int64 nBufferSize;
sal_Int64 nEnd;
sal_Int64 nCurrent;
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 1a86c14a7053..7f62abec70a7 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipPackageFolder.hxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: mtg $ $Date: 2001-04-19 14:28:02 $
+ * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,21 +91,18 @@ class ZipPackageFolder : public ZipPackageEntry,
public ::com::sun::star::container::XNameContainer,
public ::com::sun::star::container::XEnumerationAccess
{
-private:
+protected:
TunnelHash aContents;
public:
- ZipPackage *pPackage;
- com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > xPackage;
- ZipPackageFolder ( void );
- virtual ~ZipPackageFolder( void );
+ ZipPackageFolder ();
+ virtual ~ZipPackageFolder();
static void copyZipEntry( com::sun::star::packages::ZipEntry &rDest, const com::sun::star::packages::ZipEntry &rSource);
// Recursive functions
void saveContents(rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut)
throw(::com::sun::star::uno::RuntimeException);
- void updateReferences( ZipFile * pNewZipFile);
- void releaseUpwardRef( void );
+ void releaseUpwardRef();
// XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType )
@@ -143,6 +140,12 @@ public:
virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
// XUnoTunnel
static ::com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void )
throw(::com::sun::star::uno::RuntimeException);