Subversion Repositories spk

Rev

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

Rev 131 Rev 134
Line 80... Line 80...
80
class SPKEXPORT CBaseFile : public SPK::Package::CCorePackage
80
class SPKEXPORT CBaseFile : public SPK::Package::CCorePackage
81
{
81
{
82
public:
82
public:
83
	static Utils::String ConvertGameToString(int game);
83
	static Utils::String ConvertGameToString(int game);
84
	static int GetGameFromString(const Utils::String &game);
84
	static int GetGameFromString(const Utils::String &game);
85
	static CyString ErrorString(int error, CyString errorStr = NullString);
85
	static Utils::String ErrorString(int error, const Utils::String &errorStr = Utils::String::Null());
86
 
86
 
87
	CBaseFile();
87
	CBaseFile();
88
	virtual ~CBaseFile();
88
	virtual ~CBaseFile();
89
 
89
 
90
	// Get basic Settings
90
	// Get basic Settings
Line 106... Line 106...
106
		return p;
106
		return p;
107
	}
107
	}
108
	CLinkList<C_File> *GetFileList() { return &m_lFiles; }
108
	CLinkList<C_File> *GetFileList() { return &m_lFiles; }
109
	C_File *GetIcon () { return m_pIconFile; }
109
	C_File *GetIcon () { return m_pIconFile; }
110
	CyString GetIconExt () { return m_sIconExt; }
110
	CyString GetIconExt () { return m_sIconExt; }
111
	CyString GetNameValidFile();
-
 
112
	Utils::String getNameValidFile() const;
111
	Utils::String getNameValidFile() const;
113
	int GetDataCompression () { return m_SHeader2.iDataCompression; }
112
	int GetDataCompression () { return m_SHeader2.iDataCompression; }
114
	float GetFileVersion () { return m_SHeader.fVersion; }
113
	float GetFileVersion () { return m_SHeader.fVersion; }
115
	long GetFullFileSize ();
114
	long GetFullFileSize ();
116
	CyString GetLanguageName ( int lang ) const;
115
	CyString GetLanguageName ( int lang ) const;
Line 136... Line 135...
136
	C_File *GetNextFile(C_File *prev) const;
135
	C_File *GetNextFile(C_File *prev) const;
137
	C_File *GetPrevFile(C_File *next) const;
136
	C_File *GetPrevFile(C_File *next) const;
138
 
137
 
139
	virtual Utils::String CreateValuesLine () const;
138
	virtual Utils::String CreateValuesLine () const;
140
 
139
 
141
	virtual bool LoadPackageData(const Utils::String &sFfirst, const Utils::String &sRest, const Utils::String &sMainGame, Utils::CStringList &otherGames, Utils::CStringList &gameAddons);
140
	virtual bool LoadPackageData(const Utils::String &sFfirst, const Utils::String &sRest, const Utils::String &sMainGame, Utils::CStringList &otherGames, Utils::CStringList &gameAddons, CProgressInfo *progress);
142
	virtual bool GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons, bool datafile = false);
141
	virtual bool GeneratePackagerScript(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons, bool datafile = false);
143
	virtual bool GeneratePackagerScriptFile(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons);
142
	virtual bool GeneratePackagerScriptFile(bool wildcard, Utils::CStringList *list, int game, const Utils::CStringList &gameAddons);
144
 
143
 
145
	void ConvertNormalMod(C_File *f, CyString to);
144
	void ConvertNormalMod(C_File *f, CyString to);
146
	void ConvertFakePatch(C_File *f);
145
	void ConvertFakePatch(C_File *f);
Line 155... Line 154...
155
	void SetFileCompression ( int c )       { m_SHeader2.iFileCompression = c; }
154
	void SetFileCompression ( int c )       { m_SHeader2.iFileCompression = c; }
156
	void SetValueCompression( int c )       { m_SHeader.iValueCompression = c; }
155
	void SetValueCompression( int c )       { m_SHeader.iValueCompression = c; }
157
	void SetIcon ( C_File *file, CyString ext ) { if ( m_pIconFile ) delete m_pIconFile; m_sIconExt = ext; m_pIconFile = file; _changed(); }
