46 #ifndef SWORD25_PACKAGE_MANAGER_H 47 #define SWORD25_PACKAGE_MANAGER_H 49 #include "common/archive.h" 50 #include "common/array.h" 51 #include "common/fs.h" 52 #include "common/str.h" 54 #include "sword25/kernel/common.h" 55 #include "sword25/kernel/kernel.h" 56 #include "sword25/kernel/service.h" 79 archive(archive_), _mountPath(mountPath_) {
92 bool _useEnglishSpeech;
102 FT_DIRECTORY = (1 << 0),
111 _extractedFiles =
true;
112 _directoryName = directoryName;
153 const char *versionStr =
"<?xml version=\"1.0\"?>";
155 char *data = (
char *)
getFile(fileName, &fileSize);
156 size_t resultSize = fileSize + strlen(versionStr) + 1;
157 char *result = (
char *)malloc(resultSize);
159 error(
"[PackageManager::getXmlFile] Cannot allocate memory");
162 Common::copy(data, data + fileSize, result + strlen(versionStr));
163 result[resultSize - 1] =
'\0';
167 *pFileSize = fileSize + strlen(versionStr);
214 bool registerScriptBindings();
bool loadPackage(const Common::Path &fileName, const Common::String &mountPosition)
Definition: packagemanager.h:71
bool fileExists(const Common::String &FileName)
Common::SeekableReadStream * getStream(const Common::String &fileName)
Common::String getCurrentDirectory()
Definition: packagemanager.h:178
Definition: archive.h:141
Out copy(In first, In last, Out dst)
Definition: algorithm.h:52
bool loadDirectoryAsPackage(const Common::Path &directoryName, const Common::String &mountPosition)
byte * getFile(const Common::String &fileName, uint *pFileSize=NULL)
bool changeDirectory(const Common::String &directory)
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
char * getXmlFile(const Common::String &fileName, uint *pFileSize=NULL)
Definition: packagemanager.h:152
Common::String getAbsolutePath(const Common::String &fileName)
void strcpy_s(char *dst, size_t size, const char *src)
int doSearch(Common::ArchiveMemberList &list, const Common::String &filter, const Common::String &path, uint typeFilter=FT_DIRECTORY|FT_FILE)
void setRunWithExtractedFiles(const Common::Path &directoryName)
Definition: packagemanager.h:110