GStreamI Class Reference

#include <LgiInterfaces.h>

Inheritance diagram for GStreamI:

GProxyStream GSocketI GStream GTempStream GSocket GBytePipe GFile GMemStream GSocket GStringPipe

List of all members.

Public Member Functions

virtual int Open (const char *Str=0, int Int=0)
virtual bool IsOpen ()
 Returns true is the stream is still open.
virtual int Close ()
virtual int64 GetSize ()
 Gets the size of the stream.
virtual int64 SetSize (int64 Size)
 Sets the size of the stream.
virtual int64 GetPos ()
 Gets the current position of the stream.
virtual int64 SetPos (int64 Pos)
 Sets the current position of the stream.
virtual int Read (void *Buffer, int Size, int Flags=0)=0
 Read bytes out of the stream.
virtual int Write (const void *Buffer, int Size, int Flags=0)=0
 Write bytes to the stream.
virtual GStreamIClone ()
 Creates a dynamically allocated copy of the same type of stream. This new stream is not connected to anything.


Detailed Description

Stream interface class

Defines the API for all the streaming data classes. Allows applications to plug different types of date streams into functions that take a GStream. Typically this means being able to swap files with sockets or data buffers etc.


Member Function Documentation

virtual int GStreamI::Open ( const char *  Str = 0,
int  Int = 0 
) [inline, virtual]

Open a connection

Returns:
> zero on success
Parameters:
Str  A string connection parameter
Int  An integer connection parameter

Reimplemented in GFile, GMemStream, GProxyStream, and GSocket.

virtual int GStreamI::Close (  )  [inline, virtual]

Closes the connection

Returns:
> zero on success

Reimplemented in GFile, GMemStream, GProxyStream, GSocket, and GFile.

Referenced by GdcBmp::WriteImage().

virtual int64 GStreamI::GetSize (  )  [inline, virtual]

Gets the size of the stream.

Returns:
The size or -1 on error (e.g. the information is not available)

Reimplemented in GBytePipe, GFile, GMemStream, GProxyStream, GSocket, and GFile.

Referenced by GMemStream::GMemStream(), GXmlTree::Read(), GdcBmp::ReadImage(), GProcess::Run(), and GTempStream::Write().

virtual int64 GStreamI::SetSize ( int64  Size  )  [inline, virtual]

Sets the size of the stream.

Returns:
The new size or -1 on error (e.g. the size is not set-able)

Reimplemented in GFile, GMemStream, GProxyStream, and GSocket.

Referenced by GXmlTree::Write(), and GdcBmp::WriteImage().

virtual int64 GStreamI::GetPos (  )  [inline, virtual]

Gets the current position of the stream.

Returns:
Current position or -1 on error (e.g. the position is not known)

Reimplemented in GFile, GMemStream, GProxyStream, and GSocket.

Referenced by GdcBmp::ReadImage().

virtual int64 GStreamI::SetPos ( int64  Pos  )  [inline, virtual]

Sets the current position of the stream.

Returns:
The new current position or -1 on error (e.g. the position can't be set)

Reimplemented in GFile, GMemStream, GProxyStream, and GSocket.

Referenced by GMemStream::GMemStream(), and GdcBmp::ReadImage().

virtual int GStreamI::Read ( void *  Buffer,
int  Size,
int  Flags = 0 
) [pure virtual]

Read bytes out of the stream.

Returns:
> 0 on succes, which indicates the number of bytes read

Implemented in GBytePipe, GFile, GStream, GMemStream, GProxyStream, and GSocket.

Referenced by GMemStream::GMemStream(), and GXmlTree::Read().

virtual int GStreamI::Write ( const void *  Buffer,
int  Size,
int  Flags = 0 
) [pure virtual]

Write bytes to the stream.

Returns:
> 0 on succes, which indicates the number of bytes written

Implemented in GBytePipe, GFile, GStream, GMemStream, GProxyStream, GTempStream, and GSocket.

Referenced by GXmlTree::EncodeEntities(), GStreamPrint(), GBytePipe::Peek(), and GXmlTree::Write().

virtual GStreamI* GStreamI::Clone (  )  [inline, virtual]

Creates a dynamically allocated copy of the same type of stream. This new stream is not connected to anything.

Returns:
The new stream or NULL on error.

Reimplemented in GMemStream, and GProxyStream.


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

Generated on Wed May 11 07:51:58 2011 for Lgi by  doxygen 1.5.6