1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_STD_INPUTSTREAM_HXX
11 #define INCLUDED_UCB_SOURCE_UCP_CMIS_STD_INPUTSTREAM_HXX
13 #include <boost/shared_ptr.hpp>
16 #include <osl/mutex.hxx>
17 #include <cppuhelper/weak.hxx>
18 #include <com/sun/star/io/XInputStream.hpp>
19 #include <com/sun/star/io/XSeekable.hpp>
23 /** Implements a seekable InputStream
24 * working on an std::istream
27 : public cppu::OWeakObject
,
28 public css::io::XInputStream
,
29 public css::io::XSeekable
33 StdInputStream( boost::shared_ptr
< std::istream
> const & pStream
);
35 virtual ~StdInputStream() override
;
37 virtual css::uno::Any SAL_CALL
queryInterface ( const css::uno::Type
& rType
) override
;
39 virtual void SAL_CALL
acquire( ) throw ( ) override
;
41 virtual void SAL_CALL
release( ) throw ( ) override
;
43 virtual sal_Int32 SAL_CALL
44 readBytes ( css::uno::Sequence
< sal_Int8
>& aData
,
45 sal_Int32 nBytesToRead
) override
;
47 virtual sal_Int32 SAL_CALL
48 readSomeBytes ( css::uno::Sequence
< sal_Int8
>& aData
,
49 sal_Int32 nMaxBytesToRead
) override
;
52 skipBytes ( sal_Int32 nBytesToSkip
) override
;
54 virtual sal_Int32 SAL_CALL
55 available ( ) override
;
58 closeInput ( ) override
;
65 seek ( sal_Int64 location
) override
;
68 virtual sal_Int64 SAL_CALL
69 getPosition ( ) override
;
72 virtual sal_Int64 SAL_CALL
73 getLength ( ) override
;
78 boost::shared_ptr
< std::istream
> m_pStream
;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */