update dev300-m58
[ooovba.git] / ucb / source / ucp / ftp / ftpinpstr.hxx
blob1ecf5e8babddc4f018a7518bdd7f5469d90c7dab
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftpinpstr.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 /**************************************************************************
32 TODO
33 **************************************************************************
35 *************************************************************************/
37 #ifndef _FTP_FTPINPSTR_HXX_
38 #define _FTP_FTPINPSTR_HXX_
41 #include <rtl/ustring.hxx>
42 #include <osl/mutex.hxx>
43 #include <cppuhelper/weak.hxx>
44 #include <cppuhelper/queryinterface.hxx>
45 #include <com/sun/star/io/XInputStream.hpp>
46 #include <com/sun/star/io/XSeekable.hpp>
47 #include <stdio.h>
50 namespace ftp {
53 /** Implements a seekable InputStream
54 * working on a buffer.
58 namespace css = com::sun::star;
61 class FTPInputStream
62 : public cppu::OWeakObject,
63 public com::sun::star::io::XInputStream,
64 public com::sun::star::io::XSeekable
66 public:
68 /** Defines the storage kind found
69 * on which the inputstream acts.
72 FTPInputStream(FILE* tmpfl = 0);
74 ~FTPInputStream();
76 virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& rType)
77 throw(css::uno::RuntimeException);
79 virtual void SAL_CALL acquire(void) throw();
81 virtual void SAL_CALL release(void) throw();
83 virtual sal_Int32 SAL_CALL
84 readBytes(css::uno::Sequence< sal_Int8 >& aData,
85 sal_Int32 nBytesToRead)
86 throw( css::io::NotConnectedException,
87 css::io::BufferSizeExceededException,
88 css::io::IOException,
89 css::uno::RuntimeException);
91 virtual sal_Int32 SAL_CALL
92 readSomeBytes(css::uno::Sequence< sal_Int8 >& aData,
93 sal_Int32 nMaxBytesToRead )
94 throw( css::io::NotConnectedException,
95 css::io::BufferSizeExceededException,
96 css::io::IOException,
97 css::uno::RuntimeException);
99 virtual void SAL_CALL
100 skipBytes(sal_Int32 nBytesToSkip)
101 throw(css::io::NotConnectedException,
102 css::io::BufferSizeExceededException,
103 css::io::IOException,
104 css::uno::RuntimeException );
106 virtual sal_Int32 SAL_CALL
107 available(void)
108 throw(css::io::NotConnectedException,
109 css::io::IOException,
110 css::uno::RuntimeException );
112 virtual void SAL_CALL
113 closeInput(void)
114 throw(css::io::NotConnectedException,
115 css::io::IOException,
116 css::uno::RuntimeException);
119 /** XSeekable
122 virtual void SAL_CALL
123 seek(sal_Int64 location)
124 throw(css::lang::IllegalArgumentException,
125 css::io::IOException,
126 css::uno::RuntimeException);
129 virtual sal_Int64 SAL_CALL
130 getPosition(void)
131 throw(css::io::IOException,
132 css::uno::RuntimeException);
135 virtual sal_Int64 SAL_CALL
136 getLength(void)
137 throw(css::io::IOException,
138 css::uno::RuntimeException);
140 // additional
142 // void append(const void* pBuffer,size_t size,size_t nmemb);
144 private:
146 osl::Mutex m_aMutex;
147 FILE* m_tmpfl;
148 sal_Int64 m_nLength;
154 #endif