ScummVM
LastExpress::ResourceManager Class Reference

#include <resource.h>

+ Inheritance diagram for LastExpress::ResourceManager:
+ Collaboration diagram for LastExpress::ResourceManager:

Public Member Functions

 ResourceManager (bool demo)
 
 ~ResourceManager () override
 
bool loadArchive (ArchiveIndex type)
 
Common::SeekableReadStreamgetFileStream (const Common::String &name) const
 
bool hasFile (const Common::String &name) const override
 Check if a member with the given name is present in the Archive. More...
 
int listMembers (Common::ArchiveMemberList &list) const override
 Add all members of the Archive to list. More...
 
const Common::ArchiveMemberPtr getMember (const Common::String &name) const override
 Returns a ArchiveMember representation of the given file. More...
 
Common::SeekableReadStreamcreateReadStreamForMember (const Common::String &name) const override
 Create a stream bound to a member with the specified name in the archive. More...
 
BackgroundloadBackground (const Common::String &name) const
 
CursorloadCursor () const
 
FontloadFont () const
 
- Public Member Functions inherited from Common::Archive
virtual ~Archive ()
 
virtual int listMatchingMembers (ArchiveMemberList &list, const String &pattern) const
 Add all members of the Archive matching the specified pattern to list. More...
 

Static Public Member Functions

static bool isArchivePresent (ArchiveIndex type)
 

Private Member Functions

bool loadArchive (const Common::String &name)
 
void reset ()
 

Private Attributes

bool _isDemo
 
Common::Array< HPFArchive * > _archives
 

Friends

class Debugger
 

Detailed Description

Definition at line 37 of file resource.h.

Constructor & Destructor Documentation

◆ ResourceManager()

LastExpress::ResourceManager::ResourceManager ( bool  demo)

Definition at line 43 of file resource.cpp.

◆ ~ResourceManager()

LastExpress::ResourceManager::~ResourceManager ( )
override

Definition at line 46 of file resource.cpp.

Member Function Documentation

◆ createReadStreamForMember()

Common::SeekableReadStream * LastExpress::ResourceManager::createReadStreamForMember ( const Common::String name) const
overridevirtual

Create a stream bound to a member with the specified name in the archive.

If no member with this name exists, 0 is returned.

Returns
the newly created input stream

Implements Common::Archive.

Definition at line 177 of file resource.cpp.

◆ getFileStream()

Common::SeekableReadStream * LastExpress::ResourceManager::getFileStream ( const Common::String name) const

Definition at line 131 of file resource.cpp.

◆ getMember()

const Common::ArchiveMemberPtr LastExpress::ResourceManager::getMember ( const Common::String name) const
overridevirtual

Returns a ArchiveMember representation of the given file.

Implements Common::Archive.

Definition at line 170 of file resource.cpp.

◆ hasFile()

bool LastExpress::ResourceManager::hasFile ( const Common::String name) const
overridevirtual

Check if a member with the given name is present in the Archive.

Patterns are not allowed, as this is meant to be a quick File::exists() replacement.

Implements Common::Archive.

Definition at line 147 of file resource.cpp.

◆ isArchivePresent()

bool LastExpress::ResourceManager::isArchivePresent ( ArchiveIndex  type)
static

Definition at line 50 of file resource.cpp.

◆ listMembers()

int LastExpress::ResourceManager::listMembers ( Common::ArchiveMemberList list) const
overridevirtual

Add all members of the Archive to list.

Must only append to list, and not remove elements from it.

Returns
the number of names added to list

Implements Common::Archive.

Definition at line 156 of file resource.cpp.

◆ loadArchive() [1/2]

bool LastExpress::ResourceManager::loadArchive ( ArchiveIndex  type)

Definition at line 72 of file resource.cpp.

◆ loadArchive() [2/2]

bool LastExpress::ResourceManager::loadArchive ( const Common::String name)
private

Definition at line 113 of file resource.cpp.

◆ loadBackground()

Background * LastExpress::ResourceManager::loadBackground ( const Common::String name) const

Definition at line 192 of file resource.cpp.

◆ loadCursor()

Cursor * LastExpress::ResourceManager::loadCursor ( ) const

Definition at line 209 of file resource.cpp.

◆ loadFont()

Font * LastExpress::ResourceManager::loadFont ( ) const

Definition at line 226 of file resource.cpp.

◆ reset()

void LastExpress::ResourceManager::reset ( )
private

Definition at line 105 of file resource.cpp.

Friends And Related Function Documentation

◆ Debugger

friend class Debugger
friend

Definition at line 66 of file resource.h.

Member Data Documentation

◆ _archives

Common::Array<HPFArchive *> LastExpress::ResourceManager::_archives
private

Definition at line 64 of file resource.h.

◆ _isDemo

bool LastExpress::ResourceManager::_isDemo
private

Definition at line 59 of file resource.h.


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