View | Details | Raw Unified | Return to issue 86348
Collapse All | Expand All

(-)inc/ByteChucker.hxx (-8 lines)
Lines 75-91 Link Here
75
	// XOutputStream
75
	// XOutputStream
76
    void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nLength = -1, const sal_Int8 * const pData = NULL) 
76
    void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nLength = -1, const sal_Int8 * const pData = NULL) 
77
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
77
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
78
    void SAL_CALL flush(  ) 
79
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
80
    void SAL_CALL closeOutput(  ) 
81
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
82
	// XSeekable
78
	// XSeekable
83
    sal_Int64 SAL_CALL seek( sal_Int64 location ) 
84
		throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
85
    sal_Int64 SAL_CALL getPosition(  ) 
79
    sal_Int64 SAL_CALL getPosition(  ) 
86
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
80
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
87
    sal_Int64 SAL_CALL getLength(  )
88
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
89
81
90
	ByteChucker& operator << (sal_Int8 nInt8);
82
	ByteChucker& operator << (sal_Int8 nInt8);
91
	ByteChucker& operator << (sal_Int16 nInt16);
83
	ByteChucker& operator << (sal_Int16 nInt16);
(-)inc/ByteGrabber.hxx (-8 lines)
Lines 76-89 Link Here
76
	// XInputStream
76
	// XInputStream
77
    sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) 
77
    sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) 
78
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
78
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
79
    sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) 
80
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
81
    void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) 
82
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
83
    sal_Int32 SAL_CALL available(  ) 
84
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
85
    void SAL_CALL closeInput(  ) 
86
		throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
87
	// XSeekable
79
	// XSeekable
88
    sal_Int64 SAL_CALL seek( sal_Int64 location ) 
80
    sal_Int64 SAL_CALL seek( sal_Int64 location ) 
89
		throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
81
		throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
(-)inc/CRC32.hxx (-2 lines)
Lines 55-62 Link Here
55
55
56
	sal_Int32 SAL_CALL updateStream (::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > & xStream)
56
	sal_Int32 SAL_CALL updateStream (::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > & xStream)
57
		throw(::com::sun::star::uno::RuntimeException);
57
		throw(::com::sun::star::uno::RuntimeException);
58
	void SAL_CALL updateByte (sal_Int8 nByte)
59
		throw(::com::sun::star::uno::RuntimeException);
60
	void SAL_CALL updateSegment(const ::com::sun::star::uno::Sequence< sal_Int8 > &b, sal_Int32 off, sal_Int32 len)
58
	void SAL_CALL updateSegment(const ::com::sun::star::uno::Sequence< sal_Int8 > &b, sal_Int32 off, sal_Int32 len)
61
		throw(::com::sun::star::uno::RuntimeException);
59
		throw(::com::sun::star::uno::RuntimeException);
62
	void SAL_CALL update(const ::com::sun::star::uno::Sequence< sal_Int8 > &b)
60
	void SAL_CALL update(const ::com::sun::star::uno::Sequence< sal_Int8 > &b)
(-)inc/Deflater.hxx (-8 lines)
Lines 59-80 Link Here
59
	sal_Int32 doDeflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength);
59
	sal_Int32 doDeflateBytes (com::sun::star::uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength);
60
		
60
		
61
public:
61
public:
62
	Deflater();
63
	~Deflater();
62
	~Deflater();
64
	Deflater(sal_Int32 nSetLevel);
65
	Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap);
63
	Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap);
66
    void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
64
    void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
67
    void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
68
    void SAL_CALL setDictionarySegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
69
    void SAL_CALL setDictionary( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
70
    void SAL_CALL setStrategy( sal_Int32 nNewStrategy );
71
    void SAL_CALL setLevel( sal_Int32 nNewLevel );
65
    void SAL_CALL setLevel( sal_Int32 nNewLevel );
72
    sal_Bool SAL_CALL needsInput(  );
66
    sal_Bool SAL_CALL needsInput(  );
73
    void SAL_CALL finish(  );
67
    void SAL_CALL finish(  );
74
    sal_Bool SAL_CALL finished(  );
68
    sal_Bool SAL_CALL finished(  );
75
    sal_Int32 SAL_CALL doDeflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
69
    sal_Int32 SAL_CALL doDeflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
76
    sal_Int32 SAL_CALL doDeflate( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
77
    sal_Int32 SAL_CALL getAdler(  );
78
    sal_Int32 SAL_CALL getTotalIn(  );
70
    sal_Int32 SAL_CALL getTotalIn(  );
79
    sal_Int32 SAL_CALL getTotalOut(  );
71
    sal_Int32 SAL_CALL getTotalOut(  );
80
    void SAL_CALL reset(  );
72
    void SAL_CALL reset(  );
(-)inc/Inflater.hxx (-11 lines)
Lines 55-75 Link Here
55
public:
55
public:
56
	Inflater(sal_Bool bNoWrap = sal_False);
56
	Inflater(sal_Bool bNoWrap = sal_False);
57
	~Inflater();
57
	~Inflater();
58
    void SAL_CALL setInputSegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
59
    void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
58
    void SAL_CALL setInput( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
60
    void SAL_CALL setDictionarySegment( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
61
    void SAL_CALL setDictionary( const ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
62
    sal_Int32 SAL_CALL getRemaining(  );
63
    sal_Bool SAL_CALL needsInput(  );
64
    sal_Bool SAL_CALL needsDictionary(  );
59
    sal_Bool SAL_CALL needsDictionary(  );
65
    void SAL_CALL finish(  );
66
    sal_Bool SAL_CALL finished(  );
60
    sal_Bool SAL_CALL finished(  );
67
    sal_Int32 SAL_CALL doInflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
61
    sal_Int32 SAL_CALL doInflateSegment( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength );
68
    sal_Int32 SAL_CALL doInflate( ::com::sun::star::uno::Sequence< sal_Int8 >& rBuffer );
69
    sal_Int32 SAL_CALL getAdler(  );
70
    sal_Int32 SAL_CALL getTotalIn(  );
71
    sal_Int32 SAL_CALL getTotalOut(  );
72
    void SAL_CALL reset(  );
73
    void SAL_CALL end(  );
62
    void SAL_CALL end(  );
74
};
63
};
75
64
(-)inc/ZipFile.hxx (-5 lines)
Lines 197-207 Link Here
197
				::com::sun::star::packages::zip::ZipException,
197
				::com::sun::star::packages::zip::ZipException,
198
				::com::sun::star::uno::RuntimeException );
198
				::com::sun::star::uno::RuntimeException );
199
199
200
    ::rtl::OUString SAL_CALL getName(  ) 
201
		throw(::com::sun::star::uno::RuntimeException);
202
    sal_Int32 SAL_CALL getSize(  ) 
203
		throw(::com::sun::star::uno::RuntimeException);
204
205
    ZipEnumeration * SAL_CALL entries(  );
200
    ZipEnumeration * SAL_CALL entries(  );
206
protected:
201
protected:
207
	sal_Bool		readLOC ( ZipEntry &rEntry)
202
	sal_Bool		readLOC ( ZipEntry &rEntry)
(-)inc/ZipOutputStream.hxx (-4 lines)
Lines 87-94 Link Here
87
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
87
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
88
88
89
	// XZipOutputStream interfaces
89
	// XZipOutputStream interfaces
90
    void SAL_CALL setComment( const ::rtl::OUString& rComment )
91
		throw(::com::sun::star::uno::RuntimeException);
92
    void SAL_CALL setMethod( sal_Int32 nNewMethod )
90
    void SAL_CALL setMethod( sal_Int32 nNewMethod )
93
		throw(::com::sun::star::uno::RuntimeException);
91
		throw(::com::sun::star::uno::RuntimeException);
94
    void SAL_CALL setLevel( sal_Int32 nNewLevel )
92
    void SAL_CALL setLevel( sal_Int32 nNewLevel )
Lines 103-110 Link Here
103
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
101
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
104
    void SAL_CALL finish(  )
102
    void SAL_CALL finish(  )
105
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
103
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
106
    void SAL_CALL close(  )
107
		throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
108
    static sal_uInt32 getCurrentDosTime ( );
104
    static sal_uInt32 getCurrentDosTime ( );
109
protected:
105
protected:
110
	void doDeflate();
106
	void doDeflate();
(-)inc/ZipPackageBuffer.hxx (-1 lines)
Lines 63-69 Link Here
63
	sal_Bool m_bMustInitBuffer;
63
	sal_Bool m_bMustInitBuffer;
64
public:
64
public:
65
	ZipPackageBuffer(sal_Int64 nNewBufferSize);
65
	ZipPackageBuffer(sal_Int64 nNewBufferSize);
66
	ZipPackageBuffer( com::sun::star::uno::Sequence < sal_Int8 > &nNewBuffer );
67
	virtual ~ZipPackageBuffer(void);
66
	virtual ~ZipPackageBuffer(void);
68
67
69
	inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); }
