#include <packagemanager.h>
Public Types | |
| enum | FILE_TYPES { FT_DIRECTORY = (1 << 0), FT_FILE = (1 << 1) } |
Public Member Functions | |
| PackageManager (Kernel *pKernel) | |
| void | setRunWithExtractedFiles (const Common::Path &directoryName) |
| bool | loadPackage (const Common::Path &fileName, const Common::String &mountPosition) |
| bool | loadDirectoryAsPackage (const Common::Path &directoryName, const Common::String &mountPosition) |
| byte * | getFile (const Common::String &fileName, uint *pFileSize=NULL) |
| Common::SeekableReadStream * | getStream (const Common::String &fileName) |
| char * | getXmlFile (const Common::String &fileName, uint *pFileSize=NULL) |
| Common::String | getCurrentDirectory () |
| bool | changeDirectory (const Common::String &directory) |
| Common::String | getAbsolutePath (const Common::String &fileName) |
| int | doSearch (Common::ArchiveMemberList &list, const Common::String &filter, const Common::String &path, uint typeFilter=FT_DIRECTORY|FT_FILE) |
| bool | fileExists (const Common::String &FileName) |
Additional Inherited Members | |
Protected Member Functions inherited from Sword25::Service | |
| Service (Kernel *pKernel) | |
| Kernel * | GetKernel () const |
The Package Manager interface
|
inline |
Set the PackageManager to run on extracted game files.s
| bool Sword25::PackageManager::loadPackage | ( | const Common::Path & | fileName, |
| const Common::String & | mountPosition | ||
| ) |
Mounts the contents of a package in the directory specified in the directory tree.
| FileName | The filename of the package to mount |
| MountPosition | The directory name under which the package should be mounted |
| bool Sword25::PackageManager::loadDirectoryAsPackage | ( | const Common::Path & | directoryName, |
| const Common::String & | mountPosition | ||
| ) |
Mounts the contents of a directory in the specified directory in the directory tree.
| The | name of the directory to mount |
| MountPosition | The directory name under which the package should be mounted |
| byte* Sword25::PackageManager::getFile | ( | const Common::String & | fileName, |
| uint * | pFileSize = NULL |
||
| ) |
Downloads a file from the directory tree
| FileName | The filename of the file to load |
| pFileSize | Pointer to the variable that will contain the size of the loaded file. The deafult is NULL. |
| Common::SeekableReadStream* Sword25::PackageManager::getStream | ( | const Common::String & | fileName | ) |
Returns a stream from file file from the directory tree
| FileName | The filename of the file to load |
|
inline |
Downloads an XML file and prefixes it with an XML Version key, since the XML files don't contain it, and it is required for ScummVM to correctly parse the XML.
| FileName | The filename of the file to load |
| pFileSize | Pointer to the variable that will contain the size of the loaded file. The deafult is NULL. |
|
inline |
Returns the path to the current directory.
| bool Sword25::PackageManager::changeDirectory | ( | const Common::String & | directory | ) |
Changes the current directory.
| Directory | The path to the new directory. The path can be relative. |
| Common::String Sword25::PackageManager::getAbsolutePath | ( | const Common::String & | fileName | ) |
Returns the absolute path to a file in the directory tree.
| FileName | The filename of the file whose absolute path is to be determined. These parameters may include both relative and absolute paths. |
| int Sword25::PackageManager::doSearch | ( | Common::ArchiveMemberList & | list, |
| const Common::String & | filter, | ||
| const Common::String & | path, | ||
| uint | typeFilter = FT_DIRECTORY|FT_FILE |
||
| ) |
Creates a BS_PackageManager::FileSearch object to search for files
| Filter | Specifies the search string. Wildcards of '*' and '?' are allowed |
| Path | Specifies the directory that should be searched. |
| TypeFilter | A combination of flags BS_PackageManager::FT_DIRECTORY and BS_PackageManager::FT_FILE. These flags indicate whether to search for files, directories, or both. The default is BS_PackageManager::FT_DIRECTORY | BS_PackageManager::FT_FILE |
| bool Sword25::PackageManager::fileExists | ( | const Common::String & | FileName | ) |
Determines whether a file exists
| FileName | The filename |