156
	void SetIcon ( C_File *file, CyString ext ) { if ( m_pIconFile ) delete m_pIconFile; m_sIconExt = ext; m_pIconFile = file; _changed(); }
158
	void SetFtpAddr			( CyString str ) { m_sFtpAddr = str; }
157
	void SetFtpAddr			( CyString str ) { m_sFtpAddr = str; }
159
 
158
 
160
	void AddFileScript(FileType filetype, bool shared, CyString rest, const Utils::String &sMainGame, Utils::CStringList &otherGames, Utils::CStringList &gameAddons);
159
	void AddFileScript(FileType filetype, bool shared, CyString rest, const Utils::String &sMainGame, Utils::CStringList &otherGames, Utils::CStringList &gameAddons, CProgressInfo *progress = NULL);
161
 
160
 
162
	bool IsMod();
161
	bool IsMod();
163
	bool IsFakePatch() const;
162
	bool IsFakePatch() const;
164
 
163
 
165
	// error handling
164
	// error handling
166
	void ClearError () { m_sLastError = ""; m_iLastError = SPKERR_NONE; }
165
	void ClearError () { _sLastError = ""; _iLastError = SPKERR_NONE; }
167
	int GetLastError () { return m_iLastError; }
166
	int lastError() const { return _iLastError; }
168
	CyString GetLastErrorString() { return m_sLastError; }
167
	const Utils::String lastErrorString() const { return _sLastError; }
169
 
168
 
170
	// file handling
169
	// file handling
171
	void AddFile ( C_File *file );
170
	void AddFile ( C_File *file );
172
	C_File *AddFile(CyString, CyString, int type, int game = 0);
171
	C_File *AddFile(CyString, CyString, int type, int game = 0);
173
	C_File *addFile(const Utils::String &file, const Utils::String &dir, FileType type, int game = 0);
172
	C_File *addFile(const Utils::String &file, const Utils::String &dir, FileType type, int game = 0);
Line 237... Line 236...
237
	void SetModifiedEnabled ( bool en ) { m_bModifiedEnabled = en; }
236
	void SetModifiedEnabled ( bool en ) { m_bModifiedEnabled = en; }
238
	void SetGlobalEnabled ( bool en ) { m_bGlobal = en; }
237
	void SetGlobalEnabled ( bool en ) { m_bGlobal = en; }
239
 
238
 
240
	int  GetLoadError() { return m_iLoadError; }
239
	int  GetLoadError() { return m_iLoadError; }
241
	void SetLoadError(int i) { m_iLoadError = i; }
240
	void SetLoadError(int i) { m_iLoadError = i; }
242
	CyString CreateUpdateFile(CyString dir);
241
	Utils::String createUpdateFile(const Utils::String &dir) const;
243
 
242
 
244
	// language functions
243
	// language functions
245
	void RemoveLanguageName ( int lang );
244
	void RemoveLanguageName ( int lang );
246
	void AddLanguageName ( int lang, const Utils::String &name );
245
	void AddLanguageName ( int lang, const Utils::String &name );
247
	void ClearNames ();
246
	void ClearNames ();
Line 336... Line 335...
336
	SSPKHeader m_SHeader;
335
	SSPKHeader m_SHeader;
337
	SSPKHeader2 m_SHeader2;
336
	SSPKHeader2 m_SHeader2;
338
 
337
 
339
	C_File *m_pIconFile;
338
	C_File *m_pIconFile;
340
	CyString m_sIconExt;
339
	CyString m_sIconExt;
341
	CyString m_sLastError;
340
	Utils::String _sLastError;
342
	int m_iLastError;
341
	int _iLastError;
343
 
342
 
344
	CLinkList<C_File>  m_lFiles;
343
	CLinkList<C_File>  m_lFiles;
345
	CLinkList<SNames> m_lNames;			//TODO: move to CorePackage
344
	CLinkList<SNames> m_lNames;			//TODO: move to CorePackage
346
	CyStringList m_lMirrors;			//TODO: move to CorePackage
345
	CyStringList m_lMirrors;			//TODO: move to CorePackage
347
	CyStringList m_lFakePatchBefore;
346
	CyStringList m_lFakePatchBefore;