ScummVM API documentation
Common::Archive Class Referenceabstract

#include <archive.h>

Inheritance diagram for Common::Archive:
AndroidAssetArchive Common::FSDirectory Common::InstallShieldV3 Common::MemcachingCaseInsensitiveArchive Common::ProDOSDisk Common::SearchSet Director::ProjectorArchive Grim::Lab Grim::LangFilter Grim::MsCabinet Hypno::LibFile Kyra::CachedArchive Kyra::PlainArchive Kyra::TlkArchive LastExpress::HPFArchive LastExpress::ResourceManager MM::Shared::Xeen::BaseCCArchive Mohawk::InstallerArchive MTropolis::VirtualFileSystem Nancy::CifTree NGI::NGIArchive Prince::PtcArchive Stark::Formats::XARCArchive Trecision::FastFile Ultima::Shared::Resources Ultima::Shared::UltimaDataArchive Ultima::Shared::UltimaDataArchiveProxy Ultima::Ultima8::U8SaveFile Wintermute::PackageSet ZVision::ZfsArchive

Public Member Functions

virtual bool hasFile (const Path &path) const =0
 
virtual bool isPathDirectory (const Path &path) const
 
virtual int listMatchingMembers (ArchiveMemberList &list, const Path &pattern, bool matchPathComponents=false) const
 
virtual int listMembers (ArchiveMemberList &list) const =0
 
virtual const ArchiveMemberPtr getMember (const Path &path) const =0
 
virtual SeekableReadStreamcreateReadStreamForMember (const Path &path) const =0
 
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
 

Detailed Description

The Archive class allows for managing the members of arbitrary containers in a uniform fashion, allowing lookup by (file) names. It also supports opening a file and returning a usable input stream.

Member Function Documentation

◆ hasFile()

◆ isPathDirectory()

virtual bool Common::Archive::isPathDirectory ( const Path path) const
virtual

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

Reimplemented in Common::SearchSet, Common::FSDirectory, Ultima::Shared::UltimaDataArchiveProxy, Ultima::Shared::UltimaDataArchive, and MTropolis::VirtualFileSystem.

◆ listMatchingMembers()

virtual int Common::Archive::listMatchingMembers ( ArchiveMemberList list,
const Path pattern,
bool  matchPathComponents = false 
) const
virtual

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

Parameters
matchPathComponentsif set, then whole string will be matched, otherwise (default), path separator ('/') does not match with wildcards
Returns
The number of members added to list.

Reimplemented in Common::SearchSet, Common::FSDirectory, Ultima::Shared::UltimaDataArchiveProxy, Ultima::Shared::UltimaDataArchive, MTropolis::VirtualFileSystem, and Stark::Formats::XARCArchive.

◆ listMembers()

◆ getMember()

◆ createReadStreamForMember()

◆ createReadStreamForMemberAltStream()

virtual SeekableReadStream* Common::Archive::createReadStreamForMemberAltStream ( const Path path,
AltStreamType  altStreamType 
) const
virtual

Create a stream bound to an alternate stream of 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.

Reimplemented in Common::FSDirectory, Common::SearchSet, Common::MemcachingCaseInsensitiveArchive, and MTropolis::VirtualFileSystem.

◆ createReadStreamForMemberNext()

virtual SeekableReadStream* Common::Archive::createReadStreamForMemberNext ( const Path path,
const Archive starting 
) const
inlinevirtual

For most archives: same as previous. For SearchSet see SearchSet documentation.

Reimplemented in Common::SearchSet.

◆ dumpArchive()

Common::Error Common::Archive::dumpArchive ( const Path destPath)

Dump all files from the archive to the given directory

◆ getPathSeparator()

virtual char Common::Archive::getPathSeparator ( ) const
virtual

Returns the separator used by internal paths in the archive

Reimplemented in MTropolis::VirtualFileSystem, and Common::InstallShieldV3.


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