3d8f4c3d31
2008/04/01 12:32:11 thb 1.16.98.2: #i85898# Stripping all external header guards 2008/03/31 16:19:05 rt 1.16.98.1: #i87441# Change license header to LPGL v3.
88 lines
4.6 KiB
C++
88 lines
4.6 KiB
C++
/*************************************************************************
|
|
*
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
*
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: ZipPackageBuffer.hxx,v $
|
|
* $Revision: 1.17 $
|
|
*
|
|
* This file is part of OpenOffice.org.
|
|
*
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
* only, as published by the Free Software Foundation.
|
|
*
|
|
* OpenOffice.org 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 version 3 for more details
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
* <http://www.openoffice.org/license.html>
|
|
* for a copy of the LGPLv3 License.
|
|
*
|
|
************************************************************************/
|
|
#ifndef _ZIP_PACKAGE_BUFFER_HXX
|
|
#define _ZIP_PACKAGE_BUFFER_HXX
|
|
|
|
#include <com/sun/star/io/XOutputStream.hpp>
|
|
#include <com/sun/star/io/XSeekable.hpp>
|
|
#include <com/sun/star/io/XInputStream.hpp>
|
|
#ifndef _CPPUHELPER_IMPLBASE3_HXX
|
|
#include <cppuhelper/implbase3.hxx>
|
|
#endif
|
|
|
|
class ZipPackage;
|
|
|
|
class ZipPackageBuffer : public ::cppu::WeakImplHelper3
|
|
<
|
|
com::sun::star::io::XInputStream,
|
|
com::sun::star::io::XOutputStream,
|
|
com::sun::star::io::XSeekable
|
|
>
|
|
{
|
|
protected:
|
|
com::sun::star::uno::Sequence < sal_Int8 > m_aBuffer;
|
|
sal_Int64 m_nBufferSize, m_nEnd, m_nCurrent;
|
|
sal_Bool m_bMustInitBuffer;
|
|
public:
|
|
ZipPackageBuffer(sal_Int64 nNewBufferSize);
|
|
ZipPackageBuffer( com::sun::star::uno::Sequence < sal_Int8 > &nNewBuffer );
|
|
virtual ~ZipPackageBuffer(void);
|
|
|
|
inline void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); }
|
|
inline const sal_Int8 * getConstArray () const { return m_aBuffer.getConstArray(); }
|
|
inline const com::sun::star::uno::Sequence < sal_Int8> & getSequence () const { return m_aBuffer; }
|
|
|
|
// XInputStream
|
|
virtual 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 )
|
|
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 )
|
|
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( )
|
|
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
|
virtual void SAL_CALL closeInput( )
|
|
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
|
// XOutputStream
|
|
virtual 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( )
|
|
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( )
|
|
throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
|
// XSeekable
|
|
virtual void 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( )
|
|
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
|
virtual sal_Int64 SAL_CALL getLength( )
|
|
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
|
};
|
|
#endif
|