00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : IInputStream 00006 * Package : Zeus.ZeusBase.System.Interfaces 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef IInputStreamHPP 00033 #define IInputStreamHPP 00034 00035 #include <zeusbase/System/Interfaces/IZUnknown.hpp> 00036 #include <zeusbase/System/Interfaces/IByteArray.hpp> 00037 #include <zeusbase/System/Interfaces/IString.hpp> 00038 00039 // {20A223D8-5EF0-444c-A412-7B35FB93B2B3} 00040 #define INTERFACE_IInputStream TIID(0x20a223d8, 0x5ef0, 0x444c, 0xa4, 0x12, 0x7b, 0x35, 0xfb, 0x93, 0xb2, 0xb3) 00041 00042 BEGIN_NAMESPACE_Zeus 00043 00044 #define INVALID_DATA -1 00045 00046 /**************************************************************************/ 00049 /**************************************************************************/ 00050 class IInputStream : public IZUnknown 00051 { 00052 HIDE_ASSIGNMENT_OPERATOR(IInputStream) 00053 00054 public: 00055 /**********************************************************************/ 00060 /**********************************************************************/ 00061 virtual bool MQUALIFIER available() const=0; 00062 00063 /**********************************************************************/ 00071 /**********************************************************************/ 00072 virtual bool MQUALIFIER isEndReached() const=0; 00073 00074 /**********************************************************************/ 00082 /**********************************************************************/ 00083 virtual Retval MQUALIFIER read(char* pBuffer, Int iBufferSize, Int& rValidSize) const=0; 00084 00085 /**********************************************************************/ 00090 /**********************************************************************/ 00091 virtual Int MQUALIFIER readItem() const=0; 00092 00093 /**********************************************************************/ 00099 /**********************************************************************/ 00100 virtual Int8 MQUALIFIER readInt8(BOOL_ERRORRETVAL(pError)) const=0; 00101 00102 /**********************************************************************/ 00108 /**********************************************************************/ 00109 virtual Int16 MQUALIFIER readInt16(BOOL_ERRORRETVAL(pError)) const=0; 00110 00111 /**********************************************************************/ 00117 /**********************************************************************/ 00118 virtual Int32 MQUALIFIER readInt32(BOOL_ERRORRETVAL(pError)) const=0; 00119 00120 /**********************************************************************/ 00126 /**********************************************************************/ 00127 virtual Int64 MQUALIFIER readInt64(BOOL_ERRORRETVAL(pError)) const=0; 00128 00129 /**********************************************************************/ 00135 /**********************************************************************/ 00136 virtual Uint8 MQUALIFIER readUint8(BOOL_ERRORRETVAL(pError)) const=0; 00137 00138 /**********************************************************************/ 00144 /**********************************************************************/ 00145 virtual Uint16 MQUALIFIER readUint16(BOOL_ERRORRETVAL(pError)) const=0; 00146 00147 /**********************************************************************/ 00153 /**********************************************************************/ 00154 virtual Uint32 MQUALIFIER readUint32(BOOL_ERRORRETVAL(pError)) const=0; 00155 00156 /**********************************************************************/ 00162 /**********************************************************************/ 00163 virtual Uint64 MQUALIFIER readUint64(BOOL_ERRORRETVAL(pError)) const=0; 00164 00165 /**********************************************************************/ 00171 /**********************************************************************/ 00172 virtual Float32 MQUALIFIER readFloat32(BOOL_ERRORRETVAL(pError)) const=0; 00173 00174 /**********************************************************************/ 00180 /**********************************************************************/ 00181 virtual Float64 MQUALIFIER readFloat64(BOOL_ERRORRETVAL(pError)) const=0; 00182 00183 /**********************************************************************/ 00189 /**********************************************************************/ 00190 virtual bool MQUALIFIER readBool(BOOL_ERRORRETVAL(pError)) const=0; 00191 00192 /**********************************************************************/ 00201 /**********************************************************************/ 00202 virtual Retval MQUALIFIER readArray(IByteArray& rData) const=0; 00203 00204 /**********************************************************************/ 00214 /**********************************************************************/ 00215 virtual Retval MQUALIFIER readString(IString& rData) const=0; 00216 00217 /**********************************************************************/ 00220 /**********************************************************************/ 00221 virtual void MQUALIFIER close()=0; 00222 00223 /**********************************************************************/ 00226 /**********************************************************************/ 00227 virtual void MQUALIFIER reset()=0; 00228 00229 /**********************************************************************/ 00235 /**********************************************************************/ 00236 virtual bool MQUALIFIER skip(Int iBytes = 1) = 0; 00237 }; 00238 00239 END_NAMESPACE_Zeus 00240 00241 #endif