68
	inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); }
(-)source/xstor/ocompinstream.cxx (-23 lines)
Lines 52-80 Link Here
52
using namespace ::com::sun::star;
52
using namespace ::com::sun::star;
53
53
54
//-----------------------------------------------
54
//-----------------------------------------------
55
OInputCompStream::OInputCompStream( sal_Int16 nStorageType )
56
: m_pImpl( NULL )
57
, m_rMutexRef( new SotMutexHolder )
58
, m_pInterfaceContainer( NULL )
59
, m_bDisposed( sal_False )
60
, m_nStorageType( nStorageType )
61
{
62
}
63
64
//-----------------------------------------------
65
OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, sal_Int16 nStorageType )
66
: m_pImpl( &aImpl )
67
, m_rMutexRef( m_pImpl->m_rMutexRef )
68
, m_pInterfaceContainer( NULL )
69
, m_bDisposed( sal_False )
70
, m_nStorageType( nStorageType )
71
{
72
	OSL_ENSURE( m_pImpl->m_rMutexRef.Is(), "No mutex is provided!\n" );
73
	if ( !m_pImpl->m_rMutexRef.Is() )
74
		throw uno::RuntimeException(); // just a disaster
75
}
76
77
//-----------------------------------------------
78
OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
55
OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
79
									uno::Reference < io::XInputStream > xStream,
56
									uno::Reference < io::XInputStream > xStream,
80
									const uno::Sequence< beans::PropertyValue >& aProps,
57
									const uno::Sequence< beans::PropertyValue >& aProps,
(-)source/xstor/ocompinstream.hxx (-3 lines)
Lines 96-104 Link Here
96
96
97
	sal_Int16 m_nStorageType;
97
	sal_Int16 m_nStorageType;
98
98
99
	OInputCompStream( sal_Int16 nStorageType );
100
	OInputCompStream( OWriteStream_Impl& pImpl, sal_Int16 nStorageType );
101
102
public:
99
public:
103
	OInputCompStream( OWriteStream_Impl& pImpl,
100
	OInputCompStream( OWriteStream_Impl& pImpl,
104
					  ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream,
101
					  ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream,
(-)source/xstor/oseekinstream.cxx (-39 lines)
Lines 54-79 Link Here
54
using namespace ::com::sun::star;
54
using namespace ::com::sun::star;
55
55
56
OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
56
OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
57
									uno::Reference < io::XStream > xStream,
58
									const uno::Sequence< beans::PropertyValue >& aProps,
59
									sal_Int16 nStorageType )
60
: OInputCompStream( pImpl, nStorageType )
61
{
62
	OSL_ENSURE( xStream.is(), "No stream is provided!\n" );
63
64
	if ( xStream.is() )
65
	{
66
		m_xStream = xStream->getInputStream();
67
		m_xSeekable = uno::Reference< io::XSeekable >( xStream, uno::UNO_QUERY );
68
69
		OSL_ENSURE( m_xStream.is(), "No input stream is provided!\n" );
70
		OSL_ENSURE( m_xSeekable.is(), "No seeking support!\n" );
71
	}
72
73
	m_aProperties = aProps;
74
}
75
76
OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl,
77
									uno::Reference < io::XInputStream > xStream,
57
									uno::Reference < io::XInputStream > xStream,
78
									const uno::Sequence< beans::PropertyValue >& aProps,
58
									const uno::Sequence< beans::PropertyValue >& aProps,
79
									sal_Int16 nStorageType )
59
									sal_Int16 nStorageType )
Lines 86-110 Link Here
86
	}
66
	}
87
}
67
}
88
68
89
OInputSeekStream::OInputSeekStream( uno::Reference < io::XStream > xStream,
90
									const uno::Sequence< beans::PropertyValue >& aProps,
91
									sal_Int16 nStorageType )
