diff options
author | Martin Gallwey <mtg@openoffice.org> | 2001-07-04 13:56:37 +0000 |
---|---|---|
committer | Martin Gallwey <mtg@openoffice.org> | 2001-07-04 13:56:37 +0000 |
commit | 1157563ae83b41998a4982c06299780aba7830d4 (patch) | |
tree | 91fa8c017f3e78f7291dc4628d5e49c434ee0b77 /package/inc | |
parent | f424dd7645c4aed5ecad0e9437f552fa934c6ba2 (diff) |
#86708# changes for pack'n'go feature (incomplete)
Diffstat (limited to 'package/inc')
-rw-r--r-- | package/inc/ByteChucker.hxx | 17 | ||||
-rw-r--r-- | package/inc/CRC32.hxx | 6 | ||||
-rw-r--r-- | package/inc/HashMaps.hxx | 15 | ||||
-rw-r--r-- | package/inc/ImplValidCharacters.hxx | 93 | ||||
-rw-r--r-- | package/inc/Inflater.hxx | 9 | ||||
-rw-r--r-- | package/inc/PackageConstants.hxx | 6 | ||||
-rw-r--r-- | package/inc/ZipEnumeration.hxx | 6 | ||||
-rw-r--r-- | package/inc/ZipFile.hxx | 51 | ||||
-rw-r--r-- | package/inc/ZipOutputStream.hxx | 34 | ||||
-rw-r--r-- | package/inc/ZipPackage.hxx | 34 | ||||
-rw-r--r-- | package/inc/ZipPackageBuffer.hxx | 5 | ||||
-rw-r--r-- | package/inc/ZipPackageFolder.hxx | 6 |
12 files changed, 210 insertions, 72 deletions
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx index 2ba8a6c569f2..4b9cbf0b2ae0 100644 --- a/package/inc/ByteChucker.hxx +++ b/package/inc/ByteChucker.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ByteChucker.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mtg $ $Date: 2001-05-31 09:36:05 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,20 +68,25 @@ #include <com/sun/star/io/XSeekable.hpp> #endif +class ThreadedBuffer; + class ByteChucker { + friend class ThreadedBuffer; protected: com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream; com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; - com::sun::star::uno::Sequence < sal_Int8 > a1Sequence, a2Sequence, a4Sequence; - sal_Int8 *p1Sequence, *p2Sequence, *p4Sequence; + com::sun::star::uno::Sequence < sal_Int8 > aBuffer, a1Sequence, a2Sequence, a4Sequence; + sal_Bool bSpannable, bNextWriteIsAtomic; + sal_Int8 * const p1Sequence, * const p2Sequence, * const p4Sequence, * pBuffer; + sal_Int32 nBufferSize, nCurrentBufferPos; public: ByteChucker (com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOstream); ~ByteChucker(); // XOutputStream - 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, sal_Int32 nLength = -1, const sal_Int8 * const pData = NULL) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); 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); @@ -101,6 +106,8 @@ public: ByteChucker& operator << (sal_uInt8 nuInt8); ByteChucker& operator << (sal_uInt16 nuInt16); ByteChucker& operator << (sal_uInt32 nuInt32); + void setSpannable ( sal_Bool bNewSpannable ); + inline sal_Bool isSpannable () { return bSpannable; } }; #endif diff --git a/package/inc/CRC32.hxx b/package/inc/CRC32.hxx index 9a765d1c4090..4587175ae9a0 100644 --- a/package/inc/CRC32.hxx +++ b/package/inc/CRC32.hxx @@ -2,9 +2,9 @@ * * $RCSfile: CRC32.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: mtg $ $Date: 2001-05-31 09:37:33 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,7 +73,7 @@ class CRC32 { -private: +protected: sal_uInt32 nCRC; public: CRC32(); diff --git a/package/inc/HashMaps.hxx b/package/inc/HashMaps.hxx index e58f3607c52c..125a2dbecea9 100644 --- a/package/inc/HashMaps.hxx +++ b/package/inc/HashMaps.hxx @@ -2,9 +2,9 @@ * * $RCSfile: HashMaps.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mtg $ $Date: 2001-04-19 14:11:06 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,20 +78,13 @@ struct eqFunc } }; -struct hashFunc -{ - sal_Int32 operator()(const rtl::OUString &r1) const - { - return r1.hashCode(); - } -}; typedef std::hash_map < rtl::OUString, com::sun::star::uno::Reference < com::sun::star::lang::XUnoTunnel >, - hashFunc, + ::rtl::OUStringHash, eqFunc > TunnelHash; typedef std::hash_map < rtl::OUString, com::sun::star::uno::Reference < com::sun::star::container::XNameContainer >, - hashFunc, + ::rtl::OUStringHash, eqFunc > NameHash; #endif diff --git a/package/inc/ImplValidCharacters.hxx b/package/inc/ImplValidCharacters.hxx new file mode 100644 index 000000000000..7520de7fc34c --- /dev/null +++ b/package/inc/ImplValidCharacters.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: ImplValidCharacters.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): Martin Gallwey (gallwey@sun.com) + * + * + ************************************************************************/ +#ifndef _IMPL_VALID_CHARACTERS_HXX_ +#define _IMPL_VALID_CHARACTERS_HXX_ + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif + +static sal_Bool Impl_IsValidChar ( sal_Unicode aChar, sal_Bool bSlashAllowed ) +{ + sal_Bool bReturn = sal_True; + + switch ( aChar ) + { + case '\\': + case '?': + case '<': + case '>': + case '\"': + case '|': + case ':': + bReturn = sal_False; + break; + case '/': + bReturn = bSlashAllowed; + break; + default: + if ( aChar < 32 || aChar > 127 ) + bReturn = sal_False; + break; + } + return bReturn; +} +#endif diff --git a/package/inc/Inflater.hxx b/package/inc/Inflater.hxx index 92d24dad83c5..341a77ae4345 100644 --- a/package/inc/Inflater.hxx +++ b/package/inc/Inflater.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Inflater.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,10 +75,7 @@ extern "C" class Inflater { protected: - sal_Bool bFinish; - sal_Bool bFinished; - sal_Bool bSetParams; - sal_Bool bNeedDict; + sal_Bool bFinish, bFinished, bSetParams, bNeedDict; sal_Int32 nOffset, nLength; z_stream* pStream; com::sun::star::uno::Sequence < sal_Int8 > sInBuffer; diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx index 3914bb87ebc5..92cd8653f93b 100644 --- a/package/inc/PackageConstants.hxx +++ b/package/inc/PackageConstants.hxx @@ -2,9 +2,9 @@ * * $RCSfile: PackageConstants.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mtg $ $Date: 2001-05-31 09:35:05 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,5 +66,7 @@ #endif const sal_Int32 n_ConstBufferSize = 32768; +const sal_Int32 n_ConstNonSpannableBufferSize = 128; +const sal_Int32 n_ConstMaxMemoryStreamSize = 20480; #endif diff --git a/package/inc/ZipEnumeration.hxx b/package/inc/ZipEnumeration.hxx index f2333f585fcc..b625535bcb21 100644 --- a/package/inc/ZipEnumeration.hxx +++ b/package/inc/ZipEnumeration.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipEnumeration.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: mtg $ $Date: 2001-04-27 14:56:52 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,7 +72,7 @@ protected: EntryHash::const_iterator aIterator; public: sal_Bool SAL_CALL hasMoreElements(); - const com::sun::star::packages::ZipEntry * SAL_CALL nextElement(); + const com::sun::star::packages::zip::ZipEntry * SAL_CALL nextElement(); ZipEnumeration( EntryHash &rNewEntryHash); ~ZipEnumeration(void); }; diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index b09f683a1910..4b55f476bb57 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipFile.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: mtg $ $Date: 2001-04-27 14:56:05 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,8 +70,8 @@ #ifndef _INFLATER_HXX #include <Inflater.hxx> #endif -#ifndef _COM_SUN_STAR_PACKAGES_ZIPEXCEPTION_HPP_ -#include <com/sun/star/packages/ZipException.hpp> +#ifndef _COM_SUN_STAR_PACKAGES_ZIP_ZIPEXCEPTION_HPP_ +#include <com/sun/star/packages/zip/ZipException.hpp> #endif #ifndef _COM_SUN_STAR_CONTAINER_NOSUCHELEMENTEXCEPTION_HPP_ #include <com/sun/star/container/NoSuchElementException.hpp> @@ -98,21 +98,40 @@ class ZipFile protected: ::rtl::OUString sName; /* zip file name */ ::rtl::OUString sComment; /* zip file comment */ + ::rtl::OUString sURL; EntryHash aEntries; ByteGrabber aGrabber; Inflater aInflater; + sal_Bool bSpanned; com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; + com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; + + com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createMemoryStream( + com::sun::star::packages::zip::ZipEntry & rEntry, + const vos::ORef < EncryptionData > &rData, + sal_Bool bRawStream, + sal_Int32 nUncompressedSize, + sal_Int32 nEnd); + + com::sun::star::uno::Reference < com::sun::star::io::XInputStream > createFileStream( + com::sun::star::packages::zip::ZipEntry & rEntry, + const vos::ORef < EncryptionData > &rData, + sal_Bool bRawStream, + sal_Int32 nUncompressedSize, + sal_Int32 nEnd); public: ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput, sal_Bool bInitialise) - throw(::com::sun::star::io::IOException, com::sun::star::packages::ZipException, com::sun::star::uno::RuntimeException); + throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); + ZipFile( com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xInput, ::rtl::OUString &rURL ) + throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); 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); + sal_uInt32 SAL_CALL getHeader(const ::com::sun::star::packages::zip::ZipEntry& rEntry) + throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); ~ZipFile(); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawStream( - ::com::sun::star::packages::ZipEntry& rEntry, + ::com::sun::star::packages::zip::ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData) - throw(::com::sun::star::io::IOException, ::com::sun::star::packages::ZipException, ::com::sun::star::uno::RuntimeException); + throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); // XElementAccess ::com::sun::star::uno::Type SAL_CALL getElementType( ) @@ -121,9 +140,9 @@ public: throw(::com::sun::star::uno::RuntimeException); // XZipFile ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( - ::com::sun::star::packages::ZipEntry& rEntry, + ::com::sun::star::packages::zip::ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData) - throw(::com::sun::star::io::IOException, ::com::sun::star::packages::ZipException, ::com::sun::star::uno::RuntimeException); + throw(::com::sun::star::io::IOException, ::com::sun::star::packages::zip::ZipException, ::com::sun::star::uno::RuntimeException); ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException); sal_Int32 SAL_CALL getSize( ) @@ -140,13 +159,13 @@ public: throw(::com::sun::star::uno::RuntimeException); ZipEnumeration * SAL_CALL entries( ); -private: - 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); +protected: + sal_Bool readLOC (com::sun::star::packages::zip::ZipEntry &rEntry) + throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::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); + throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); sal_Int32 findEND() - throw(::com::sun::star::io::IOException, com::sun::star::packages::ZipException, com::sun::star::uno::RuntimeException); + throw(::com::sun::star::io::IOException, com::sun::star::packages::zip::ZipException, com::sun::star::uno::RuntimeException); }; #endif diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index 11fcb8a50f21..cc44b50829f7 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipOutputStream.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: mtg $ $Date: 2001-05-31 09:38:31 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,19 +76,22 @@ #ifndef _RTL_CIPHER_H_ #include <rtl/cipher.h> #endif -#ifndef _COM_SUN_STAR_PACKAGES_ZIPENTRY_HPP_ -#include <com/sun/star/packages/ZipEntry.hpp> +#ifndef _COM_SUN_STAR_PACKAGES_ZIP_ZIPENTRY_HPP_ +#include <com/sun/star/packages/zip/ZipEntry.hpp> #endif #ifndef _VOS_REF_H_ #include <vos/ref.hxx> #endif class EncryptionData; +class ThreadedBuffer; + class ZipOutputStream { + friend class ThreadedBuffer; protected: com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > xStream; - ::std::vector < ::com::sun::star::packages::ZipEntry *> aZipList; + ::std::vector < ::com::sun::star::packages::zip::ZipEntry *> aZipList; com::sun::star::uno::Sequence < sal_Int8 > aBuffer; com::sun::star::uno::Sequence < sal_Int8 > aEncryptionBuffer; ::rtl::OUString sComment; @@ -96,15 +99,15 @@ protected: rtlCipher aCipher; CRC32 aCRC; ByteChucker aChucker; - com::sun::star::packages::ZipEntry *pCurrentEntry; - sal_Int16 nMethod; - sal_Int16 nLevel; - sal_Bool bFinished; - sal_Bool bEncryptCurrentEntry; + com::sun::star::packages::zip::ZipEntry *pCurrentEntry; + sal_Int16 nMethod, nLevel; + sal_Bool bFinished, bEncryptCurrentEntry, bSpanning; + sal_Int16 nCurrentDiskNumber; public: - ZipOutputStream( com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > &xOStream, sal_Int32 nNewBufferSize); + ZipOutputStream( com::sun::star::uno::Reference < com::sun::star::io::XOutputStream > &xOStream, sal_Bool bNewSpanning ); ~ZipOutputStream(void); + void setDiskNumber ( sal_Int16 nNewDiskNumber ) { nCurrentDiskNumber = nNewDiskNumber; } // rawWrite to support a direct write to the output stream void SAL_CALL rawWrite( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) @@ -119,7 +122,7 @@ public: throw(::com::sun::star::uno::RuntimeException); void SAL_CALL setLevel( sal_Int32 nNewLevel ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL putNextEntry( ::com::sun::star::packages::ZipEntry& rEntry, + void SAL_CALL putNextEntry( ::com::sun::star::packages::zip::ZipEntry& rEntry, const vos::ORef < EncryptionData > &rData, sal_Bool bEncrypt = sal_False ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); @@ -136,13 +139,12 @@ protected: void doDeflate(); void writeEND(sal_uInt32 nOffset, sal_uInt32 nLength) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void writeCEN( const com::sun::star::packages::ZipEntry &rEntry ) + void writeCEN( const com::sun::star::packages::zip::ZipEntry &rEntry ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void writeEXT( const com::sun::star::packages::ZipEntry &rEntry ) + void writeEXT( const com::sun::star::packages::zip::ZipEntry &rEntry ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - void writeLOC( const com::sun::star::packages::ZipEntry &rEntry ) + sal_Int32 writeLOC( const com::sun::star::packages::zip::ZipEntry &rEntry ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - }; #endif diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 1f9f718d4f9a..e44b89f45428 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackage.hxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: mtg $ $Date: 2001-05-31 09:39:40 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,6 +88,9 @@ #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif +#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_ +#include <com/sun/star/task/XInteractionHandler.hpp> +#endif #ifndef _ZIP_PACKAGE_BUFFER_HXX #include <ZipPackageBuffer.hxx> #endif @@ -97,15 +100,23 @@ #ifndef _HASHMAPS_HXX #include <HashMaps.hxx> #endif - +#ifndef _OSL_FILE_HXX_ +#include <osl/file.hxx> +#endif #include <vector> class ZipPackageFolder; class ZipFile; class OutputThread; +enum SegmentEnum +{ + e_Aborted = -1000, + e_Retry, + e_Success = 0 +}; class ZipPackage : - public ::cppu::OWeakObject, + public cppu::OWeakObject, public com::sun::star::lang::XInitialization, public com::sun::star::lang::XSingleServiceFactory, public com::sun::star::lang::XUnoTunnel, @@ -119,11 +130,12 @@ protected: NameHash aRecent; ::rtl::OUString sURL; sal_Int32 nSegmentSize; - sal_Bool bHasEncryptedEntries; + sal_Bool bHasEncryptedEntries, bSpanned; ::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; + ::com::sun::star::uno::Reference < com::sun::star::task::XInteractionHandler > xInteractionHandler; const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xFactory; ZipPackageFolder *pRootFolder; @@ -131,6 +143,17 @@ protected: ::ucb::Content *pContent; void getZipFileContents(); + SegmentEnum writeSegment( + const ::rtl::OUString & rFileName, + ::rtl::OUString & rMountPath, + ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &xStream, + ::com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, + sal_Bool bRetry, + const sal_Int16 nDiskNum); + void getInteractionHandler(); + sal_Bool HandleError ( com::sun::star::uno::Any &rAny, sal_uInt16 eContinuations ); + sal_Bool HandleError ( oslFileError, sal_uInt16 eContinuations, ::rtl::OUString &rFileName ); + sal_Int32 RequestDisk ( ::rtl::OUString &rMountPath, sal_Int16 nDiskNum); public: ZipPackage (const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory); @@ -186,6 +209,7 @@ public: 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 a6b57f9b004c..71f3b6608b9e 100644 --- a/package/inc/ZipPackageBuffer.hxx +++ b/package/inc/ZipPackageBuffer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackageBuffer.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: hr $ $Date: 2001-06-11 09:32:41 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,6 +93,7 @@ protected: sal_Bool m_bMustInitBuffer; public: ZipPackageBuffer(sal_Int64 nNewBufferSize); + ZipPackageBuffer( com::sun::star::uno::Sequence < sal_Int8 > &nNewBuffer ); virtual ~ZipPackageBuffer(void); virtual com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type& rType ) throw(com::sun::star::uno::RuntimeException); diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx index e62ef7446191..45936f3568ce 100644 --- a/package/inc/ZipPackageFolder.hxx +++ b/package/inc/ZipPackageFolder.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackageFolder.hxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: mtg $ $Date: 2001-05-08 13:51:29 $ + * last change: $Author: mtg $ $Date: 2001-07-04 14:56:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,7 +98,7 @@ public: ZipPackageFolder (); virtual ~ZipPackageFolder(); - static void copyZipEntry( com::sun::star::packages::ZipEntry &rDest, const com::sun::star::packages::ZipEntry &rSource); + static void copyZipEntry( com::sun::star::packages::zip::ZipEntry &rDest, const com::sun::star::packages::zip::ZipEntry &rSource); // Recursive functions void saveContents(rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, com::sun::star::uno::Sequence < sal_Int8 > &rEncryptionKey) throw(::com::sun::star::uno::RuntimeException); |