#include <archive.h>
Public Member Functions | |
void | add (const String &name, Archive *arch, int priority=0, bool autoFree=true) |
void | addDirectory (const String &name, const Path &directory, int priority=0, int depth=1, bool flat=false) |
void | addDirectory (const String &name, const FSNode &directory, int priority=0, int depth=1, bool flat=false) |
void | addDirectory (const Path &directory, int priority=0, int depth=1, bool flat=false) |
void | addDirectory (const FSNode &directory, int priority=0, int depth=1, bool flat=false) |
void | addSubDirectoryMatching (const FSNode &directory, const String &caselessName, int priority=0, int depth=1, bool flat=false) |
void | addSubDirectoriesMatching (const FSNode &directory, String origPattern, bool ignoreCase, int priority=0, int depth=1, bool flat=false) |
void | remove (const String &name) |
bool | hasArchive (const String &name) const |
Archive * | getArchive (const String &name) const |
virtual void | clear () |
void | setPriority (const String &name, int priority) |
bool | hasFile (const Path &path) const override |
bool | isPathDirectory (const Path &path) const override |
int | listMatchingMembers (ArchiveMemberList &list, const Path &pattern, bool matchPathComponents=false) const override |
int | listMatchingMembers (ArchiveMemberDetailsList &list, const Path &pattern, bool matchPathComponents=false) const |
int | listMembers (ArchiveMemberList &list) const override |
const ArchiveMemberPtr | getMember (const Path &path) const override |
const ArchiveMemberPtr | getMember (const Path &path, Archive **container) const |
SeekableReadStream * | createReadStreamForMember (const Path &path) const override |
SeekableReadStream * | createReadStreamForMemberAltStream (const Path &path, AltStreamType altStreamType) const override |
SeekableReadStream * | createReadStreamForMemberNext (const Path &path, const Archive *starting) const override |
void | setIgnoreClashes (bool ignoreClashes) |
Public Member Functions inherited from Common::Archive | |
Common::Error | dumpArchive (const Path &destPath) |
virtual char | getPathSeparator () const |
The SearchSet class enables access to a group of Archives through the Archive interface.
Its intended usage is a situation in which there are no name clashes among names in the contained Archives, hence the simplistic policy of always looking for the first match. SearchSet does guarantee that searches are performed in DESCENDING priority order. In case of conflicting priorities, insertion order prevails.
void Common::SearchSet::add | ( | const String & | name, |
Archive * | arch, | ||
int | priority = 0 , |
||
bool | autoFree = true |
||
) |
Add a new archive to the searchable set.
void Common::SearchSet::addDirectory | ( | const String & | name, |
const Path & | directory, | ||
int | priority = 0 , |
||
int | depth = 1 , |
||
bool | flat = false |
||
) |
Create and add an FSDirectory by name.
void Common::SearchSet::addDirectory | ( | const String & | name, |
const FSNode & | directory, | ||
int | priority = 0 , |
||
int | depth = 1 , |
||
bool | flat = false |
||
) |
Create and add an FSDirectory by FSNode.
void Common::SearchSet::addDirectory | ( | const Path & | directory, |
int | priority = 0 , |
||
int | depth = 1 , |
||
bool | flat = false |
||
) |
Overloads which use directory path as name
|
inline |
Create and add a subdirectory by name (caseless).
It is also possible to add subdirectories of subdirectories (of any depth) with this function. The path separator for this case is SLASH for all systems.
Example:
"game/itedata"
In this example, the code first tries to search for all directories matching "game" (case insensitive) in the path "directory" first and search through all of the matches for "itedata" (case insensitive too).
Note that it will add all matches found!
Even though this method is currently implemented via addSubDirectoriesMatching, it is not safe to assume that this method is using anything other than a simple case insensitive compare. Thus, do not use any tokens like '*' or '?' in the "caselessName" parameter of this function.
void Common::SearchSet::addSubDirectoriesMatching | ( | const FSNode & | directory, |
String | origPattern, | ||
bool | ignoreCase, | ||
int | priority = 0 , |
||
int | depth = 1 , |
||
bool | flat = false |
||
) |
Create and add subdirectories by pattern.
It is also possible to add subdirectories of subdirectories (of any depth) with this function. The path separator for this case is SLASH for all systems.
Example:
"game/itedata"
In this example, the code first tries to search for all directories matching "game" in the path "directory" first and search through all of the matches for "itedata". If "ingoreCase" is set to true, the code does a case insensitive match, otherwise it is doing a case sensitive match.
This method also works with tokens. For a list of available tokens, see Common::matchString.
void Common::SearchSet::remove | ( | const String & | name | ) |
Remove an archive from the searchable set.
bool Common::SearchSet::hasArchive | ( | const String & | name | ) | const |
Check if a given archive name is already present.
Looks up an archive in the searchable set.
|
virtual |
Empty the searchable set.
Reimplemented in Common::SearchManager.
void Common::SearchSet::setPriority | ( | const String & | name, |
int | priority | ||
) |
Change the order of searches.
|
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. This returns "true" for both files and directories.
Implements Common::Archive.
|
overridevirtual |
Check if a member with the given name
exists and is a directory.
Reimplemented from Common::Archive.
|
overridevirtual |
Add all members of the Archive matching the specified pattern to the list. Must only append to list, and not remove elements from it.
matchPathComponents | if set, then whole string will be matched, otherwise (default), path separator ('/') does not match with wildcards |
Reimplemented from Common::Archive.
|
overridevirtual |
Add all members of the Archive to the list. Must only append to list, and not remove elements from it.
Implements Common::Archive.
|
overridevirtual |
Return an ArchiveMember representation of the given file.
Implements Common::Archive.
|
overridevirtual |
Implement createReadStreamForMember from the Archive base class. The current policy is opening the first file encountered that matches the name.
Implements Common::Archive.
|
overridevirtual |
Implement createReadStreamForMemberAltStream from the Archive base class. The current policy is opening the first file encountered that matches the name.
Reimplemented from Common::Archive.
|
overridevirtual |
Similar to above but exclude matches from archives before starting and starting itself.
Reimplemented from Common::Archive.
|
inline |
Ignore clashes when adding directories. For more details, see the corresponding parameter in FSDirectory documentation.