ZeusBase-Library  2.0.4
zeus::IInputStream Class Referenceabstract

#include <IInputStream.hpp>

Inheritance diagram for zeus::IInputStream:
zeus::IZUnknown zeus::TAbstractInputStream zeus::TBluetoothSocket zeus::TSerialConnection zeus::TSocket zeus::TByteArrayInputStream zeus::TFileInputStream zeus::TFilterInputStream zeus::TBase64InputStream zeus::TCryptedInputStream zeus::TTextInputStream zeus::TZippedInputStream

Public Member Functions

virtual bool MQUALIFIER available () const =0
 
virtual bool MQUALIFIER isEndReached () const =0
 
virtual Retval MQUALIFIER read (char *pBuffer, Int iBufferSize, Int &rValidSize) const =0
 
virtual Int MQUALIFIER readItem () const =0
 
virtual Int8 MQUALIFIER readInt8 (bool *pError) const =0
 
virtual Int16 MQUALIFIER readInt16 (bool *pError) const =0
 
virtual Int32 MQUALIFIER readInt32 (bool *pError) const =0
 
virtual Int64 MQUALIFIER readInt64 (bool *pError) const =0
 
virtual Uint8 MQUALIFIER readUint8 (bool *pError) const =0
 
virtual Uint16 MQUALIFIER readUint16 (bool *pError) const =0
 
virtual Uint32 MQUALIFIER readUint32 (bool *pError) const =0
 
virtual Uint64 MQUALIFIER readUint64 (bool *pError) const =0
 
virtual Float32 MQUALIFIER readFloat32 (bool *pError) const =0
 
virtual Float64 MQUALIFIER readFloat64 (bool *pError) const =0
 
virtual bool MQUALIFIER readBool (bool *pError) const =0
 
virtual Retval MQUALIFIER readArray (IByteArray &rData) const =0
 
virtual Retval MQUALIFIER readString (IString &rData) const =0
 
virtual void MQUALIFIER close ()=0
 
virtual void MQUALIFIER reset ()=0
 
virtual bool MQUALIFIER skip (Int iBytes=1)=0
 
- Public Member Functions inherited from zeus::IZUnknown
virtual Retval MQUALIFIER askForInterface (const InterfaceID &rInterfaceID, IZUnknown *&rpIface)=0
 
virtual void MQUALIFIER addRef () const =0
 
virtual void MQUALIFIER release () const =0
 

Detailed Description

Interface is defining a input stream

Member Function Documentation

§ available()

virtual bool MQUALIFIER zeus::IInputStream::available ( ) const
pure virtual

Returns if the input stream is available (valid).

Return values
true: stream is ok
false: invalid stream

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TByteArrayInputStream, zeus::TBluetoothSocket, zeus::TSocket, and zeus::TFilterInputStream.

§ close()

virtual void MQUALIFIER zeus::IInputStream::close ( )
pure virtual

§ isEndReached()

virtual bool MQUALIFIER zeus::IInputStream::isEndReached ( ) const
pure virtual

This method checks if the stream is at the end. If a stream is at the end the methods readDouble(), readLong(), readByte() and readBool() should not called anymore. They will return zero. You must call this method before getting data from the stream.

Return values
true: Stream is at the end
false: Stream is not at the end

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TBluetoothSocket, zeus::TSocket, zeus::TByteArrayInputStream, zeus::TZippedInputStream, zeus::TFileInputStream, and zeus::TFilterInputStream.

§ read()

virtual Retval MQUALIFIER zeus::IInputStream::read ( char *  pBuffer,
Int  iBufferSize,
Int &  rValidSize 
) const
pure virtual

Reads from a stream into a buffer

Parameters
pBuffer: Char Array
iBufferSize: Size of the Array
rValidSize: Length of the read buffer (return parameter)
Return values
RET_NOERROR: Reading was successful
RET_REQUEST_FAILED: Could not read from Socket

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, zeus::TSocket, zeus::TByteArrayInputStream, zeus::TBase64InputStream, zeus::TZippedInputStream, zeus::TFileInputStream, zeus::TFilterInputStream, and zeus::TCryptedInputStream.

§ readArray()

virtual Retval MQUALIFIER zeus::IInputStream::readArray ( IByteArray rData) const
pure virtual

Reads an array of bytes from a stream. This method uses special notation of the buffer and can only be used if the stream has written using writeArray() method. First 4 Bytes read gives the size of the following byte array to read. [4][3][2][1] = size, [0][1]..[size].

Parameters
rData: Return parameter
Return values
RET_NOERROR: Bytes readed

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readBool()

virtual bool MQUALIFIER zeus::IInputStream::readBool ( bool *  pError) const
pure virtual

Reads a bool value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
bool value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readFloat32()

virtual Float32 MQUALIFIER zeus::IInputStream::readFloat32 ( bool *  pError) const
pure virtual

Reads a Float32 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
float value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readFloat64()

virtual Float64 MQUALIFIER zeus::IInputStream::readFloat64 ( bool *  pError) const
pure virtual

Reads a Float64 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
float value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readInt16()

virtual Int16 MQUALIFIER zeus::IInputStream::readInt16 ( bool *  pError) const
pure virtual

Reads an int16 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
int16 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readInt32()

virtual Int32 MQUALIFIER zeus::IInputStream::readInt32 ( bool *  pError) const
pure virtual

Reads an int32 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
int32 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readInt64()

virtual Int64 MQUALIFIER zeus::IInputStream::readInt64 ( bool *  pError) const
pure virtual

Reads an int64 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
int64 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readInt8()

virtual Int8 MQUALIFIER zeus::IInputStream::readInt8 ( bool *  pError) const
pure virtual

Reads an int8 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
int8 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readItem()

virtual Int MQUALIFIER zeus::IInputStream::readItem ( ) const
pure virtual

Reads a single item from a stream. The size of item is 8bit large.

Returns
item value. If the stream has an error INVALID_DATA is returned.

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, zeus::TSocket, zeus::TByteArrayInputStream, zeus::TBase64InputStream, zeus::TZippedInputStream, zeus::TFileInputStream, zeus::TFilterInputStream, and zeus::TCryptedInputStream.

§ readString()

virtual Retval MQUALIFIER zeus::IInputStream::readString ( IString rData) const
pure virtual

Reads a string (16bit based) from the stream. This method uses spaecial notation of the buffer and can only be used if the stream has been written using writeString() method. First 4 bytes represent the size of the string. [4][3][2][1] = size, [0_h][0_l][1_h][1_l]..[size_h][size_l]. Note that this method is able to handle unicode.

Parameters
rData: Return parameter
Return values
RET_NOERROR: String readed

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readUint16()

virtual Uint16 MQUALIFIER zeus::IInputStream::readUint16 ( bool *  pError) const
pure virtual

Reads an unsigned int16 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
unsigned int16 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readUint32()

virtual Uint32 MQUALIFIER zeus::IInputStream::readUint32 ( bool *  pError) const
pure virtual

Reads an unsigned int32 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
unsigned int32 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readUint64()

virtual Uint64 MQUALIFIER zeus::IInputStream::readUint64 ( bool *  pError) const
pure virtual

Reads an unsigned int64 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
unsigned int64 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TTextInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ readUint8()

virtual Uint8 MQUALIFIER zeus::IInputStream::readUint8 ( bool *  pError) const
pure virtual

Reads an unsigned int8 value from a stream

Parameters
pError: Error return flag. If *pError = true an error has been occured reading from the stream
Returns
unsigned int8 value

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TBluetoothSocket, and zeus::TSocket.

§ reset()

virtual void MQUALIFIER zeus::IInputStream::reset ( )
pure virtual

§ skip()

virtual bool MQUALIFIER zeus::IInputStream::skip ( Int  iBytes = 1)
pure virtual

This method is used to skip a number of bytes

Parameters
iBytes: Number of bytes to skip (default = 1)
Return values
true: Byte skipped
falseError or end of stream reached

Implemented in zeus::TSerialConnection, zeus::TAbstractInputStream, zeus::TBluetoothSocket, zeus::TSocket, zeus::TByteArrayInputStream, zeus::TFileInputStream, and zeus::TFilterInputStream.


The documentation for this class was generated from the following file:


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Tue Sep 13 2016 22:31:33