92
: OInputCompStream( nStorageType )
93
{
94
	OSL_ENSURE( xStream.is(), "No stream is provided!\n" );
95
96
	if ( xStream.is() )
97
	{
98
		m_xStream = xStream->getInputStream();
99
		m_xSeekable = uno::Reference< io::XSeekable >( xStream, uno::UNO_QUERY );
100
101
		OSL_ENSURE( m_xStream.is(), "No input stream is provided!\n" );
102
		OSL_ENSURE( m_xSeekable.is(), "No seeking support!\n" );
103
	}
104
105
	m_aProperties = aProps;
106
}
107
108
OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > xStream,
69
OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > xStream,
109
									const uno::Sequence< beans::PropertyValue >& aProps,
70
									const uno::Sequence< beans::PropertyValue >& aProps,
110
									sal_Int16 nStorageType )
71
									sal_Int16 nStorageType )
(-)source/xstor/oseekinstream.hxx (-9 lines)
Lines 54-72 Link Here
54
					  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
54
					  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
55
					  sal_Int16 nStorageType );
55
					  sal_Int16 nStorageType );
56
56
57
	OInputSeekStream( OWriteStream_Impl& pImpl,
58
					  ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > xStream,
59
					  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
60
					  sal_Int16 nStorageType );
61
62
	OInputSeekStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream,
57
	OInputSeekStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream,
63
					  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
58
					  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
64
					  sal_Int16 nStorageType );
59
					  sal_Int16 nStorageType );
65
60
66
	OInputSeekStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream > xStream,
67
					  const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps,
68
					  sal_Int16 nStorageType );
69
70
	virtual ~OInputSeekStream();
61
	virtual ~OInputSeekStream();
71
62
72
    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
63
    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
(-)source/zipapi/Adler32.cxx (-98 lines)
Lines 1-99 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
1
36
// MARKER(update_precomp.py): autogen include statement, do not remove
37
#include "precompiled_package.hxx"
38
#ifndef _ADLER32_HXX
39
#include <Adler32.hxx>
40
#endif
41
#ifndef _ZLIB_H
42
#ifdef SYSTEM_ZLIB
43
#include <zlib.h>
44
#else
45
#include <external/zlib/zlib.h>
46
#endif
47
#endif
48
49
/**
50
 * A class that can be used to compute the Adler-32 checksum of a data
51
 * stream. An Adler-32 checksum is almost as reliable as a CRC-32 but
52
 * can be computed much faster.
53
 *
54
 */
55
56
using namespace rtl;
57
using namespace com::sun::star;
58
59
Adler32::Adler32() : nAdler(1) 
60
{ 
61
}
62
63
Adler32::~Adler32()
64
{
65
}
66
/** Updates checksum with specified byte
67
 */
68
void SAL_CALL Adler32::updateByte (sal_Int8 nByte)
69
{
70
	sal_uInt8 pBuf[1];
71
	pBuf[0] = (sal_uInt8)nByte;
72
	nAdler  = adler32(nAdler, pBuf, 1);
73
}
74
/** Updates checksum with specified sequence of bytes
75
 */
76
void SAL_CALL Adler32::updateSegment(const uno::Sequence< sal_Int8 > &b, 
77
									 sal_Int32 off, 
78
									 sal_Int32 len)
79
{
80
	nAdler = adler32(nAdler, (const unsigned char*)b.getConstArray()+off, len );
81
}
82
/** Updates checksum with specified sequence of bytes
83
 */
84
void SAL_CALL Adler32::update(const uno::Sequence< sal_Int8 > &b)
85
{
86
	nAdler = adler32(nAdler, (const unsigned char*)b.getConstArray(),b.getLength());
87
}
88
/** Returns checksum value.
89
 */
90
sal_Int32 SAL_CALL Adler32::getValue()
91
{
92
	return (sal_Int32) nAdler & 0xFFFFFFFFL;
93
}
94
/** Resets checksum to initial value.
95
 */
96
void SAL_CALL Adler32::reset()
97
{
98
	nAdler = 1;
99
}
(-)source/zipapi/Adler32.hxx (-55 lines)
Lines 1-56 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile$
6
 *
