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/.
12 #include <boost/shared_ptr.hpp>
15 #include <osl/mutex.hxx>
16 #include <cppuhelper/weak.hxx>
17 #include <com/sun/star/io/XInputStream.hpp>
18 #include <com/sun/star/io/XSeekable.hpp>
22 /** Implements a seekable InputStream
23 * working on an std::istream
26 : public cppu::OWeakObject
,
27 public css::io::XInputStream
,
28 public css::io::XSeekable
32 StdInputStream( boost::shared_ptr
< std::istream
> const & pStream
);
34 virtual ~StdInputStream() override
;
36 virtual css::uno::Any SAL_CALL
queryInterface ( const css::uno::Type
& rType
) override
;
38 virtual void SAL_CALL
acquire( ) noexcept override
;
40 virtual void SAL_CALL
release( ) noexcept override
;
42 virtual sal_Int32 SAL_CALL
43 readBytes ( css::uno::Sequence
< sal_Int8
>& aData
,
44 sal_Int32 nBytesToRead
) override
;
46 virtual sal_Int32 SAL_CALL
47 readSomeBytes ( css::uno::Sequence
< sal_Int8
>& aData
,
48 sal_Int32 nMaxBytesToRead
) override
;
51 skipBytes ( sal_Int32 nBytesToSkip
) override
;
53 virtual sal_Int32 SAL_CALL
54 available ( ) override
;
57 closeInput ( ) override
;
64 seek ( sal_Int64 location
) override
;
67 virtual sal_Int64 SAL_CALL
68 getPosition ( ) override
;
71 virtual sal_Int64 SAL_CALL
72 getLength ( ) override
;
77 boost::shared_ptr
< std::istream
> m_pStream
;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */