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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UCBHELPER_FD_INPUTSTREAM_HXX
21 #define INCLUDED_UCBHELPER_FD_INPUTSTREAM_HXX
23 #include <rtl/ustring.hxx>
24 #include <osl/mutex.hxx>
26 #include <com/sun/star/io/XInputStream.hpp>
27 #include <com/sun/star/io/XSeekable.hpp>
28 #include <cppuhelper/implbase2.hxx>
29 #include <cppuhelper/basemutex.hxx>
31 #include <ucbhelper/ucbhelperdllapi.h>
35 typedef ::cppu::WeakImplHelper2
<
36 css::io::XInputStream
,
37 css::io::XSeekable
> FdInputStream_Base
;
39 /** Implements a seekable InputStream
40 * working on a buffer.
42 class UCBHELPER_DLLPUBLIC FdInputStream
43 : protected cppu::BaseMutex
,
44 public FdInputStream_Base
48 /** Defines the storage kind found
49 * on which the inputstream acts.
51 FdInputStream(oslFileHandle tmpfl
);
53 virtual ~FdInputStream() override
;
55 virtual sal_Int32 SAL_CALL
56 readBytes(css::uno::Sequence
< sal_Int8
>& aData
,
57 sal_Int32 nBytesToRead
)
58 throw( css::io::NotConnectedException
,
59 css::io::BufferSizeExceededException
,
61 css::uno::RuntimeException
, std::exception
) override
;
63 virtual sal_Int32 SAL_CALL
64 readSomeBytes(css::uno::Sequence
< sal_Int8
>& aData
,
65 sal_Int32 nMaxBytesToRead
)
66 throw( css::io::NotConnectedException
,
67 css::io::BufferSizeExceededException
,
69 css::uno::RuntimeException
, std::exception
) override
;
72 skipBytes(sal_Int32 nBytesToSkip
)
73 throw(css::io::NotConnectedException
,
74 css::io::BufferSizeExceededException
,
76 css::uno::RuntimeException
, std::exception
) override
;
78 virtual sal_Int32 SAL_CALL
80 throw(css::io::NotConnectedException
,
82 css::uno::RuntimeException
, std::exception
) override
;
86 throw(css::io::NotConnectedException
,
88 css::uno::RuntimeException
, std::exception
) override
;
95 seek(sal_Int64 location
)
96 throw(css::lang::IllegalArgumentException
,
98 css::uno::RuntimeException
, std::exception
) override
;
101 virtual sal_Int64 SAL_CALL
103 throw(css::io::IOException
,
104 css::uno::RuntimeException
, std::exception
) override
;
107 virtual sal_Int64 SAL_CALL
109 throw(css::io::IOException
,
110 css::uno::RuntimeException
, std::exception
) override
;
113 oslFileHandle m_tmpfl
;
114 sal_uInt64 m_nLength
;
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */