Subversion Repositories spk

Rev

Rev 49 | Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 49 Rev 50
Line 100... Line 100...
100
 
100
 
101
	CBaseFile();
101
	CBaseFile();
102
	virtual ~CBaseFile();
102
	virtual ~CBaseFile();
103
 
103
 
104
	// Get basic Settings
104
	// Get basic Settings
105
	CyString GetName ()			{ return m_sName; }
-
 
106
	CyString GetVersion ()		{ return m_sVersion; }
-
 
107
	CyString GetAuthor ()		{ return m_sAuthor; }
-
 
108
	CyString GetCreationDate ()	{ return m_sCreationDate; }
-
 
109
	virtual CyString GetFullPackageName(int language, CyString byString) { return GetFullPackageName(language, true, byString); }
105
	virtual CyString GetFullPackageName(int language, CyString byString) { return GetFullPackageName(language, true, byString); }
110
	virtual CyString GetFullPackageName(int language, bool includeVersion = true, CyString byString = "by") 
106
	virtual CyString GetFullPackageName(int language, bool includeVersion = true, CyString byString = "by") 
111
	{ 
107
	{ 
112
		CyString p;
108
		CyString p;
113
		if ( language == -1 )
109
		if ( language == -1 )
114
			p = m_sName;
110
			p = this->name();
115
		else
111
		else
116
			p = GetLanguageName(language);
112
			p = GetLanguageName(language);
117
		if ( includeVersion )
113
		if ( includeVersion )
118
		{
114
		{
119
			p += " V";
115
			p += " V";
120
			p += m_sVersion;
116
			p += this->version();
121
		}
117
		}
122
		p += " ";
118
		p += " ";
123
		p += byString + " " + m_sAuthor;
119
		p += byString + " " + this->author();
124
		return p;
120
		return p;
125
	}
121
	}
126
	CLinkList<C_File> *GetFileList() { return &m_lFiles; }
122
	CLinkList<C_File> *GetFileList() { return &m_lFiles; }
127
	C_File *GetIcon () { return m_pIconFile; }
123
	C_File *GetIcon () { return m_pIconFile; }
128
	CyString GetIconExt () { return m_sIconExt; }
124
	CyString GetIconExt () { return m_sIconExt; }
Line 130... Line 126...
130
	int GetDataCompression () { return m_SHeader2.iDataCompression; }
126
	int GetDataCompression () { return m_SHeader2.iDataCompression; }
131
	float GetFileVersion () { return m_SHeader.fVersion; }
127
	float GetFileVersion () { return m_SHeader.fVersion; }
132
	long GetFullFileSize ();
128
	long GetFullFileSize ();
133
	CyString GetLanguageName ( int lang );
129
	CyString GetLanguageName ( int lang );
134
	virtual CyString GetFullPackageName(CyString format, int lang);
130
	virtual CyString GetFullPackageName(CyString format, int lang);
135
	CyString GetAutosaveName();
131
	Utils::String GetAutosaveName();
136
	void SetAutosaveName() { m_sFilename = GetAutosaveName(); }
132
	void SetAutosaveName() { this->setFilename(GetAutosaveName()); }
137
	SGameCompat *GetGameCompatability(int game);
133
	SGameCompat *GetGameCompatability(int game);
138
	bool RemoveGameCompatability(int game);
134
	bool RemoveGameCompatability(int game);
139
	void AddGameCompatability(int game, const Utils::String &version);
135
	void AddGameCompatability(int game, const Utils::String &version);
140
	bool CheckGameCompatability(int game);
136
	bool CheckGameCompatability(int game);
141
	bool CheckGameVersionCompatability(int game, CyString sVersion, int iVersion);
137
	bool CheckGameVersionCompatability(int game, CyString sVersion, int iVersion);
Line 163... Line 159...
163
	void ConvertAutoText(C_File *f);
159
	void ConvertAutoText(C_File *f);
164
	C_File *FindMatchingMod(C_File *f);
160
	C_File *FindMatchingMod(C_File *f);
165
	void RenameFile(C_File *f, CyString baseName);
161
	void RenameFile(C_File *f, CyString baseName);
166
 
162
 
167
	// set basic settings
163
	// set basic settings
168
	void SetName			( CyString str ) { m_sName = str.Remove ( '|' ); m_bChanged = true; }
-
 
169
	void SetVersion			( CyString str ) { m_sVersion = str; m_bChanged = true; }
-
 
170
	void SetAuthor			( CyString str ) { m_sAuthor = str.Remove ( '|' ); m_bChanged = true; }
-
 
171
	void SetCreationDate	( CyString str ) { m_sCreationDate = str; m_bChanged = true; }
-
 
172
	void AddWebMirror		( CyString str ) { m_lMirrors.PushBack(str, "", true); m_bChanged = true; }
164
	void AddWebMirror		( CyString str ) { m_lMirrors.PushBack(str, "", true); _changed(); }
173
	void RemoveWebMirror	( CyString str ) { m_lMirrors.Remove(str, true); m_bChanged = true; }
165
	void RemoveWebMirror	( CyString str ) { m_lMirrors.Remove(str, true); _changed(); }
174
	void SetDataCompression ( int c )       { m_SHeader2.iDataCompression = c; }
166
	void SetDataCompression ( int c )       { m_SHeader2.iDataCompression = c; }
175
	void SetFileCompression ( int c )       { m_SHeader2.iFileCompression = c; }
167
	void SetFileCompression ( int c )       { m_SHeader2.iFileCompression = c; }
176
	void SetValueCompression( int c )       { m_SHeader.iValueCompression = c; }
168
	void SetValueCompression( int c )       { m_SHeader.iValueCompression = c; }
177
	void SetIcon ( C_File *file, CyString ext ) { if ( m_pIconFile ) delete m_pIconFile; m_sIconExt = ext; m_pIconFile = file; m_bChanged = true; }
169
	void SetIcon ( C_File *file, CyString ext ) { if ( m_pIconFile ) delete m_pIconFile; m_sIconExt = ext; m_pIconFile = file; _changed(); }
178
	void SetFtpAddr			( CyString str ) { m_sFtpAddr = str; }
170
	void SetFtpAddr			( CyString str ) { m_sFtpAddr = str; }
179
 
171
 
180
	void AddFileScript(int filetype, bool shared, CyString rest);
172
	void AddFileScript(int filetype, bool shared, CyString rest);
181
	void SetFilename ( CyString str ) { m_sFilename = str; }
-
 
182
	CyString GetFilename() { return m_sFilename; }
-
 
183
	CyString GetExportFilename() { return m_sExportFilename; }
-
 
184
 
173
 
185
	bool IsMod();
174
	bool IsMod();
186
	bool IsFakePatch() const;
175
	bool IsFakePatch() const;
187
 
176
 
188
	// error handling
177
	// error handling
Line 279... Line 268...
279
	void AddFakePatchOrder(bool after, CyString scriptName, CyString author);
268
	void AddFakePatchOrder(bool after, CyString scriptName, CyString author);
280
	bool AnyFakePatchOrder() { if ( !m_lFakePatchBefore.Empty() || !m_lFakePatchAfter.Empty() ) return true; return false; }
269
	bool AnyFakePatchOrder() { if ( !m_lFakePatchBefore.Empty() || !m_lFakePatchAfter.Empty() ) return true; return false; }
281
	CyStringList &GetFakePatchBeforeOrder() { return m_lFakePatchBefore; }
270
	CyStringList &GetFakePatchBeforeOrder() { return m_lFakePatchBefore; }
282
	CyStringList &GetFakePatchAfterOrder() { return m_lFakePatchAfter; }
271
	CyStringList &GetFakePatchAfterOrder() { return m_lFakePatchAfter; }
283
 
272
 
284
	bool IsChanged() { return m_bChanged; }
273
//	bool IsChanged() { return m_bChanged; }
285
	void SetChanged(bool b) { m_bChanged = b; }
274
//	void SetChanged(bool b) { m_bChanged = b; }
286
 
275
 
287
	int  FindFirstGameInPackage();
276
	int  FindFirstGameInPackage();
288
	bool IsAnyGameInPackage();
277
	bool IsAnyGameInPackage();
289
	bool IsMultipleGamesInPackage();
278
	bool IsMultipleGamesInPackage();
290
	bool IsGameInPackage(int game);
279
	bool IsGameInPackage(int game);
Line 319... Line 308...
319
	virtual void ReadValues ( CyString values );
308
	virtual void ReadValues ( CyString values );
320
	virtual void ReadFiles ( CyString values );
309
	virtual void ReadFiles ( CyString values );
321
 
310
 
322
	void _install_adjustFakePatches(CPackages *pPackages);
311
	void _install_adjustFakePatches(CPackages *pPackages);
323
	void _install_renameText(CPackages *pPackages);
312
	void _install_renameText(CPackages *pPackages);
-
 
313
	bool _install_uncompress(C_File *fit, CProgressInfo *progress, CyStringList *errorStr, bool *uncomprToFile);
-
 
314
	bool _install_setEnabled(bool bEnable, C_File *fit);
-
 
