Class hierarchy Compound list File list Compound Members File Members

# ResourceStream Class Reference

This class gives a simple way of storing application's data files into one archive, with easy access to each file at run time. More...

Inherits Interface.

List of all members.

## Public Members

- virtual istream* getStream (const char* Name) = 0
    Get a stream for a specific resource.

- virtual void freeStream (istream* is) = 0
    Free the stream, when done with it.

- virtual char* getData (const char* Name, char* cData, int MaxLen=-1) = 0
    Get a resource data copied into a buffer.

- virtual int getLength (const char* Name) = 0
    Get the length of a specific resource.

- virtual long putData (const char* Name, char* Buffer, int Length) = 0
    Write a resource to the file.

- virtual long putData (const char* Name, istream* is, int Length) = 0
    Write a resource to the file using an input stream for source.

- virtual long setCompression (int Compression) = 0
    Set this to non-zero to compress all data put into the resource file.

- virtual long status () = 0
    Returns a non-zero value if an error occured.

## Related Functions

(Note that these are not member functions.)

- DLLExport ResourceStream* newResourceStream ()
    Create a new ResourceStream that uses disk files directly.

- DLLExport ResourceStream* newResourceStream (ofstream* os)
    Create a new ResourceStream for writing.

- DLLExport ResourceStream* newResourceStream (const char* Name, int Create=0)
    Create a new ResourceStream for reading (Create=0) or writing (Create=1).

- DLLExport ResourceStream* setDefaultResourceStream (ResourceStream* RS)
    Set a resource stream as the system default resource stream.

## Detailed Description

This class gives a simple way of storing application's data files into one archive, with easy access to each file at run time.

Each resource is identified by a name (file name !?)

## Member Function Documentation

### virtual istream* ResourceStream::getStream(const char* Name) = 0`[pure virtual]`

Get a stream for a specific resource.

### virtual void ResourceStream::freeStream(istream* is) = 0`[pure virtual]`

Free the stream, when done with it.

### virtual char* ResourceStream::getData(const char* Name, char* cData, int MaxLen=-1) = 0`[pure virtual]`

Get a resource data copied into a buffer.

### virtual int ResourceStream::getLength(const char* Name) = 0`[pure virtual]`

Get the length of a specific resource.

### virtual long ResourceStream::putData(const char* Name, char* Buffer, int Length) = 0`[pure virtual]`

Write a resource to the file.

### virtual long ResourceStream::putData(const char* Name, istream* is, int Length) = 0`[pure virtual]`

Write a resource to the file using an input stream for source.

### virtual long ResourceStream::setCompression(int Compression) = 0`[pure virtual]`

Set this to non-zero to compress all data put into the resource file.

### virtual long ResourceStream::status() = 0`[pure virtual]`

Returns a non-zero value if an error occured.

### DLLExport ResourceStream* newResourceStream()

Create a new ResourceStream that uses disk files directly.

### DLLExport ResourceStream* newResourceStream(ofstream* os)

Create a new ResourceStream for writing.

Requires stream of the output resource file

### DLLExport ResourceStream* newResourceStream(const char* Name, int Create=0)

Create a new ResourceStream for reading (Create=0) or writing (Create=1).

Will open a disk file by the given name.

### DLLExport ResourceStream* setDefaultResourceStream(ResourceStream* RS)

Set a resource stream as the system default resource stream.

It will be released when the program terminates, or when setting a different stream as the system default resource stream.

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

- CON_Misc.h