ScummVM API documentation
Ultima::Shared::UltimaDataArchive Class Reference

#include <data_archive.h>

Inheritance diagram for Ultima::Shared::UltimaDataArchive:
Common::Archive

Public Member Functions

bool hasFile (const Common::Path &path) const override
 
int listMatchingMembers (Common::ArchiveMemberList &list, const Common::Path &pattern, bool matchPathComponents=false) const override
 
int listMembers (Common::ArchiveMemberList &list) const override
 
const Common::ArchiveMemberPtr getMember (const Common::Path &path) const override
 
Common::SeekableReadStreamcreateReadStreamForMember (const Common::Path &path) const override
 
bool isPathDirectory (const Common::Path &path) const override
 
- Public Member Functions inherited from Common::Archive
virtual SeekableReadStreamcreateReadStreamForMemberAltStream (const Path &path, AltStreamType altStreamType) const
 
virtual SeekableReadStreamcreateReadStreamForMemberNext (const Path &path, const Archive *starting) const
 
Common::Error dumpArchive (const Path &destPath)
 
virtual char getPathSeparator () const
 

Static Public Member Functions

static bool load (const Common::Path &subfolder, int reqMajorVersion, int reqMinorVersion, Common::U32String &errorMsg)
 

Detailed Description

The data archive class encapsulates access to a specific subfolder within the ultima.dat data file for a game. It wraps up the subfolder so it can be accessed in each game as a generic "data" subfolder. This allows the individual games to simplify their data loading code.

Member Function Documentation

◆ load()

static bool Ultima::Shared::UltimaDataArchive::load ( const Common::Path subfolder,
int  reqMajorVersion,
int  reqMinorVersion,
Common::U32String errorMsg 
)
static

Creates a data archive wrapper for the ultima.dat datafile. Firstly, for debugging purposes, if a "files" folder exists on any path that has the given subfolder, it will be used first. This will allow for setting the ScummVM Extra Path to the create_ultima folder, and it will give preference the files there. Otherwise, it checks for the presence of ultima.dat, and if the required data is found, it returns the new archive. Otherwise, returns an error message in the errorMsg field

◆ hasFile()

bool Ultima::Shared::UltimaDataArchive::hasFile ( const Common::Path path) 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.

◆ listMatchingMembers()

int Ultima::Shared::UltimaDataArchive::listMatchingMembers ( Common::ArchiveMemberList list,
const Common::Path pattern,
bool  matchPathComponents = false 
) const
overridevirtual

Add all members of the Archive matching the specified pattern to list. Must only append to list, and not remove elements from it.

Returns
the number of members added to list

Reimplemented from Common::Archive.

◆ listMembers()

int Ultima::Shared::UltimaDataArchive::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.

◆ getMember()

const Common::ArchiveMemberPtr Ultima::Shared::UltimaDataArchive::getMember ( const Common::Path path) const
overridevirtual

Returns a ArchiveMember representation of the given file.

Implements Common::Archive.

◆ createReadStreamForMember()

Common::SeekableReadStream* Ultima::Shared::UltimaDataArchive::createReadStreamForMember ( const Common::Path path) 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.

◆ isPathDirectory()

bool Ultima::Shared::UltimaDataArchive::isPathDirectory ( const Common::Path path) const
overridevirtual

Check if a member with the given name exists and is a directory.

Reimplemented from Common::Archive.


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