315
	bool _install_checkVersion(C_File *pFile, const Utils::String &sDestination);
-
 
316
	Utils::String _install_adjustFilepointer(C_File *pFile, bool bEnabled, const Utils::String &sDestination);
-
 
317
	C_File *_install_checkFile(C_File *pFile, CyStringList *errorStr, bool *bDoFile, CLinkList<C_File> *pFileList);
-
 
318
	bool _install_checkFileEnable(C_File *pCheckFile, C_File *fit, const Utils::String &sDestination, bool bEnabled, CyStringList *errorStr);
324
 
319
 
325
	SSPKHeader m_SHeader;
320
	SSPKHeader m_SHeader;
326
	SSPKHeader2 m_SHeader2;
321
	SSPKHeader2 m_SHeader2;
327
 
-
 
328
	CyString m_sName;
-
 
329
	CyString m_sVersion;
-
 
330
	CyString m_sAuthor;
-
 
331
	CyString m_sCreationDate;
-
 
332
 
322
 
333
	C_File *m_pIconFile;
323
	C_File *m_pIconFile;
334
	CyString m_sIconExt;
324
	CyString m_sIconExt;
335
	CyString m_sLastError;
325
	CyString m_sLastError;
336
	int m_iLastError;
326
	int m_iLastError;
337
 
-
 
338
	CyString m_sFilename;
-
 
339
	CyString m_sExportFilename;
-
 
340
 
327
 
341
	CLinkList<C_File>  m_lFiles;
328
	CLinkList<C_File>  m_lFiles;
342
	CLinkList<SNames> m_lNames;			//TODO: move to CorePackage
329
	CLinkList<SNames> m_lNames;			//TODO: move to CorePackage
343
	CyStringList m_lMirrors;			//TODO: move to CorePackage
330
	CyStringList m_lMirrors;			//TODO: move to CorePackage
344
	CyStringList m_lFakePatchBefore;
331
	CyStringList m_lFakePatchBefore;
345
	CyStringList m_lFakePatchAfter;
332
	CyStringList m_lFakePatchAfter;
346
 
333
 
347
	//int m_iPluginType;
-
 
348
	CLinkList<SGameCompat> m_lGames;
334
	CLinkList<SGameCompat> m_lGames;
349
 
335
 
350
	bool m_bSigned;
336
	bool m_bSigned;
351
	bool m_bFullyLoaded;
337
	bool m_bFullyLoaded;
352
 
338
 
Line 358... Line 344...
358
	int m_iLoadError;
344
	int m_iLoadError;
359
 
345
 
360
	CBaseFile *m_pParent;
346
	CBaseFile *m_pParent;
361
 
347
 
362
	int m_iNum;
348
	int m_iNum;
363
	bool	m_bChanged;
-
 
364
 
349
 
365
	CLinkList<SNeededLibrary> m_lNeededLibrarys;
350
	CLinkList<SNeededLibrary> m_lNeededLibrarys;
366
 
351
 
367
	bool	m_bOverrideFiles;
352
	bool	m_bOverrideFiles;
368
	CyString	m_sFtpAddr;
353
	CyString	m_sFtpAddr;
Line 374... Line 359...
374
class SPKEXPORT CArchiveFile : public CBaseFile
359
class SPKEXPORT CArchiveFile : public CBaseFile
375
{
360
{
376
public:
361
public:
377
	CArchiveFile();
362
	CArchiveFile();
378
	virtual ~CArchiveFile();
363
	virtual ~CArchiveFile();
379
	virtual CyString GetFullPackageName(CyString format, int lang) { return CyString("Archive(") + m_sName + ")"; }
364
	virtual CyString GetFullPackageName(CyString format, int lang) { return CyString("Archive(") + this->name() + ")"; }
380
	virtual CyString GetFullPackageName(int language, CyString byString) { return CyString("Archive(") + m_sName + ")"; }
365
	virtual CyString GetFullPackageName(int language, CyString byString) { return CyString("Archive(") + this->name() + ")"; }
381
	virtual CyString GetFullPackageName(int language, bool includeVersion = true, CyString byString = "by") { return CyString("Archive(") + m_sName + ")"; }
366
	virtual CyString GetFullPackageName(int language, bool includeVersion = true, CyString byString = "by") { return CyString("Archive(") + this->name() + ")"; }
382
	virtual int GetType () { return TYPE_ARCHIVE; }
367
	virtual int GetType () { return TYPE_ARCHIVE; }
383
};
368
};
384
 
369
 
385
#endif //__BASEFILE_H__
370
#endif //__BASEFILE_H__
386
 
371