7
 *  $Revision$
8
 *
9
 *  last change: $Author$ $Date$
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
#ifndef _ADLER32_HXX
36
#define _ADLER32_HXX
37
1
38
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
39
#include <com/sun/star/uno/Sequence.h>
40
#endif
41
42
class Adler32
43
{
44
private:
45
	sal_uInt32 nAdler;
46
public:
47
	Adler32();
48
	~Adler32();
49
	void SAL_CALL updateByte (sal_Int8 nByte);
50
	void SAL_CALL updateSegment(const ::com::sun::star::uno::Sequence< sal_Int8 > &b, sal_Int32 off, sal_Int32 len);
51
	void SAL_CALL update(const ::com::sun::star::uno::Sequence< sal_Int8 > &b);
52
	sal_Int32 SAL_CALL getValue();
53
	void SAL_CALL reset();
54
};
55
56
#endif
(-)source/zipapi/ByteChucker.cxx (-26 lines)
Lines 74-112 Link Here
74
{
74
{
75
	xStream->writeBytes(aData);
75
	xStream->writeBytes(aData);
76
}
76
}
77
void SAL_CALL ByteChucker::flush(  ) 
78
	throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException)
79
{
80
	xStream->flush();
81
}
82
void SAL_CALL ByteChucker::closeOutput(  ) 
83
	throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException)
84
{
85
	xStream->closeOutput();
86
}
87
77
88
// XSeekable chained...
78
// XSeekable chained...
89
sal_Int64 SAL_CALL ByteChucker::seek( sal_Int64 location ) 
90
	throw(IllegalArgumentException, IOException, RuntimeException)
91
{
92
	sal_Int64 nLen = xSeek->getLength();
93
	if ( location < 0 || location > nLen )
94
		throw IllegalArgumentException();
95
	if (location > nLen )
96
		location = nLen;
97
	xSeek->seek( location );
98
	return location;
99
}
100
sal_Int64 SAL_CALL ByteChucker::getPosition(  ) 
79
sal_Int64 SAL_CALL ByteChucker::getPosition(  ) 
101
		throw(IOException, RuntimeException)
80
		throw(IOException, RuntimeException)
102
{
81
{
103
	return xSeek->getPosition();
82
	return xSeek->getPosition();
104
}
83
}
105
sal_Int64 SAL_CALL ByteChucker::getLength(  )
106
		throw(IOException, RuntimeException)
