ScummVM API documentation
Sherlock::Resources Class Reference

Public Member Functions

 Resources (SherlockEngine *vm)
 
void addToCache (const Common::Path &filename)
 
void addToCache (const Common::Path &filename, const Common::Path &libFilename)
 
void addToCache (const Common::Path &filename, Common::SeekableReadStream &stream)
 
bool isInCache (const Common::Path &filename) const
 
void decompressIfNecessary (Common::SeekableReadStream *&stream)
 
Common::SeekableReadStreamload (const Common::Path &filename)
 
Common::SeekableReadStreamload (const Common::Path &filename, const Common::Path &libraryFile, bool suppressErrors=false)
 
bool exists (const Common::Path &filename) const
 
int resourceIndex () const
 
void getResourceNames (const Common::Path &libraryFile, Common::StringArray &names)
 
Common::SeekableReadStreamdecompress (Common::SeekableReadStream &source)
 
Common::SeekableReadStreamdecompress (Common::SeekableReadStream &source, uint32 outSize)
 
void decompress (Common::SeekableReadStream &source, byte *buffer, uint32 outSize)
 

Static Public Member Functions

static Common::SeekableReadStreamdecompressLZ (Common::SeekableReadStream &source, uint32 outSize)
 
static void decompressLZ (Common::SeekableReadStream &source, byte *outBuffer, int32 outSize, int32 inSize)
 

Member Function Documentation

◆ addToCache() [1/3]

void Sherlock::Resources::addToCache ( const Common::Path filename)

Adds the specified file to the cache. If it's a library file, takes care of loading its index for future use

◆ addToCache() [2/3]

void Sherlock::Resources::addToCache ( const Common::Path filename,
const Common::Path libFilename 
)

Adds a resource from a library file to the cache

◆ addToCache() [3/3]

void Sherlock::Resources::addToCache ( const Common::Path filename,
Common::SeekableReadStream stream 
)

Adds a given stream to the cache under the given name

◆ decompressIfNecessary()

void Sherlock::Resources::decompressIfNecessary ( Common::SeekableReadStream *&  stream)

Checks the passed stream, and if is compressed, deletes it and replaces it with its uncompressed data

◆ load() [1/2]

Common::SeekableReadStream* Sherlock::Resources::load ( const Common::Path filename)

Returns a stream for a given file

◆ load() [2/2]

Common::SeekableReadStream* Sherlock::Resources::load ( const Common::Path filename,
const Common::Path libraryFile,
bool  suppressErrors = false 
)

Loads a specific resource from a given library file

◆ exists()

bool Sherlock::Resources::exists ( const Common::Path filename) const

Returns true if the given file exists on disk or in the cache

◆ resourceIndex()

int Sherlock::Resources::resourceIndex ( ) const

Returns the index of the last loaded resource in its given library file. This will be used primarily when loading talk files, so the engine can update the given conversation number in the journal

◆ getResourceNames()

void Sherlock::Resources::getResourceNames ( const Common::Path libraryFile,
Common::StringArray names 
)

Produces a list of all resource names within a file. Used by the debugger.

◆ decompress() [1/3]

Common::SeekableReadStream* Sherlock::Resources::decompress ( Common::SeekableReadStream source)

Decompresses LZW compressed data

◆ decompress() [2/3]

Common::SeekableReadStream* Sherlock::Resources::decompress ( Common::SeekableReadStream source,
uint32  outSize 
)

Decompresses LZW compressed data

◆ decompress() [3/3]

void Sherlock::Resources::decompress ( Common::SeekableReadStream source,
byte *  buffer,
uint32  outSize 
)

Decompresses LZW compressed data

◆ decompressLZ() [1/2]

static Common::SeekableReadStream* Sherlock::Resources::decompressLZ ( Common::SeekableReadStream source,
uint32  outSize 
)
static

Decompresses LZW compressed data

◆ decompressLZ() [2/2]

static void Sherlock::Resources::decompressLZ ( Common::SeekableReadStream source,
byte *  outBuffer,
int32  outSize,
int32  inSize 
)
static

Decompresses LZW compressed data


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