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 _UCBHELPER_FD_INPUTSTREAM_HXX_
21 #define _UCBHELPER_FD_INPUTSTREAM_HXX_
23 #include <rtl/ustring.hxx>
24 #include <osl/mutex.hxx>
25 #include <cppuhelper/weak.hxx>
26 #include <cppuhelper/queryinterface.hxx>
27 #include <com/sun/star/io/XInputStream.hpp>
28 #include <com/sun/star/io/XSeekable.hpp>
31 #include "ucbhelper/ucbhelperdllapi.h"
35 /** Implements a seekable InputStream
36 * working on a buffer.
38 class UCBHELPER_DLLPUBLIC FdInputStream
39 : public cppu::OWeakObject
,
40 public com::sun::star::io::XInputStream
,
41 public com::sun::star::io::XSeekable
45 /** Defines the storage kind found
46 * on which the inputstream acts.
49 FdInputStream(FILE* tmpfl
= 0);
53 virtual css::uno::Any SAL_CALL
queryInterface(const css::uno::Type
& rType
)
54 throw(css::uno::RuntimeException
);
56 virtual void SAL_CALL
acquire(void) throw();
58 virtual void SAL_CALL
release(void) throw();
60 virtual sal_Int32 SAL_CALL
61 readBytes(css::uno::Sequence
< sal_Int8
>& aData
,
62 sal_Int32 nBytesToRead
)
63 throw( css::io::NotConnectedException
,
64 css::io::BufferSizeExceededException
,
66 css::uno::RuntimeException
);
68 virtual sal_Int32 SAL_CALL
69 readSomeBytes(css::uno::Sequence
< sal_Int8
>& aData
,
70 sal_Int32 nMaxBytesToRead
)
71 throw( css::io::NotConnectedException
,
72 css::io::BufferSizeExceededException
,
74 css::uno::RuntimeException
);
77 skipBytes(sal_Int32 nBytesToSkip
)
78 throw(css::io::NotConnectedException
,
79 css::io::BufferSizeExceededException
,
81 css::uno::RuntimeException
);
83 virtual sal_Int32 SAL_CALL
85 throw(css::io::NotConnectedException
,
87 css::uno::RuntimeException
);
91 throw(css::io::NotConnectedException
,
93 css::uno::RuntimeException
);
100 seek(sal_Int64 location
)
101 throw(css::lang::IllegalArgumentException
,
102 css::io::IOException
,
103 css::uno::RuntimeException
);
106 virtual sal_Int64 SAL_CALL
108 throw(css::io::IOException
,
109 css::uno::RuntimeException
);
112 virtual sal_Int64 SAL_CALL
114 throw(css::io::IOException
,
115 css::uno::RuntimeException
);
118 // void append(const void* pBuffer,size_t size,size_t nmemb);
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */