ScummVM
Kyra::Resource Class Reference

#include <resource.h>

Collaboration diagram for Kyra::Resource:

Public Member Functions

 Resource (KyraEngine_v1 *vm)
 
 ~Resource ()
 
bool reset ()
 
bool loadPakFile (Common::String filename)
 
bool loadPakFile (Common::String name, Common::ArchiveMemberPtr file)
 
void unloadPakFile (Common::String filename, bool remFromCache=false)
 
bool isInPakList (Common::String filename)
 
bool isInCacheList (Common::String name)
 
bool loadFileList (const Common::String &filedata)
 
bool loadFileList (const char *const *filelist, uint32 numFiles)
 
void unloadAllPakFiles ()
 
void listFiles (const Common::String &pattern, Common::ArchiveMemberList &list)
 
bool exists (const char *file, bool errorOutOnFail=false)
 
uint32 getFileSize (const char *file)
 
uint8fileData (const char *file, uint32 *size)
 
Common::SeekableReadStreamcreateReadStream (const Common::String &file)
 
Common::SeekableReadStreamEndiancreateEndianAwareReadStream (const Common::String &file)
 
bool loadFileToBuf (const char *file, void *buf, uint32 maxSize)
 

Protected Types

typedef Common::HashMap< Common::String, Common::Archive *, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualToArchiveMap
 
typedef Common::List< Common::SharedPtr< ResArchiveLoader > > LoaderList
 

Protected Member Functions

Common::ArchiveloadArchive (const Common::String &name, Common::ArchiveMemberPtr member)
 
Common::ArchiveloadInstallerArchive (const Common::String &file, const Common::String &ext, const uint8 offset)
 
bool loadProtectedFiles (const char *const *list)
 
void initializeLoaders ()
 

Protected Attributes

ArchiveMap _archiveCache
 
Common::SearchSet _files
 
Common::SearchSet _archiveFiles
 
Common::SearchSet _protectedFiles
 
LoaderList _loaders
 
KyraEngine_v1_vm
 

Detailed Description

Definition at line 48 of file resource.h.

Member Typedef Documentation

◆ ArchiveMap

◆ LoaderList

Definition at line 95 of file resource.h.

Constructor & Destructor Documentation

◆ Resource()

Kyra::Resource::Resource ( KyraEngine_v1 vm)

Definition at line 53 of file resource.cpp.

◆ ~Resource()

Kyra::Resource::~Resource ( )

Definition at line 68 of file resource.cpp.

Member Function Documentation

◆ createEndianAwareReadStream()

Common::SeekableReadStreamEndian * Kyra::Resource::createEndianAwareReadStream ( const Common::String file)

Definition at line 341 of file resource.cpp.

◆ createReadStream()

Common::SeekableReadStream * Kyra::Resource::createReadStream ( const Common::String file)

Definition at line 337 of file resource.cpp.

◆ exists()

bool Kyra::Resource::exists ( const char *  file,
bool  errorOutOnFail = false 
)

Definition at line 308 of file resource.cpp.

◆ fileData()

uint8 * Kyra::Resource::fileData ( const char *  file,
uint32 size 
)

Definition at line 293 of file resource.cpp.

◆ getFileSize()

uint32 Kyra::Resource::getFileSize ( const char *  file)

Definition at line 316 of file resource.cpp.

◆ initializeLoaders()

void Kyra::Resource::initializeLoaders ( )
protected

Definition at line 393 of file resource.cpp.

◆ isInCacheList()

bool Kyra::Resource::isInCacheList ( Common::String  name)

Definition at line 279 of file resource.cpp.

◆ isInPakList()

bool Kyra::Resource::isInPakList ( Common::String  filename)

Definition at line 274 of file resource.cpp.

◆ listFiles()

void Kyra::Resource::listFiles ( const Common::String pattern,
Common::ArchiveMemberList list 
)

Definition at line 289 of file resource.cpp.

◆ loadArchive()

Common::Archive * Kyra::Resource::loadArchive ( const Common::String name,
Common::ArchiveMemberPtr  member 
)
protected

Definition at line 346 of file resource.cpp.

◆ loadFileList() [1/2]

bool Kyra::Resource::loadFileList ( const Common::String filedata)

Definition at line 190 of file resource.cpp.

◆ loadFileList() [2/2]

bool Kyra::Resource::loadFileList ( const char *const *  filelist,
uint32  numFiles 
)

Definition at line 227 of file resource.cpp.

◆ loadFileToBuf()

bool Kyra::Resource::loadFileToBuf ( const char *  file,
void buf,
uint32  maxSize 
)

Definition at line 326 of file resource.cpp.

◆ loadInstallerArchive()

Common::Archive * Kyra::Resource::loadInstallerArchive ( const Common::String file,
const Common::String ext,
const uint8  offset 
)
protected

Definition at line 378 of file resource.cpp.

◆ loadPakFile() [1/2]

bool Kyra::Resource::loadPakFile ( Common::String  filename)

Definition at line 165 of file resource.cpp.

◆ loadPakFile() [2/2]

bool Kyra::Resource::loadPakFile ( Common::String  name,
Common::ArchiveMemberPtr  file 
)

Definition at line 175 of file resource.cpp.

◆ loadProtectedFiles()

bool Kyra::Resource::loadProtectedFiles ( const char *const *  list)
protected

Definition at line 241 of file resource.cpp.

◆ reset()

bool Kyra::Resource::reset ( )

Definition at line 76 of file resource.cpp.

◆ unloadAllPakFiles()

void Kyra::Resource::unloadAllPakFiles ( )

Definition at line 284 of file resource.cpp.

◆ unloadPakFile()

void Kyra::Resource::unloadPakFile ( Common::String  filename,
bool  remFromCache = false 
)

Definition at line 257 of file resource.cpp.

Member Data Documentation

◆ _archiveCache

ArchiveMap Kyra::Resource::_archiveCache
protected

Definition at line 82 of file resource.h.

◆ _archiveFiles

Common::SearchSet Kyra::Resource::_archiveFiles
protected

Definition at line 85 of file resource.h.

◆ _files

Common::SearchSet Kyra::Resource::_files
protected

Definition at line 84 of file resource.h.

◆ _loaders

LoaderList Kyra::Resource::_loaders
protected

Definition at line 96 of file resource.h.

◆ _protectedFiles

Common::SearchSet Kyra::Resource::_protectedFiles
protected

Definition at line 86 of file resource.h.

◆ _vm

KyraEngine_v1* Kyra::Resource::_vm
protected

Definition at line 98 of file resource.h.


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