107
{
108
	return xSeek->getLength();
109
}
110
84
111
ByteChucker& ByteChucker::operator << (sal_Int8 nInt8)
85
ByteChucker& ByteChucker::operator << (sal_Int8 nInt8)
112
{
86
{
(-)source/zipapi/ByteGrabber.cxx (-21 lines)
Lines 75-101 Link Here
75
{
75
{
76
	return xStream->readBytes(aData, nBytesToRead );
76
	return xStream->readBytes(aData, nBytesToRead );
77
}
77
}
78
sal_Int32 SAL_CALL ByteGrabber::readSomeBytes( uno::Sequence< sal_Int8 >& aData, 
79
												sal_Int32 nMaxBytesToRead ) 
80
	throw(io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
81
{
82
	return xStream->readSomeBytes( aData, nMaxBytesToRead );	
83
}
84
void SAL_CALL ByteGrabber::skipBytes( sal_Int32 nBytesToSkip ) 
85
	throw(io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
86
{
87
	xStream->skipBytes( nBytesToSkip );
88
}
89
sal_Int32 SAL_CALL ByteGrabber::available(  ) 
90
	throw(io::NotConnectedException, io::IOException, uno::RuntimeException)
91
{
92
	return xStream->available();
93
}
94
void SAL_CALL ByteGrabber::closeInput(  ) 
95
	throw(io::NotConnectedException, io::IOException, uno::RuntimeException)
96
{
97
	xStream->closeInput();
98
}
99
78
100
// XSeekable chained...
79
// XSeekable chained...
101
sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) 
80
sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location ) 
(-)source/zipapi/CRC32.cxx (-9 lines)
Lines 76-90 Link Here
76
{
76
{
77
	return nCRC & 0xFFFFFFFFL;
77
	return nCRC & 0xFFFFFFFFL;
78
}
78
}
79
/** Update CRC32 with specified byte
80
 */
81
void SAL_CALL CRC32::updateByte (sal_Int8 nByte)
82
		throw(RuntimeException)
83
{
84
	sal_uInt8 pBuf[1];
85
	pBuf[0] = (sal_uInt8)nByte;
86
	nCRC  = crc32(nCRC, pBuf, 1);
87
}
88
/** Update CRC32 with specified sequence of bytes
79
/** Update CRC32 with specified sequence of bytes
89
 */
80
 */
90
void SAL_CALL CRC32::updateSegment(const Sequence< sal_Int8 > &b, 
81
void SAL_CALL CRC32::updateSegment(const Sequence< sal_Int8 > &b, 
(-)source/zipapi/Deflater.cxx (-81 lines)
Lines 83-112 Link Here
83
	}
83
	}
84
}
84
}
85
85
86
Deflater::Deflater()
87
: bFinish(sal_False)
88
, bFinished(sal_False)
89
, bSetParams(sal_False)
90
, nLevel(DEFAULT_COMPRESSION)
91
, nStrategy(DEFAULT_STRATEGY)
92
, nOffset(0)
93
, nLength(0)
94
{
95
	init(DEFAULT_COMPRESSION, DEFAULT_STRATEGY, sal_False);
96
}
97
98
Deflater::Deflater(sal_Int32 nSetLevel)
99
: bFinish(sal_False)
100
, bFinished(sal_False)
101
, bSetParams(sal_False)
102
, nLevel(nSetLevel)
103
, nStrategy(DEFAULT_STRATEGY)
104
, nOffset(0)
105
, nLength(0)
106
{
107
	init(nSetLevel, DEFAULT_STRATEGY, sal_False);
108
}
109
110
Deflater::Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap)
86
Deflater::Deflater(sal_Int32 nSetLevel, sal_Bool bNowrap)
111
: bFinish(sal_False)
87
: bFinish(sal_False)
112
, bFinished(sal_False)
88
, bFinished(sal_False)
Lines 185-238 Link Here
185
    nOffset = nNewOffset;
161
    nOffset = nNewOffset;
186
    nLength = nNewLength;
162
    nLength = nNewLength;
187
}
163
}
188
void SAL_CALL Deflater::setInput( const uno::Sequence< sal_Int8 >& rBuffer ) 
189
{
190
	sInBuffer = rBuffer;
191
	nOffset = 0;
192
	nLength = rBuffer.getLength();
193
}
194
void SAL_CALL Deflater::setDictionarySegment( const uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) 
195
{
196
	if (pStream == NULL)
197
	{
198
		// do error handling
199
	}
200
	if (nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength())
201
	{
202
		// do error handling
203
	}
204
#ifdef SYSTEM_ZLIB
205
	deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray()+nOffset, nLength);
206
#else
207
	z_deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray()+nOffset, nLength);
208
#endif
209
}
210
void SAL_CALL Deflater::setDictionary( const uno::Sequence< sal_Int8 >& rBuffer ) 
211
{
212
	if (pStream == NULL)
213
	{
214
		// do error handling
215
	}
216
#ifdef SYSTEM_ZLIB
217
	deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), rBuffer.getLength());
218
#else
219
	z_deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), rBuffer.getLength());
