Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

GMemStream Class Reference

In memory stream for storing sub-streams or memory blocks. More...

#include <GStream.h>

Inheritance diagram for GMemStream:

GStream GDom List of all members.

Public Member Functions

 GMemStream ()
 Builds an empty memory stream.
 GMemStream (GStream *Src, int64 Start, int64 Len)
 Builds memory from sub-stream.
 GMemStream (void *Mem, int64 Len)
 Builds a memory stream by copying from another memory block.
bool IsOpen ()
 Returns true is the connection is still open.
int Close ()
int64 GetSize ()
 Gets the size of the stream.
int64 GetPos ()
 Gets the current position of the stream.
int64 SetPos (int64 p)
 Sets the current position of the stream.
int Open (char *Str, int Int)
 Opens a file and reads it all into memory.
int64 SetSize (int64 Size)
 Changes the size of the memory block, keeping any common bytes.
int Read (void *Buffer, int Size, int Flags=0)
 Read bytes out of the stream.
int Write (void *Buffer, int Size, int Flags=0)
 Write bytes to the stream.
GStreamClone ()
 Creates a dynamically allocated copy of the same type of stream. This new stream is not connected to anything.

Detailed Description

In memory stream for storing sub-streams or memory blocks.


Constructor & Destructor Documentation

GMemStream::GMemStream GStream Src,
int64  Start,
int64  Len
 

Builds memory from sub-stream.

Parameters:
Src  The source stream
Start  The starting position in the stream, or -1 for the current position. Use -1 for non-seekable streams like sockets
len  The length of the sub-stream, or -1 to read all the data to the end

GMemStream::GMemStream void *  Mem,
int64  Len
 

Builds a memory stream by copying from another memory block.

Parameters:
mem  The source memory block
len  The length of the block


Member Function Documentation

GStream * GMemStream::Clone  )  [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 from GStream.

int GMemStream::Close  )  [inline, virtual]
 

Closes the connection

Returns:
> zero on success

Reimplemented from GStream.

int64 GMemStream::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 from GStream.

int64 GMemStream::GetSize  )  [inline, virtual]
 

Gets the size of the stream.

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

Reimplemented from GStream.

int GMemStream::Read void *  Buffer,
int  Size,
int  Flags = 0
[virtual]
 

Read bytes out of the stream.

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

Reimplemented from GStream.

int64 GMemStream::SetPos int64  p  )  [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 from GStream.

int GMemStream::Write void *  Buffer,
int  Size,
int  Flags = 0
[virtual]
 

Write bytes to the stream.

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

Reimplemented from GStream.


The documentation for this class was generated from the following files:
Generated on Wed Oct 26 14:47:01 2005 for Lgi by  doxygen 1.4.1