6 |
cycrow |
1 |
// BaseFile.h: interface for the CBaseFile class.
|
|
|
2 |
//
|
|
|
3 |
//////////////////////////////////////////////////////////////////////
|
|
|
4 |
|
|
|
5 |
#ifndef __BASEFILE_H__
|
|
|
6 |
#define __BASEFILE_H__
|
|
|
7 |
|
|
|
8 |
#if _MSC_VER > 1000
|
|
|
9 |
#pragma once
|
|
|
10 |
#endif // _MSC_VER > 1000
|
|
|
11 |
|
|
|
12 |
#include "lists.h"
|
|
|
13 |
#include "File.h"
|
8 |
cycrow |
14 |
#include "Utils/String.h"
|
109 |
cycrow |
15 |
#include "archive/zip.h"
|
6 |
cycrow |
16 |
|
46 |
cycrow |
17 |
#include "Package/CorePackage.h"
|
|
|
18 |
|
6 |
cycrow |
19 |
#define GAME_ALL 0
|
|
|
20 |
#define GAME_X2 1
|
|
|
21 |
#define GAME_X3 2
|
|
|
22 |
#define GAME_X3TC 3
|
|
|
23 |
#define GAME_X3AP 4
|
126 |
cycrow |
24 |
#define GAME_X3FL 5
|
127 |
cycrow |
25 |
#define GAME_MAX (GAME_X3FL)
|
|
|
26 |
#define GAME_ALLNEW (1 << 31)
|
6 |
cycrow |
27 |
|
209 |
cycrow |
28 |
#define FILEVERSION 4.40f
|
20 |
cycrow |
29 |
|
6 |
cycrow |
30 |
#define WRITECHUNK 50000
|
|
|
31 |
|
|
|
32 |
class CPackages;
|
126 |
cycrow |
33 |
class CGameExe;
|
6 |
cycrow |
34 |
|
88 |
cycrow |
35 |
namespace SPK {
|
|
|
36 |
class CTextDB;
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
using namespace SPK;
|
|
|
40 |
|
6 |
cycrow |
41 |
enum {
|
|
|
42 |
READFLAG_NONE = 0,
|
|
|
43 |
READFLAG_NOUNCOMPRESS = 1
|
|
|
44 |
};
|
|
|
45 |
|
|
|
46 |
enum {SPKFILE_INVALID, SPKFILE_SINGLE, SPKFILE_MULTI, SPKFILE_SINGLESHIP, SPKFILE_OLD, SPKFILE_BASE};
|
|
|
47 |
enum {SPKREAD_ALL, SPKREAD_NODATA, SPKREAD_VALUES, SPKREAD_HEADER};
|
|
|
48 |
enum {DELETESTATE_NONE, DELETESTATE_WAITING, DELETESTATE_DONE};
|
|
|
49 |
enum {SPKINSTALL_CREATEDIRECTORY, SPKINSTALL_CREATEDIRECTORY_FAIL, SPKINSTALL_WRITEFILE, SPKINSTALL_WRITEFILE_FAIL, SPKINSTALL_DELETEFILE, SPKINSTALL_DELETEFILE_FAIL,
|
|
|
50 |
SPKINSTALL_SKIPFILE, SPKINSTALL_REMOVEDIR, SPKINSTALL_ENABLEFILE, SPKINSTALL_DISABLEFILE, SPKINSTALL_ENABLEFILE_FAIL, SPKINSTALL_DISABLEFILE_FAIL,
|
|
|
51 |
SPKINSTALL_UNINSTALL_MOVE, SPKINSTALL_UNINSTALL_COPY, SPKINSTALL_UNINSTALL_MOVE_FAIL, SPKINSTALL_UNINSTALL_COPY_FAIL, SPKINSTALL_UNINSTALL_REMOVE, SPKINSTALL_UNINSTALL_REMOVE_FAIL,
|
|
|
52 |
SPKINSTALL_ORIGINAL_BACKUP, SPKINSTALL_ORIGINAL_RESTORE, SPKINSTALL_ORIGINAL_BACKUP_FAIL, SPKINSTALL_ORIGINAL_RESTORE_FAIL, SPKINSTALL_FAKEPATCH, SPKINSTALL_FAKEPATCH_FAIL,
|
|
|
53 |
SPKINSTALL_MISSINGFILE, SPKINSTALL_SHARED, SPKINSTALL_SHARED_FAIL, SPKINSTALL_ORPHANED, SPKINSTALL_ORPHANED_FAIL, SPKINSTALL_UNCOMPRESS_FAIL, SPKINSTALL_AUTOTEXT, SPKINSTALL_AUTOTEXT_FAIL
|
|
|
54 |
};
|
|
|
55 |
|
|
|
56 |
enum {PACKAGETYPE_NORMAL, PACKAGETYPE_LIBRARY, PACKAGETYPE_CUSTOMSTART, PACKAGETYPE_PATCH, PACKAGETYPE_UPDATE, PACKAGETYPE_MOD, PACKAGETYPE_SHIP, PACKAGETYPE_FAKEPATCH};
|
|
|
57 |
|
170 |
cycrow |
58 |
enum BaseFileType {TYPE_BASE, TYPE_SPK, TYPE_XSP, TYPE_ARCHIVE};
|
6 |
cycrow |
59 |
|
|
|
60 |
// spk header struct
|
|
|
61 |
tstruct SSPKHeader {
|
|
|
62 |
SSPKHeader () { fVersion = 0; iValueCompression = lValueCompressSize = 0; }
|
|
|
63 |
float fVersion;
|
|
|
64 |
int iValueCompression;
|
|
|
65 |
unsigned long lValueCompressSize;
|
|
|
66 |
} SSPKHeader;
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
tstruct SSPKHeader2 {
|
170 |
cycrow |
70 |
SSPKHeader2 () : iFileCompression(0), iDataCompression(0), iNumFiles(0), lSize(0), lFullSize(0) { }
|
6 |
cycrow |
71 |
int iNumFiles;
|
|
|
72 |
long lSize;
|
|
|
73 |
long lFullSize;
|
|
|
74 |
int iFileCompression;
|
|
|
75 |
int iDataCompression;
|
|
|
76 |
} SSPKHeader2;
|
|
|
77 |
|
46 |
cycrow |
78 |
class SPKEXPORT CBaseFile : public SPK::Package::CCorePackage
|
6 |
cycrow |
79 |
{
|
|
|
80 |
public:
|
175 |
cycrow |
81 |
// static functions
|
197 |
cycrow |
82 |
static Utils::WString ConvertGameToString(int game);
|
210 |
cycrow |
83 |
static int GetGameFromString(const Utils::WString &game);
|
197 |
cycrow |
84 |
static Utils::WString ErrorString(int error, const Utils::WString &errorStr = Utils::WString::Null());
|
175 |
cycrow |
85 |
static Utils::String GetEndOfLine(FILE* id, int* line = NULL, bool upper = true);
|
197 |
cycrow |
86 |
static int CheckFile(const Utils::WString &filename, float* version = NULL);
|
6 |
cycrow |
87 |
|
175 |
cycrow |
88 |
|
6 |
cycrow |
89 |
CBaseFile();
|
|
|
90 |
virtual ~CBaseFile();
|
|
|
91 |
|
170 |
cycrow |
92 |
// Virtual Functions
|
203 |
cycrow |
93 |
virtual Utils::WString getFullPackageName(int language, const Utils::WString &byString) const;
|
|
|
94 |
virtual Utils::WString getFullPackageName(int language, bool includeVersion = true, const Utils::WString &byString = L"by") const;
|
|
|
95 |
virtual Utils::WString getFullPackageName(const Utils::WString &format, int lang) const;
|
170 |
cycrow |
96 |
|
207 |
cycrow |
97 |
virtual Utils::WString createValuesLine() const;
|
170 |
cycrow |
98 |
|
197 |
cycrow |
99 |
virtual bool loadPackageData(const Utils::WString& sFirst, const Utils::WString& sRest, const Utils::WString& sMainGame, Utils::WStringList& otherGames, Utils::WStringList& gameAddons, CProgressInfo* progress);
|
210 |
cycrow |
100 |
virtual bool GeneratePackagerScript(bool wildcard, Utils::WStringList* list, int game, const Utils::WStringList& gameAddons, bool datafile = false);
|
|
|
101 |
virtual bool GeneratePackagerScriptFile(bool wildcard, Utils::WStringList* list, int game, const Utils::WStringList& gameAddons);
|
170 |
cycrow |
102 |
|
|
|
103 |
// Getters
|
197 |
cycrow |
104 |
Utils::WString getNameValidFile() const;
|
170 |
cycrow |
105 |
const CLinkList<C_File> &fileList() const;
|
|
|
106 |
CLinkList<C_File>& fileList(FileType type, CLinkList<C_File> &list) const;
|
|
|
107 |
CLinkList<C_File>& fileList(FileType type);
|
6 |
cycrow |
108 |
CLinkList<C_File> *GetFileList() { return &m_lFiles; }
|
170 |
cycrow |
109 |
C_File *icon() const { return m_pIconFile; }
|
197 |
cycrow |
110 |
const Utils::WString &iconExt() const { return _sIconExt; }
|
170 |
cycrow |
111 |
int dataCompression () const { return m_SHeader2.iDataCompression; }
|
|
|
112 |
float fileVersion () const { return m_SHeader.fVersion; }
|
|
|
113 |
size_t fileSize() const;
|
203 |
cycrow |
114 |
Utils::WString getAutosaveName() const;
|
170 |
cycrow |
115 |
bool IsMod();
|
|
|
116 |
bool IsFakePatch() const;
|
233 |
cycrow |
117 |
const Utils::WStringList& getGlobals() const { return _lGlobals; }
|
170 |
cycrow |
118 |
|
|
|
119 |
// Setters
|
203 |
cycrow |
120 |
void setAutosaveName() { this->setFilename(getAutosaveName()); }
|
170 |
cycrow |
121 |
void SetDataCompression(int c) { m_SHeader2.iDataCompression = c; }
|
|
|
122 |
void SetFileCompression(int c) { m_SHeader2.iFileCompression = c; }
|
|
|
123 |
void SetValueCompression(int c) { m_SHeader.iValueCompression = c; }
|
210 |
cycrow |
124 |
void setIcon(C_File* file, const Utils::WString& ext) { if (m_pIconFile) delete m_pIconFile; _sIconExt = ext.c_str(); m_pIconFile = file; _changed(); }
|
|
|
125 |
void setFtpAddr(const Utils::WString& str) { _sFtpAddr = str; }
|
233 |
cycrow |
126 |
|
|
|
127 |
void addGlobal(const Utils::WString& global, const Utils::WString& setting);
|
|
|
128 |
void removeGlobal(const Utils::WString& global);
|
170 |
cycrow |
129 |
|
237 |
cycrow |
130 |
// clearers
|
|
|
131 |
void clearGlobals();
|
|
|
132 |
|
170 |
cycrow |
133 |
// Game Compatability
|
|
|
134 |
SGameCompat* GetGameCompatability(int game);
|
6 |
cycrow |
135 |
bool RemoveGameCompatability(int game);
|
210 |
cycrow |
136 |
void AddGameCompatability(int game, const Utils::WString &version);
|
6 |
cycrow |
137 |
bool CheckGameCompatability(int game);
|
197 |
cycrow |
138 |
bool checkGameVersionCompatability(int game, const Utils::WString &sVersion, int iVersion) const;
|
6 |
cycrow |
139 |
bool AnyGameCompatability() { return !m_lGames.empty(); }
|
|
|
140 |
|
170 |
cycrow |
141 |
// Files
|
13 |
cycrow |
142 |
C_File *GetFirstFile(int type) const;
|
|
|
143 |
C_File *GetNextFile(C_File *prev) const;
|
|
|
144 |
C_File *GetPrevFile(C_File *next) const;
|
170 |
cycrow |
145 |
C_File* findMatchingMod(C_File* f) const;
|
6 |
cycrow |
146 |
|
210 |
cycrow |
147 |
void convertNormalMod(C_File *f, const Utils::WString &to) const;
|
170 |
cycrow |
148 |
void convertFakePatch(C_File *f) const;
|
|
|
149 |
void convertAutoText(C_File *f) const;
|
210 |
cycrow |
150 |
void renameFile(C_File *f, const Utils::WString &baseName) const;
|
6 |
cycrow |
151 |
|
170 |
cycrow |
152 |
size_t countFiles(FileType filetype) const;
|
|
|
153 |
C_File* findFileAt(FileType filetype, size_t pos) const;
|
197 |
cycrow |
154 |
C_File* findFile(const Utils::WString& file, FileType type, const Utils::WString& dir = Utils::WString::Null(), int game = 0) const;
|
6 |
cycrow |
155 |
|
197 |
cycrow |
156 |
void addFileScript(FileType filetype, bool shared, bool packed, const Utils::WString &rest, const Utils::WString &sMainGame, Utils::WStringList &otherGames, Utils::WStringList &gameAddons, CProgressInfo *progress = NULL);
|
170 |
cycrow |
157 |
void AddFile(C_File* file);
|
197 |
cycrow |
158 |
C_File* addFile(const Utils::WString& file, const Utils::WString& dir, FileType type, int game = 0, bool packed = false);
|
|
|
159 |
C_File* appendFile(const Utils::WString& file, int type, int game, bool packed, const Utils::WString& dir = Utils::WString::Null(), CProgressInfo* progress = NULL);
|
210 |
cycrow |
160 |
bool addFileNow(const Utils::WString&, const Utils::WString&, FileType type, CProgressInfo* progress = NULL);
|
172 |
cycrow |
161 |
bool removeFile(size_t pos);
|
|
|
162 |
bool removeFile(C_File* files);
|
210 |
cycrow |
163 |
bool removeFile(const Utils::WString &file, FileType type, const Utils::WString &dir = Utils::WString::Null(), int game = 0);
|
170 |
cycrow |
164 |
void removeAllFiles(FileType type, int game);
|
6 |
cycrow |
165 |
|
211 |
cycrow |
166 |
Utils::WString createFilesLine(SSPKHeader2 *header, CProgressInfo* = NULL) const;
|
6 |
cycrow |
167 |
|
|
|
168 |
// error handling
|
213 |
cycrow |
169 |
void ClearError () { _sLastError = L""; _iLastError = SPKERR_NONE; }
|
134 |
cycrow |
170 |
int lastError() const { return _iLastError; }
|
197 |
cycrow |
171 |
const Utils::WString lastErrorString() const { return _sLastError; }
|
6 |
cycrow |
172 |
|
175 |
cycrow |
173 |
virtual bool writeHeader(CFileIO &file, int iHeader, int iLength) const;
|
|
|
174 |
virtual bool writeData(CFileIO &file, CProgressInfo * = NULL) const;
|
210 |
cycrow |
175 |
virtual bool writeFile(const Utils::WString &filename, CProgressInfo* = NULL) const;
|
|
|
176 |
virtual bool readFile(const Utils::WString &filename, int readType = SPKREAD_ALL, CProgressInfo *progress = NULL);
|
58 |
cycrow |
177 |
bool readFile(CFileIO &File, int readtype, CProgressInfo *progress);
|
6 |
cycrow |
178 |
|
210 |
cycrow |
179 |
virtual bool extractFile(int file, const Utils::WString &dir, bool includedir = true, CProgressInfo *progress = NULL);
|
|
|
180 |
virtual bool extractFile(C_File *file, const Utils::WString &dir, bool includedir = true, CProgressInfo *progress = NULL);
|
|
|
181 |
virtual bool extractFile(int filenum, const Utils::WString &dir, unsigned int game, const Utils::WStringList &gameAddons, bool includedir = true, CProgressInfo *progress = NULL);
|
|
|
182 |
virtual bool extractFile(C_File *file, const Utils::WString &dir, unsigned int game, const Utils::WStringList &gameAddons, bool includedir = true, CProgressInfo *progress = NULL);
|
|
|
183 |
virtual bool extractAll(const Utils::WString &dir, int game, const Utils::WStringList &gameAddons, bool includedir = true, CProgressInfo *progress = NULL);
|
6 |
cycrow |
184 |
|
210 |
cycrow |
185 |
virtual bool saveToArchive(const Utils::WString &filename, int game, const CGameExe *exes, CProgressInfo *progress = NULL);
|
109 |
cycrow |
186 |
virtual void addGeneratedFiles(HZIP &hz) {};
|
|
|
187 |
|
6 |
cycrow |
188 |
void ClearFileData();
|
|
|
189 |
|
|
|
190 |
// reading files
|
|
|
191 |
void ReadAllFilesToMemory ();
|
|
|
192 |
void ReadIconFileToMemory ();
|
|
|
193 |
bool ReadFileToMemory(C_File *f);
|
|
|
194 |
|
|
|
195 |
// compression
|
|
|
196 |
void RecompressAllFiles ( int compresstype, CProgressInfo *progress );
|
47 |
cycrow |
197 |
void CompressAllFiles ( int compresstype, CProgressInfo *progress = NULL, CProgressInfo *overallProgress = NULL, int level = DEFAULT_COMPRESSION_LEVEL );
|
6 |
cycrow |
198 |
bool UncompressAllFiles ( CProgressInfo * = NULL );
|
|
|
199 |
|
|
|
200 |
bool IsFileAdded(C_File *f) { return m_lFiles.FindData(f); }
|
|
|
201 |
|
|
|
202 |
// installing
|
|
|
203 |
void SwitchFilePointer(C_File *oldFile, C_File *newFile);
|
197 |
cycrow |
204 |
bool installFiles(const Utils::WString &destdir, CProgressInfo *progress, CLinkList<C_File> *spklist, Utils::WStringList *errorStr, bool enabled = true, CPackages *packages = NULL );
|
6 |
cycrow |
205 |
virtual bool IsPatch () { return false; }
|
|
|
206 |
|
|
|
207 |
// installer functions
|
|
|
208 |
bool IsProfileEnabled () { return m_bProfile; }
|
|
|
209 |
bool IsEnabled () { return m_bEnable; }
|
|
|
210 |
bool IsModifiedEnabled () { return m_bModifiedEnabled; }
|
|
|
211 |
bool IsGlobalEnabled () { return m_bGlobal; }
|
|
|
212 |
|
|
|
213 |
void SetProfileEnabled ( bool en ) { m_bProfile = en; }
|
|
|
214 |
void SetEnabled ( bool en ) { m_bEnable = en; }
|
|
|
215 |
void SetModifiedEnabled ( bool en ) { m_bModifiedEnabled = en; }
|
|
|
216 |
void SetGlobalEnabled ( bool en ) { m_bGlobal = en; }
|
248 |
cycrow |
217 |
virtual void completeFile() { }
|
6 |
cycrow |
218 |
|
|
|
219 |
int GetLoadError() { return m_iLoadError; }
|
|
|
220 |
void SetLoadError(int i) { m_iLoadError = i; }
|
196 |
cycrow |
221 |
Utils::WString createUpdateFile(const Utils::WString &dir) const;
|
6 |
cycrow |
222 |
|
207 |
cycrow |
223 |
virtual bool parseValueLine(const Utils::WString &line);
|
6 |
cycrow |
224 |
|
|
|
225 |
CLinkList<SGameCompat> *GetGameCompatabilityList() { return &m_lGames; }
|
|
|
226 |
|
197 |
cycrow |
227 |
Utils::WString fileSizeString() const;
|
6 |
cycrow |
228 |
|
|
|
229 |
CLinkList<SNeededLibrary> *GetNeededLibraries() { return &m_lNeededLibrarys; }
|
204 |
cycrow |
230 |
void addNeededLibrary(const Utils::WString &scriptName, const Utils::WString &author, const Utils::WString &minVersion);
|
203 |
cycrow |
231 |
bool isPackageNeeded(const Utils::WString &scriptName, const Utils::WString &author);
|
|
|
232 |
SNeededLibrary *findPackageNeeded(const Utils::WString &scriptName, const Utils::WString &author);
|
|
|
233 |
void removePackageNeeded(const Utils::WString &scriptName, const Utils::WString &author);
|
6 |
cycrow |
234 |
void ClearNeededPackages();
|
|
|
235 |
bool AnyDependacies() { return (m_lNeededLibrarys.size()) ? true: false; }
|
|
|
236 |
bool AutoGenerateUpdateFile() { return m_bAutoGenerateUpdateFile; }
|
207 |
cycrow |
237 |
void removeFakePatchOrder(bool after, const Utils::WString &scriptName, const Utils::WString &author);
|
|
|
238 |
void removeFakePatchOrder(const Utils::WString &scriptName, const Utils::WString &author);
|
|
|
239 |
void addFakePatchOrder(bool after, const Utils::WString &scriptName, const Utils::WString &author);
|
160 |
cycrow |
240 |
bool anyFakePatchOrder() const { if ( !_lFakePatchBefore.empty() || !_lFakePatchAfter.empty() ) return true; return false; }
|
207 |
cycrow |
241 |
const Utils::WStringList &getFakePatchBeforeOrder() const { return _lFakePatchBefore; }
|
|
|
242 |
const Utils::WStringList &getFakePatchAfterOrder() const { return _lFakePatchAfter; }
|
88 |
cycrow |
243 |
void updateTextDB() { this->_resetTextDB(); }
|
6 |
cycrow |
244 |
|
197 |
cycrow |
245 |
virtual bool readWares(int iLang, CLinkList<SWareEntry> &list, const Utils::WString &empWares);
|
89 |
cycrow |
246 |
virtual bool readCommands(int iLang, CLinkList<SCommandSlot> &list);
|
|
|
247 |
virtual bool readWingCommands(int iLang, CLinkList<SCommandSlot> &list);
|
88 |
cycrow |
248 |
|
6 |
cycrow |
249 |
int FindFirstGameInPackage();
|
|
|
250 |
bool IsAnyGameInPackage();
|
|
|
251 |
bool IsMultipleGamesInPackage();
|
|
|
252 |
bool IsGameInPackage(int game);
|
|
|
253 |
|
170 |
cycrow |
254 |
virtual BaseFileType type () const { return BaseFileType::TYPE_BASE; }
|
|
|
255 |
virtual int GetType() { return type(); }
|
6 |
cycrow |
256 |
bool AnyFileType ( int type );
|
|
|
257 |
CBaseFile *GetParent () { return m_pParent; }
|
|
|
258 |
void SetParent ( CBaseFile *file ) { m_pParent = file; }
|
207 |
cycrow |
259 |
int parseLanguage(const Utils::WString &lang) const;
|
6 |
cycrow |
260 |
|
175 |
cycrow |
261 |
virtual bool computeSigned(bool updateFiles) const;
|
|
|
262 |
bool updateSigned (bool updateFiles);
|
6 |
cycrow |
263 |
int GetNum() { return m_iNum; }
|
|
|
264 |
void SetNum(int i) { m_iNum = i; }
|
|
|
265 |
|
|
|
266 |
bool IsFullyLoaded() { return m_bFullyLoaded; }
|
|
|
267 |
virtual bool IsSigned () { return m_bSigned;}
|
|
|
268 |
void SetOverrideFiles(bool b) { m_bOverrideFiles = b; }
|
|
|
269 |
bool IsUpdateChecked () { return m_bUpdate; }
|
|
|
270 |
void SetUpdateChecked ( bool en ) { m_bUpdate = en; }
|
|
|
271 |
|
197 |
cycrow |
272 |
unsigned char *createData(size_t *size, CProgressInfo *progress = NULL);
|
6 |
cycrow |
273 |
|
|
|
274 |
protected:
|
|
|
275 |
virtual void Delete ();
|
|
|
276 |
virtual void SetDefaults ();
|
|
|
277 |
|
|
|
278 |
// reading of files
|
210 |
cycrow |
279 |
virtual bool _checkHeader(const Utils::WString &header) const;
|
|
|
280 |
bool _parseHeader(const Utils::WString &header);
|
|
|
281 |
bool _parseFileHeader(const Utils::WString& header);
|
|
|
282 |
bool _parseFilesLine(const Utils::WString& line);
|
207 |
cycrow |
283 |
void _readValues(const Utils::WString& values);
|
211 |
cycrow |
284 |
void _readFiles(const Utils::WString& values);
|
6 |
cycrow |
285 |
|
14 |
cycrow |
286 |
void _install_adjustFakePatches(CPackages *pPackages);
|
43 |
cycrow |
287 |
void _install_renameText(CPackages *pPackages);
|
197 |
cycrow |
288 |
bool _install_uncompress(C_File *fit, CProgressInfo *progress, Utils::WStringList *errorStr, bool *uncomprToFile);
|
50 |
cycrow |
289 |
bool _install_setEnabled(bool bEnable, C_File *fit);
|
197 |
cycrow |
290 |
bool _install_checkVersion(C_File *pFile, const Utils::WString &sDestination);
|
210 |
cycrow |
291 |
Utils::WString _install_adjustFilepointer(C_File *pFile, bool bEnabled, const Utils::WString &sDestination);
|
197 |
cycrow |
292 |
C_File *_install_checkFile(C_File *pFile, Utils::WStringList *errorStr, bool *bDoFile, CLinkList<C_File> *pFileList);
|
|
|
293 |
bool _install_checkFileEnable(C_File *pCheckFile, C_File *fit, const Utils::WString &sDestination, bool bEnabled, Utils::WStringList *errorStr);
|
|
|
294 |
bool _install_createDirectory(CDirIO &Dir, const Utils::WString &sTo, C_File *pFile, Utils::WStringList *errorStr);
|
|
|
295 |
void _install_writeFile(C_File *pFile, const Utils::WString &sDestination, Utils::WStringList *errorStr);
|
14 |
cycrow |
296 |
|
109 |
cycrow |
297 |
int _read_FileHeader(CFileIO &File, int iReadType, int iMaxProgress, int iDoneLen, CProgressInfo *pProgress);
|
|
|
298 |
int _read_Header(CFileIO &File, int iReadType, int iMaxProgress, CProgressInfo *pProgress);
|
58 |
cycrow |
299 |
CFileIO *_startRead();
|
51 |
cycrow |
300 |
|
88 |
cycrow |
301 |
void _addFile(C_File *file, bool dontChange = false);
|
|
|
302 |
void _updateTextDB(C_File *file);
|
|
|
303 |
void _resetTextDB();
|
197 |
cycrow |
304 |
void _addWaresToList(int iLang, CLinkList<SWareEntry> &list, const Utils::WString &wares, enum WareTypes eType);
|
89 |
cycrow |
305 |
bool _readCommands(int iLang, int iStartID, CLinkList<SCommandSlot> &list);
|
196 |
cycrow |
306 |
Utils::WString _replaceFilename(const Utils::WString &fname);
|
88 |
cycrow |
307 |
|
|
|
308 |
protected:
|
6 |
cycrow |
309 |
SSPKHeader m_SHeader;
|
|
|
310 |
SSPKHeader2 m_SHeader2;
|
|
|
311 |
|
|
|
312 |
C_File *m_pIconFile;
|
197 |
cycrow |
313 |
Utils::WString _sIconExt;
|
|
|
314 |
Utils::WString _sLastError;
|
134 |
cycrow |
315 |
int _iLastError;
|
6 |
cycrow |
316 |
|
|
|
317 |
CLinkList<C_File> m_lFiles;
|
170 |
cycrow |
318 |
CLinkList<C_File> m_lTempFiles;
|
207 |
cycrow |
319 |
Utils::WStringList _lFakePatchBefore;
|
|
|
320 |
Utils::WStringList _lFakePatchAfter;
|
6 |
cycrow |
321 |
|
88 |
cycrow |
322 |
CTextDB *_pTextDB;
|
|
|
323 |
|
6 |
cycrow |
324 |
CLinkList<SGameCompat> m_lGames;
|
233 |
cycrow |
325 |
Utils::WStringList _lGlobals;
|
6 |
cycrow |
326 |
|
|
|
327 |
bool m_bSigned;
|
|
|
328 |
bool m_bFullyLoaded;
|
|
|
329 |
|
|
|
330 |
//installer varibles
|
|
|
331 |
bool m_bEnable;
|
|
|
332 |
bool m_bModifiedEnabled;
|
|
|
333 |
bool m_bGlobal;
|
|
|
334 |
bool m_bProfile;
|
|
|
335 |
int m_iLoadError;
|
|
|
336 |
|
|
|
337 |
CBaseFile *m_pParent;
|
|
|
338 |
|
|
|
339 |
int m_iNum;
|
|
|
340 |
|
|
|
341 |
CLinkList<SNeededLibrary> m_lNeededLibrarys;
|
|
|
342 |
|
130 |
cycrow |
343 |
bool _bCombineFiles;
|
6 |
cycrow |
344 |
bool m_bOverrideFiles;
|
210 |
cycrow |
345 |
Utils::WString _sFtpAddr;
|
170 |
cycrow |
346 |
bool m_bAutoGenerateUpdateFile;
|
|
|
347 |
bool m_bUpdate;
|
6 |
cycrow |
348 |
};
|
|
|
349 |
|
|
|
350 |
|
|
|
351 |
class SPKEXPORT CArchiveFile : public CBaseFile
|
|
|
352 |
{
|
|
|
353 |
public:
|
|
|
354 |
CArchiveFile();
|
|
|
355 |
virtual ~CArchiveFile();
|
203 |
cycrow |
356 |
virtual Utils::WString getFullPackageName(const Utils::WString& format, int lang) const override { return L"Archive(" + name() + L")"; }
|
|
|
357 |
virtual Utils::WString getFullPackageName(int language, const Utils::WString& byString) const override { return L"Archive(" + name() + L")"; }
|
|
|
358 |
virtual Utils::WString getFullPackageName(int language, bool includeVersion = true, const Utils::WString& byString = L"by") const override { return L"Archive(" + name() + L")"; }
|
170 |
cycrow |
359 |
|
|
|
360 |
virtual BaseFileType type() const override { return BaseFileType::TYPE_ARCHIVE; }
|
6 |
cycrow |
361 |
};
|
|
|
362 |
|
|
|
363 |
#endif //__BASEFILE_H__
|
|
|
364 |
|