220
#endif
221
}
222
void SAL_CALL Deflater::setStrategy( sal_Int32 nNewStrategy ) 
223
{
224
	if (nNewStrategy != DEFAULT_STRATEGY &&
225
		nNewStrategy != FILTERED &&
226
		nNewStrategy != HUFFMAN_ONLY)
227
	{
228
		// do error handling
229
	}
230
	if (nStrategy != nNewStrategy)
231
	{
232
		nStrategy = nNewStrategy;
233
		bSetParams = sal_True;
234
	}
235
}
236
void SAL_CALL Deflater::setLevel( sal_Int32 nNewLevel ) 
164
void SAL_CALL Deflater::setLevel( sal_Int32 nNewLevel ) 
237
{
165
{
238
	if ((nNewLevel < 0 || nNewLevel > 9) && nNewLevel != DEFAULT_COMPRESSION)
166
	if ((nNewLevel < 0 || nNewLevel > 9) && nNewLevel != DEFAULT_COMPRESSION)
Lines 262-276 Link Here
262
    OSL_ASSERT( !(nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength()));
190
    OSL_ASSERT( !(nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength()));
263
    return doDeflateBytes(rBuffer, nNewOffset, nNewLength);
191
    return doDeflateBytes(rBuffer, nNewOffset, nNewLength);
264
}
192
}
265
sal_Int32 SAL_CALL Deflater::doDeflate( uno::Sequence< sal_Int8 >& rBuffer ) 
266
{
267
	return doDeflateBytes(rBuffer, 0, rBuffer.getLength());
268
}
269
270
sal_Int32 SAL_CALL Deflater::getAdler(  ) 
271
{
272
	return pStream->adler;
273
}
274
sal_Int32 SAL_CALL Deflater::getTotalIn(  ) 
193
sal_Int32 SAL_CALL Deflater::getTotalIn(  ) 
275
{
194
{
276
	return pStream->total_in;
195
	return pStream->total_in;
(-)source/zipapi/Inflater.cxx (-85 lines)
Lines 84-95 Link Here
84
{
84
{
85
	end();
85
	end();
86
}
86
}
87
void SAL_CALL Inflater::setInputSegment( const Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) 
88
{
89
	sInBuffer = rBuffer;
90
	nOffset = nNewOffset;
91
	nLength = nNewLength;
92
}
93
87
94
void SAL_CALL Inflater::setInput( const Sequence< sal_Int8 >& rBuffer ) 
88
void SAL_CALL Inflater::setInput( const Sequence< sal_Int8 >& rBuffer ) 
95
{
89
{
Lines 98-156 Link Here
98
	nLength = rBuffer.getLength();
92
	nLength = rBuffer.getLength();
99
}
93
}
100
94
101
void SAL_CALL Inflater::setDictionarySegment( const Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength ) 
102
{
103
	if (pStream == NULL)
104
	{
105
		// do error handling
106
	}
107
	if (nNewOffset < 0 || nNewLength < 0 || nNewOffset + nNewLength > rBuffer.getLength())
108
	{
109
		// do error handling
110
	}
111
#ifdef SYSTEM_ZLIB
112
	inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray() + nNewOffset, 
113
				  nNewLength);
114
#else
115
	z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray() + nNewOffset, 
116
				  nNewLength);
117
#endif
118
}
119
120
void SAL_CALL Inflater::setDictionary( const Sequence< sal_Int8 >& rBuffer ) 
121
{
122
	if (pStream == NULL)
123
	{
124
		// do error handling
125
	}
126
#ifdef SYSTEM_ZLIB
127
	inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), 
128
				   rBuffer.getLength());
129
#else
130
	z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), 
131
				   rBuffer.getLength());
132
#endif
133
}
134
135
sal_Int32 SAL_CALL Inflater::getRemaining(  ) 
136
{
137
	return nLength;
138
}
139
140
sal_Bool SAL_CALL Inflater::needsInput(  ) 
141
{
142
	return nLength <=0;
143
}
144
145
sal_Bool SAL_CALL Inflater::needsDictionary(  ) 
95
sal_Bool SAL_CALL Inflater::needsDictionary(  ) 
146
{
96
{
147
	return bNeedDict;
97
	return bNeedDict;
148
}
98
}
149
99
150
void SAL_CALL Inflater::finish(  ) 
151
{
152
	bFinish = sal_True;
153
}
154
sal_Bool SAL_CALL Inflater::finished(  ) 
100
sal_Bool SAL_CALL Inflater::finished(  ) 
155
{
101
{
156
	return bFinished;
102
	return bFinished;
Lines 165-201 Link Here
165
	return doInflateBytes(rBuffer, nNewOffset, nNewLength);
111
	return doInflateBytes(rBuffer, nNewOffset, nNewLength);
166
}
112
}
167
113
168
sal_Int32 SAL_CALL Inflater::doInflate( Sequence< sal_Int8 >& rBuffer ) 
169
{
170
	return doInflateBytes(rBuffer, 0, rBuffer.getLength());
171
}
172
173
sal_Int32 SAL_CALL Inflater::getAdler(  ) 
174
{
175
	return pStream->adler;
176
}
177
178
sal_Int32 SAL_CALL Inflater::getTotalIn(  ) 
179
{
180
	return pStream->total_in;
181
}
182
183
sal_Int32 SAL_CALL Inflater::getTotalOut(  ) 
184
{
185
	return pStream->total_out;
186
}
187
188
void SAL_CALL Inflater::reset(  ) 
189
{
190
#ifdef SYSTEM_ZLIB
191
	inflateReset(pStream);
192
#else
193
	z_inflateReset(pStream);
194
#endif
195
	bFinish = bNeedDict = bFinished = sal_False;
196
	nOffset = nLength = 0;
197
}
198
199
void SAL_CALL Inflater::end(  ) 
114
void SAL_CALL Inflater::end(  ) 
200
{
115
{
201
	if (pStream != NULL)
116
	if (pStream != NULL)
(-)source/zipapi/ZipFile.cxx (-12 lines)
Lines 533-550 Link Here
533
	return new ZipEnumeration ( aEntries );
533
	return new ZipEnumeration ( aEntries );
534
}
534
}
535
535
536
::rtl::OUString SAL_CALL ZipFile::getName(  )
537
	throw(RuntimeException)
538
{
539
	return sName;
540
}
541
542
sal_Int32 SAL_CALL ZipFile::getSize(  )
543
	throw(RuntimeException)
544
{
545
	return aEntries.size();
546
}
547
548
Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
536
Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
549
		const vos::ORef < EncryptionData > &rData,
537
		const vos::ORef < EncryptionData > &rData,
550
		sal_Bool bIsEncrypted )
538
		sal_Bool bIsEncrypted )
(-)source/zipapi/ZipOutputStream.cxx (-10 lines)
Lines 92-102 Link Here
92
		delete aZipList[i];
92
		delete aZipList[i];
93
}
93
}
94
94
95
void SAL_CALL ZipOutputStream::setComment( const ::rtl::OUString& rComment ) 
96
	throw(RuntimeException)
97
{
98
	sComment = rComment;
99
}
100
void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod ) 
95
void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod ) 
101
	throw(RuntimeException)
96
	throw(RuntimeException)
102
{
97
{
Lines 149-159 Link Here
149
	aZipList.push_back( &rEntry );
144
	aZipList.push_back( &rEntry );
150
	pCurrentEntry = &rEntry;
145
	pCurrentEntry = &rEntry;
151
}
146
}
152
void SAL_CALL ZipOutputStream::close(  ) 
153
	throw(IOException, RuntimeException)
154
{
155
	finish();
156
}
157
147
158
void SAL_CALL ZipOutputStream::closeEntry(  ) 
148
void SAL_CALL ZipOutputStream::closeEntry(  ) 
159
	throw(IOException, RuntimeException)
149
	throw(IOException, RuntimeException)
(-)source/zipapi/makefile.mk (-1 lines)
Lines 49-55 Link Here
49
CFLAGS+=-DSYSTEM_ZLIB
49
CFLAGS+=-DSYSTEM_ZLIB
50
.ENDIF
50
.ENDIF
51
SLOFILES= \
51
SLOFILES= \
52
		$(SLO)$/Adler32.obj			\
53
		$(SLO)$/CRC32.obj			\
52
		$(SLO)$/CRC32.obj			\
54
		$(SLO)$/ByteChucker.obj		\
53
		$(SLO)$/ByteChucker.obj		\
55
		$(SLO)$/ByteGrabber.obj		\
54
		$(SLO)$/ByteGrabber.obj		\
(-)source/zippackage/ZipPackageBuffer.cxx (-7 lines)
Lines 52-64 Link Here
52
, m_bMustInitBuffer ( sal_True )
52
, m_bMustInitBuffer ( sal_True )
53
{
53
{
54
}
54
}
55
ZipPackageBuffer::ZipPackageBuffer(Sequence < sal_Int8 > &nNewBuffer )
56
: m_aBuffer ( nNewBuffer )
57
, m_nEnd ( nNewBuffer.getLength() )
58
, m_nCurrent( 0 )
59
, m_bMustInitBuffer ( sal_False )
60
{
61
}
62
ZipPackageBuffer::~ZipPackageBuffer(void) 
55
ZipPackageBuffer::~ZipPackageBuffer(void) 
63
{
56
{
64
}
57
}

Return to issue 86348