update credits
[LibreOffice.git] / include / ucbhelper / fd_inputstream.hxx
blobdf3d6e386b67c53776e2ca6da50ccf7edfe22486
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
29 #include <stdio.h>
31 #include "ucbhelper/ucbhelperdllapi.h"
33 namespace ucbhelper
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
43 public:
45 /** Defines the storage kind found
46 * on which the inputstream acts.
49 FdInputStream(FILE* tmpfl = 0);
51 ~FdInputStream();
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,
65 css::io::IOException,
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,
73 css::io::IOException,
74 css::uno::RuntimeException);
76 virtual void SAL_CALL
77 skipBytes(sal_Int32 nBytesToSkip)
78 throw(css::io::NotConnectedException,
79 css::io::BufferSizeExceededException,
80 css::io::IOException,
81 css::uno::RuntimeException );
83 virtual sal_Int32 SAL_CALL
84 available(void)
85 throw(css::io::NotConnectedException,
86 css::io::IOException,
87 css::uno::RuntimeException );
89 virtual void SAL_CALL
90 closeInput(void)
91 throw(css::io::NotConnectedException,
92 css::io::IOException,
93 css::uno::RuntimeException);
96 /** XSeekable
99 virtual void SAL_CALL
100 seek(sal_Int64 location)
101 throw(css::lang::IllegalArgumentException,
102 css::io::IOException,
103 css::uno::RuntimeException);
106 virtual sal_Int64 SAL_CALL
107 getPosition(void)
108 throw(css::io::IOException,
109 css::uno::RuntimeException);
112 virtual sal_Int64 SAL_CALL
113 getLength(void)
114 throw(css::io::IOException,
115 css::uno::RuntimeException);
117 // additional
118 // void append(const void* pBuffer,size_t size,size_t nmemb);
120 private:
122 osl::Mutex m_aMutex;
123 FILE* m_tmpfl;
124 sal_Int64 m_nLength;
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */