2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2014-04-18 22:14:30 +02:00
|
|
|
#ifndef INCLUDED_PACKAGE_INC_ZIPPACKAGEBUFFER_HXX
|
|
|
|
#define INCLUDED_PACKAGE_INC_ZIPPACKAGEBUFFER_HXX
|
2000-11-21 09:18:06 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/io/XOutputStream.hpp>
|
2000-11-21 16:57:07 +00:00
|
|
|
#include <com/sun/star/io/XSeekable.hpp>
|
2000-11-21 09:18:06 +00:00
|
|
|
#include <com/sun/star/io/XInputStream.hpp>
|
2015-08-25 16:10:12 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2000-12-13 16:00:47 +00:00
|
|
|
|
2017-10-31 14:15:25 +02:00
|
|
|
class ZipPackageBuffer final : public ::cppu::WeakImplHelper
|
2001-11-15 18:59:47 +00:00
|
|
|
<
|
2015-10-23 14:59:15 +02:00
|
|
|
css::io::XInputStream,
|
|
|
|
css::io::XOutputStream,
|
|
|
|
css::io::XSeekable
|
2001-11-15 18:59:47 +00:00
|
|
|
>
|
2000-11-21 09:18:06 +00:00
|
|
|
{
|
2015-10-23 14:59:15 +02:00
|
|
|
css::uno::Sequence < sal_Int8 > m_aBuffer;
|
2001-05-31 08:40:58 +00:00
|
|
|
sal_Int64 m_nBufferSize, m_nEnd, m_nCurrent;
|
2014-04-17 13:40:46 +02:00
|
|
|
bool m_bMustInitBuffer;
|
2000-11-21 09:18:06 +00:00
|
|
|
public:
|
2016-09-12 09:31:41 +02:00
|
|
|
ZipPackageBuffer();
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~ZipPackageBuffer() override;
|
2001-09-05 18:37:54 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
void realloc ( sal_Int32 nSize ) { m_aBuffer.realloc ( nSize ); }
|
2016-04-14 10:20:52 +02:00
|
|
|
const css::uno::Sequence < sal_Int8>& getSequence () const { return m_aBuffer; }
|
2001-11-15 18:59:47 +00:00
|
|
|
|
2000-12-13 16:00:47 +00:00
|
|
|
// XInputStream
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Int32 SAL_CALL readBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) override;
|
|
|
|
virtual sal_Int32 SAL_CALL readSomeBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) override;
|
|
|
|
virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) override;
|
|
|
|
virtual sal_Int32 SAL_CALL available( ) override;
|
|
|
|
virtual void SAL_CALL closeInput( ) override;
|
2000-12-13 16:00:47 +00:00
|
|
|
// XOutputStream
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL writeBytes( const css::uno::Sequence< sal_Int8 >& aData ) override;
|
|
|
|
virtual void SAL_CALL flush( ) override;
|
|
|
|
virtual void SAL_CALL closeOutput( ) override;
|
2000-12-13 16:00:47 +00:00
|
|
|
// XSeekable
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL seek( sal_Int64 location ) override;
|
|
|
|
virtual sal_Int64 SAL_CALL getPosition( ) override;
|
|
|
|
virtual sal_Int64 SAL_CALL getLength( ) override;
|
2000-11-21 09:18:06 +00:00
|
|
|
};
|
|
|
|
#endif
|
2010-10-27 12:45:03 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|