1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef GIO_INPUTSTREAM_HXX 25 #define GIO_INPUTSTREAM_HXX 26 27 #include <sal/types.h> 28 #include <rtl/ustring.hxx> 29 #include <cppuhelper/weak.hxx> 30 31 #include <com/sun/star/io/XInputStream.hpp> 32 #include <com/sun/star/io/XTruncate.hpp> 33 #include <com/sun/star/io/XSeekable.hpp> 34 35 #include "gio_seekable.hxx" 36 37 namespace gio 38 { 39 40 class InputStream : 41 public ::com::sun::star::io::XInputStream, 42 public Seekable 43 { 44 private: 45 GFileInputStream *mpStream; 46 47 public: 48 InputStream ( GFileInputStream *pStream ); 49 virtual ~InputStream(); 50 51 // XInterface 52 virtual com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & type ); acquire(void)53 virtual void SAL_CALL acquire( void ) throw () { OWeakObject::acquire(); } release(void)54 virtual void SAL_CALL release( void ) throw() { OWeakObject::release(); } 55 56 // XInputStream 57 virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 > & aData, 58 sal_Int32 nBytesToRead ); 59 60 virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 > & aData, 61 sal_Int32 nMaxBytesToRead ); 62 63 virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ); 64 65 virtual sal_Int32 SAL_CALL available( void ); 66 67 virtual void SAL_CALL closeInput( void ); 68 }; 69 70 } // namespace gio 71 #endif 72