xref: /trunk/main/xmlhelp/source/cxxhelp/provider/inputstream.hxx (revision 7b6bd0c47b85937c512bdda3eec60e4ec76b4320)
1*7b6bd0c4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*7b6bd0c4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*7b6bd0c4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*7b6bd0c4SAndrew Rist  * distributed with this work for additional information
6*7b6bd0c4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*7b6bd0c4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*7b6bd0c4SAndrew Rist  * "License"); you may not use this file except in compliance
9*7b6bd0c4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*7b6bd0c4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*7b6bd0c4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*7b6bd0c4SAndrew Rist  * software distributed under the License is distributed on an
15*7b6bd0c4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7b6bd0c4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*7b6bd0c4SAndrew Rist  * specific language governing permissions and limitations
18*7b6bd0c4SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*7b6bd0c4SAndrew Rist  *************************************************************/
21*7b6bd0c4SAndrew Rist 
22*7b6bd0c4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _INPUSTREAM_HXX_
25cdf0e10cSrcweir #define _INPUSTREAM_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <rtl/ustring.hxx>
28cdf0e10cSrcweir #include <osl/file.hxx>
29cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
30cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp>
31cdf0e10cSrcweir #include <com/sun/star/io/XSeekable.hpp>
32cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp>
33cdf0e10cSrcweir #include <com/sun/star/ucb/XContentProvider.hpp>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace chelp {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir     // forward declaration
39cdf0e10cSrcweir 
40cdf0e10cSrcweir     class XInputStream_impl
41cdf0e10cSrcweir         : public cppu::OWeakObject,
42cdf0e10cSrcweir           public com::sun::star::io::XInputStream,
43cdf0e10cSrcweir           public com::sun::star::io::XSeekable
44cdf0e10cSrcweir     {
45cdf0e10cSrcweir     public:
46cdf0e10cSrcweir 
47cdf0e10cSrcweir         XInputStream_impl( const rtl::OUString& aUncPath );
48cdf0e10cSrcweir 
49cdf0e10cSrcweir         virtual ~XInputStream_impl();
50cdf0e10cSrcweir 
51cdf0e10cSrcweir         /**
52cdf0e10cSrcweir          *  Returns an error code as given by filerror.hxx
53cdf0e10cSrcweir          */
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         bool SAL_CALL CtorSuccess();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir         virtual com::sun::star::uno::Any SAL_CALL
58cdf0e10cSrcweir         queryInterface(
59cdf0e10cSrcweir             const com::sun::star::uno::Type& rType )
60cdf0e10cSrcweir             throw( com::sun::star::uno::RuntimeException);
61cdf0e10cSrcweir 
62cdf0e10cSrcweir         virtual void SAL_CALL
63cdf0e10cSrcweir         acquire(
64cdf0e10cSrcweir             void )
65cdf0e10cSrcweir             throw();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir         virtual void SAL_CALL
68cdf0e10cSrcweir         release(
69cdf0e10cSrcweir             void )
70cdf0e10cSrcweir             throw();
71cdf0e10cSrcweir 
72cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL
73cdf0e10cSrcweir         readBytes(
74cdf0e10cSrcweir             com::sun::star::uno::Sequence< sal_Int8 >& aData,
75cdf0e10cSrcweir             sal_Int32 nBytesToRead )
76cdf0e10cSrcweir             throw( com::sun::star::io::NotConnectedException,
77cdf0e10cSrcweir                    com::sun::star::io::BufferSizeExceededException,
78cdf0e10cSrcweir                    com::sun::star::io::IOException,
79cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir 
81cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL
82cdf0e10cSrcweir         readSomeBytes(
83cdf0e10cSrcweir             com::sun::star::uno::Sequence< sal_Int8 >& aData,
84cdf0e10cSrcweir             sal_Int32 nMaxBytesToRead )
85cdf0e10cSrcweir             throw( com::sun::star::io::NotConnectedException,
86cdf0e10cSrcweir                    com::sun::star::io::BufferSizeExceededException,
87cdf0e10cSrcweir                    com::sun::star::io::IOException,
88cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException);
89cdf0e10cSrcweir 
90cdf0e10cSrcweir         virtual void SAL_CALL
91cdf0e10cSrcweir         skipBytes(
92cdf0e10cSrcweir             sal_Int32 nBytesToSkip )
93cdf0e10cSrcweir             throw( com::sun::star::io::NotConnectedException,
94cdf0e10cSrcweir                    com::sun::star::io::BufferSizeExceededException,
95cdf0e10cSrcweir                    com::sun::star::io::IOException,
96cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         virtual sal_Int32 SAL_CALL
99cdf0e10cSrcweir         available(
100cdf0e10cSrcweir             void )
101cdf0e10cSrcweir             throw( com::sun::star::io::NotConnectedException,
102cdf0e10cSrcweir                    com::sun::star::io::IOException,
103cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException );
104cdf0e10cSrcweir 
105cdf0e10cSrcweir         virtual void SAL_CALL
106cdf0e10cSrcweir         closeInput(
107cdf0e10cSrcweir             void )
108cdf0e10cSrcweir             throw( com::sun::star::io::NotConnectedException,
109cdf0e10cSrcweir                    com::sun::star::io::IOException,
110cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         virtual void SAL_CALL
113cdf0e10cSrcweir         seek(
114cdf0e10cSrcweir             sal_Int64 location )
115cdf0e10cSrcweir             throw( com::sun::star::lang::IllegalArgumentException,
116cdf0e10cSrcweir                    com::sun::star::io::IOException,
117cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         virtual sal_Int64 SAL_CALL
120cdf0e10cSrcweir         getPosition(
121cdf0e10cSrcweir             void )
122cdf0e10cSrcweir             throw( com::sun::star::io::IOException,
123cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException );
124cdf0e10cSrcweir 
125cdf0e10cSrcweir         virtual sal_Int64 SAL_CALL
126cdf0e10cSrcweir         getLength(
127cdf0e10cSrcweir             void )
128cdf0e10cSrcweir             throw( com::sun::star::io::IOException,
129cdf0e10cSrcweir                    com::sun::star::uno::RuntimeException );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     private:
132cdf0e10cSrcweir 
133cdf0e10cSrcweir         bool                                               m_bIsOpen;
134cdf0e10cSrcweir         osl::File                                          m_aFile;
135cdf0e10cSrcweir     };
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 
138cdf0e10cSrcweir } // end namespace XInputStream_impl
139cdf0e10cSrcweir 
140cdf0e10cSrcweir #endif
141