Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATStream Class Reference

CATStream Class Reference
[Common Accessibility Technology [CAT] library]

#include <CATStream.h>

Inheritance diagram for CATStream:

CATStreamFile CATStreamRAM CATStreamSub

List of all members.


Detailed Description

Base interface for streams.

CATStream provides a generic stream interface class to be inherited by files, encrypted files, memory streams, and anything else that just needs basic read/write stream operations.

Todo:
Need to add test cases to CATTests for all stream classes. They were converted from my old personal library, and haven't really been tested since conversion.

Definition at line 33 of file CATStream.h.


Public Types

enum  OPEN_MODE {
  READ_ONLY = 0x0,
  READ_WRITE_EXISTING_ONLY = 0x1,
  READ_WRITE_EXISTING_FIRST = 0x2,
  READ_WRITE_CREATE_TRUNC = 0x3,
  WRITE_CREATE_ONLY = 0x4,
  SHARE_ALL = 0x0,
  SHARE_NONE = 0x100
}

Public Member Functions

 CATStream ()
virtual ~CATStream ()
virtual CATResult Open (const CATWChar *pathname, OPEN_MODE mode)=0
virtual CATResult Close ()=0
virtual bool IsOpen ()=0
virtual CATResult Read (void *buffer, CATUInt32 &length)=0
virtual CATResult Write (const void *buffer, CATUInt32 length)=0
virtual CATResult ReadAbs (void *buffer, CATUInt32 &length, CATInt64 position)=0
virtual CATResult WriteAbs (const void *buffer, CATUInt32 length, CATInt64 position)=0
virtual CATStreamCreateSubStream (CATInt64 streamOffset, CATInt64 streamLength, CATSUBSTREAMBUILDER builder=CATStream::DefSubStreamBuilder, void *param1=0, CATUInt32 param2=0)
virtual CATResult ReleaseSubStream (CATStream *&subStream)
virtual CATResult Size (CATInt64 &filesize)=0
virtual bool IsSeekable ()=0
virtual CATResult SeekRelative (CATInt32 offset)=0
virtual CATResult SeekAbsolute (CATInt64 position)=0
virtual CATResult SeekFromEnd (CATInt32 offset)=0
virtual CATResult GetPosition (CATInt64 &position)=0
virtual CATString GetName () const =0
virtual CATResult CopyToStream (CATStream *outputStream, CATUInt32 bufSize=kCAT_DEFAULT_STREAM_BUF_SIZE, CATInt64 offset=0, CATInt64 length=0)
 Copy from one stream to another using the specified buffer size.

Static Public Member Functions

static CATStreamDefSubStreamBuilder (CATInt64 offset, CATInt64 length, CATStream *parent, void *param1, CATUInt32 param2)
 This is the default substream builder - it creates just CATStreamSub*'s.

Protected Attributes

CATUInt32 fSubCount

Private Types

typedef CATStream *(* CATSUBSTREAMBUILDER )(CATInt64 offset, CATInt64 length, CATStream *parent, void *param1, CATUInt32 param2)

Private Member Functions

CATStreamoperator= (const CATStream &stream)

The documentation for this class was generated from the following files:
Generated on Mon Feb 11 04:10:55 2008 for Game Accessibility Suite by doxygen 1.5.4