diff options
author | Paul Gilbert | 2010-07-31 06:23:38 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 21:55:38 +0000 |
commit | e78b19a650e27fe9a24d0e4c9c938294c7b08650 (patch) | |
tree | d61751dd6dbefe6834742ff9cc5d10f61be4dc02 /engines/sword25/package/packagemanager.h | |
parent | 1842de4b0035854f271a40dcaa514cdba66bcf57 (diff) | |
download | scummvm-rg350-e78b19a650e27fe9a24d0e4c9c938294c7b08650.tar.gz scummvm-rg350-e78b19a650e27fe9a24d0e4c9c938294c7b08650.tar.bz2 scummvm-rg350-e78b19a650e27fe9a24d0e4c9c938294c7b08650.zip |
SWORD25: Converted kernel/kernel.cpp to compile under ScummVM
This commit creates a skeleton detection and engine class, as well as code necessary to call the kernel initiation.
The kernel/kernel.cpp has been converted to compile under ScummVM, along with all dependant header files.
svn-id: r53184
Diffstat (limited to 'engines/sword25/package/packagemanager.h')
-rwxr-xr-x | engines/sword25/package/packagemanager.h | 266 |
1 files changed, 134 insertions, 132 deletions
diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h index b6f7f1270f..77aaab257b 100755 --- a/engines/sword25/package/packagemanager.h +++ b/engines/sword25/package/packagemanager.h @@ -1,36 +1,39 @@ -// ----------------------------------------------------------------------------- -// This file is part of Broken Sword 2.5 -// Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdörfer -// -// Broken Sword 2.5 is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// Broken Sword 2.5 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Broken Sword 2.5; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// ----------------------------------------------------------------------------- - -/* - BS_PackageManager - ------------- - Dies ist das Package Manager Interface, dass alle Methoden enthält, die ein Package Manager - implementieren muss. - Beim Package Manager ist folgendes zu beachten: - 1. es wird ein komplett neuer (virtueller) Verzeichnisbaum erstellt, - in den Packages und Verzeichnisse gemounted werden können. - 2. zum Trennen von Elementen eines Verzeichnisspfades wird '/' statt '\' verwendet. - 3. LoadDirectoryAsPackage sollte nur zum Testen benutzt werden. Im Final Release sollen sich - alle Dateien in echten Packages befinden. - - Autor: Malte Thiesen, $author$ -*/ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + * BS_PackageManager + * ----------------- + * This is the package manager interface, that contains all the methods that a package manager + * must implement. + * In the package manager, note the following: + * 1. It creates a completely new (virtual) directory tree in the packages and directories + * can be mounted. + * 2. To seperate elements of a directory path '/' must be used rather than '\' + * 3. LoadDirectoryAsPackage should only be used for testing. The final release will be + * have all files in packages. + * + * Autor: Malte Thiesen, $author$ + */ #ifndef SWORD25_PACKAGE_MANAGER_H #define SWORD25_PACKAGE_MANAGER_H @@ -40,149 +43,148 @@ #include "sword25/kernel/kernel.h" #include "sword25/kernel/service.h" -// Klassendefinition +namespace Sword25 { + +// Class definitions + /** - @brief Das Package Manager Interface - - Beim Package Manager ist folgendes zu beachten:<br> - 1. es wird ein komplett neuer (virtueller) Verzeichnisbaum erstellt, - in den Packages und Verzeichnisse gemounted werden können.<br> - 2. zum Trennen von Elementen eines Verzeichnisspfades wird '/' statt '\' verwendet.<br> - 3. LoadDirectoryAsPackage sollte nur zum Testen benutzt werden. Im Final Release sollen sich - alle Dateien in echten Packages befinden. -*/ -class BS_PackageManager : public BS_Service -{ + * The Package Manager interface + * + * 1. It creates a completely new (virtual) directory tree in the packages and directories + * can be mounted. + * 2. To seperate elements of a directory path '/' must be used rather than '\' + * 3. LoadDirectoryAsPackage should only be used for testing. The final release will be + * have all files in packages. + */ +class BS_PackageManager : public BS_Service { public: BS_PackageManager(BS_Kernel* pKernel); virtual ~BS_PackageManager() {}; - enum FILE_TYPES - { + enum FILE_TYPES { FT_DIRECTORY = (1<<0), FT_FILE = (1<<1) }; /** - @brief Mit Instanzen dieses Objektes wird nach Dateien gesucht. - - Objekte diesen Types wird mit BS_PackageManager::CreateSearch erzeugt. - */ - class FileSearch - { + * File search class + * + * These objects are created with BS_PackageManager::CreateSearch + */ + class FileSearch { public: virtual ~FileSearch(){}; /** - @brief Gibt den Dateinamen der aktuellen Datei zurück. - @return Gibt den Dateinamen der aktuellen Datei zurück. - */ - virtual std::string GetCurFileName() = 0; + * Returns the filename of the current file + * @return Returns the filename of the current file + */ + virtual Common::String GetCurFileName() = 0; /** - @brief Gibt den Typ der aktuellen Datei zurück. - @return Gibt den Typ der aktuellen Datei zurück.<br> - Dieses ist entweder BS_PackageManager::FT_FILE oder BS_PackageManager::FT_DIRECTORY. - */ + * Returns the type of the current file + * @return Returns the type of the current file + * This is either BS_PackageManager::FT_FILE or BS_PackageManager::FT_DIRECTORY. + */ virtual unsigned int GetCurFileType() = 0; /** - @brief Gibt die Größe der aktuellen Datei zurück. - @return Gibt die Größe der aktuellen Datei zurück.<br> - Bei Verzeichnissen ist dieser Wert immer 0. - */ + * Returns the size of the current file + * @return Returns the size of the current file + * For directories, this value is always 0 + */ virtual unsigned int GetCurFileSize() = 0; - // Sucht die nächste Datei - // Gibt false zurück, falls keine weitere Datei gefunden wurde + // Finds the next file + // Returns false if no more files are found. /** - @brief Sucht die nächste Datei. - @return Gibt false zurück, falls keine weitere Datei die Suchkriterien erfüllte. + * Finds the next file. + * @return Returns false if no other file fulfills the search criteria */ virtual bool NextFile() = 0; }; /** - @brief Mounted den Inhalt eines Packages in das angegebene Verzeichnis im virtuellen Verzeichnisbaum. - @param FileName der Dateiname des zu mountenden Packages - @param MountPosition der Verzeichnisname, unter dem das Package gemounted werden soll - @return Gibt true zurück falls das mounten erfolgreich war, andernfalls false. + * Mounts the contents of a package in the directory specified in the virtual directory tree. + * @param FileName The filename of the package to mount + * @param MountPosition The directory name under which the package should be mounted + * @return Returns true if the mount was successful, otherwise false. */ - virtual bool LoadPackage(const std::string& FileName, const std::string& MountPosition) = 0; + virtual bool LoadPackage(const Common::String &FileName, const Common::String &MountPosition) = 0; /** - @brief Mounted den Inhalt eines Verzeichnisses in das angegebene Verzeichnis im virtuellen Verzeichnisbaum. - @param DirectoryName der Name des zu mountenden Verzeichnisses - @param MountPosition der Verzeichnisname, unter dem das Verzeichnis gemounted werden soll - @return Gibt true zurück falls das mounten erfolgreich war, andernfalls false. + * Mounts the contents of a directory in the specified directory in the virtual directory tree. + * @param The name of the directory to mount + * @param MountPosition The directory name under which the package should be mounted + * @return Returns true if the mount was successful, otherwise false. */ - virtual bool LoadDirectoryAsPackage(const std::string& DirectoryName, const std::string& MountPosition) = 0; + virtual bool LoadDirectoryAsPackage(const Common::String &DirectoryName, const Common::String &MountPosition) = 0; /** - @brief Lädt eine Datei aus dem virtuellen Verzeichnisbaum. - @param FileName der Dateiname der zu ladenden Datei - @param pFileSize Pointer auf die Variable, die die Größe der geladenen Datei enthalten soll<br> - Der Standardwert ist NULL. - @return Gibt einen Pointer auf die Dateidaten zürück, oder NULL, wenn die Datei nicht geladen werden konnte. - @remark Es darf nicht vergessen werden, die Dateidaten nach Benutzung mit BE_DELETE_A freizugeben. - */ - virtual void* GetFile(const std::string& FileName, unsigned int* pFileSize = NULL) = 0; + * Downloads a file from the virtual directory tree + * @param FileName The filename of the file to load + * @param pFileSize Pointer to the variable that will contain the size of the loaded file. The deafult is NULL. + * @return Specifies a pointer to the loaded data of the file + * @remark The client must not forget to release the data of the file using BE_DELETE_A. + */ + virtual void *GetFile(const Common::String &FileName, unsigned int *pFileSize = NULL) = 0; /** - @brief Gibt den Pfad zum aktuellen Verzeichnis zurück. - @return Gibt einen String zurück, der den Pfad zum aktuellen Verzeichnis enthält.<br> - Falls der Pfad nicht bestimmt werden konnte wird ein leerer String zurückgegeben. - @remark Zum Trennen von Pfadelementen wird "/" und nicht "\" verwendet. - */ - virtual std::string GetCurrentDirectory() = 0; + * Returns the path to the current directory. + * @return Returns a string containing the path to the current directory. + * If the path could not be determined, an empty string is returned. + * @remark For cutting path elements '\' is used rather than '/' elements. + */ + virtual Common::String GetCurrentDirectory() = 0; /** - @brief Wechselt das aktuelle Verzeichnis. - @param Directory ein String der das Verzeichnis bezeichnet, in dass gewechselt werden soll.<br> - Die Pfadangabe darf relativ sein. - @return Gibt true zurück, falls der Vorgang erfolgreich war, ansonsten false. - @remark Zum Trennen von Pfadelementen wird "/" und nicht "\" verwendet. - */ - virtual bool ChangeDirectory(const std::string& Directory) = 0; + * Changes the current directory. + * @param Directory The path to the new directory. The path can be relative. + * @return Returns true if the operation was successful, otherwise false. + * @remark For cutting path elements '\' is used rather than '/' elements. + */ + virtual bool ChangeDirectory(const Common::String& Directory) = 0; /** - @brief Gibt den absoluten Pfad zu einer Datei im virtuellen Verzeichnisbaum zurück. - @param FileName der Dateiname der Datei, deren absoluter Pfad bestimmt werden soll.<br> - Diese Parameter kann sowohl relative als auch absolute Pfadangaben beinhalten. - @return Gibt einen String zurück, der den absoluten Pfad zur übergebenen Datei enthält.<br> - Falls der absolute Pfad nicht bestimmt werden konnte, wird ein leerer String zurückgegeben. - @remark Zum Trennen von Pfadelementen wird "/" und nicht "\" verwendet. - */ - virtual std::string GetAbsolutePath(const std::string& FileName) = 0; + * Returns the absolute path to a file in the virtual directory tree. + * @param FileName The filename of the file whose absolute path is to be determined. + * These parameters may include both relative and absolute paths. + * @return Returns an absolute path to the given file. + * @remark For cutting path elements '\' is used rather than '/' elements. + */ + virtual Common::String GetAbsolutePath(const Common::String& FileName) = 0; /** - @brief Erstellt ein BS_PackageManager::FileSearch Objekt mit dem Nach Dateien gesucht werden kann. - @param Filter gibt den Suchstring an. Dieser darf die Wildcards '*' und '?' enthalten. - @param Path gibt das Verzeichnis an, welches durchsucht werden soll. - @param TypeFilter ist eine Kombination der Flags BS_PackageManager::FT_DIRECTORY und BS_PackageManager::FT_FILE.<br> - Diese Flags geben an, ob nach Dateien oder Verzeichnissen oder beiden gesucht werden soll.<br> - Der Standardwert ist BS_PackageManager::FT_DIRECTORY | BS_PackageManager::FT_FILE. - @return Gibt einen Pointer auf ein BS_PackageManager::FileSearch Objekt zurück, oder NULL wenn keine Datei gefunden wurde. - @remark Nicht vergessen, das Objekt nach Benutzung mit delete freizugeben. + * Creates a BS_PackageManager::FileSearch object to search for files + * @param Filter Specifies the search string. Wildcards of '*' and '?' are allowed + * @param Path Specifies the directory that should be searched. + * @param 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 + * @return Specifies a pointer to a BS_PackageManager::FileSearch object, or NULL if no file was found. + * @remark Do not forget to delete the object after use. */ - virtual FileSearch* CreateSearch(const std::string& Filter, const std::string& Path, unsigned int TypeFilter = FT_DIRECTORY | FT_FILE) = 0; + virtual FileSearch *CreateSearch(const Common::String &Filter, const Common::String &Path, unsigned int TypeFilter = FT_DIRECTORY | FT_FILE) = 0; /** - * @brief Gibt die Dateigröße zurück. - * @param FileName die Datei. - * @return die Dateigröße. Im Falle eines Fehlers wird 0xffffffff zurückgegeben. - * @remarks Bei komprimierten Containern wird die unkomprimierte Größe zurückgegeben. + * Returns a file's size + * @param FileName The filename + * @return The file size. If an error occurs, then 0xffffffff is returned. + * @remarks For files in packages, then uncompressed size is returned. **/ - virtual unsigned int GetFileSize(const std::string& FileName) = 0; + virtual unsigned int GetFileSize(const Common::String &FileName) = 0; /** - @brief Gibt den Typ einer Datei zurück. - @param FileName der Dateiname - @return Gibt den Dateityp zurück (BS_PackageManager::FT_DIRECTORY oder BS_PackageManager::FT_FILE).<br> - Falls die Datei nicht gefunden wurde wird 0 zurückgegeben. - */ - virtual unsigned int GetFileType(const std::string & FileName) = 0; + * Returns the type of a file. + * @param FileName The filename + * @return Returns the file type, either (BS_PackageManager::FT_DIRECTORY + * or BS_PackageManager::FT_FILE). + * If the file was not found, then 0 is returned. + */ + virtual unsigned int GetFileType(const Common::String &FileName) = 0; /** - @brief Bestimmt, ob eine Datei existiert. - @param FileName der Dateiname - @return Gibt true zurück, wenn die Datei existiert, ansonsten false. + * Determines whether a file exists + * @param FileName The filename + * @return Returns true if the file exists, otherwise false. */ - virtual bool FileExists(const std::string & FileName) = 0; + virtual bool FileExists(const Common::String & FileName) = 0; private: bool _RegisterScriptBindings(); }; +} // ENd of namespace Sword25 + #endif |