Subversion Repositories spk

Rev

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

Rev 129 Rev 130
Line 194... Line 194...
194
};
194
};
195
 
195
 
196
 
196
 
197
Utils::String SPKEXPORT GetFileTypeString ( int type );
197
Utils::String SPKEXPORT GetFileTypeString ( int type );
198
FileType SPKEXPORT GetFileTypeFromString ( CyString type );
198
FileType SPKEXPORT GetFileTypeFromString ( CyString type );
199
CyString SPKEXPORT FormatErrorString ( int error, CyString rest );
199
Utils::String SPKEXPORT FormatErrorString (int error, const Utils::String &rest);
200
float	 SPKEXPORT GetLibraryVersion ();
200
float	 SPKEXPORT GetLibraryVersion ();
201
float	 SPKEXPORT GetFileFormatVersion ();
201
float	 SPKEXPORT GetFileFormatVersion ();
202
 
202
 
203
class CBaseFile;
203
class CBaseFile;
204
class SPKEXPORT C_File
204
class SPKEXPORT C_File
Line 215... Line 215...
215
	// varible setting functions
215
	// varible setting functions
216
	void SetFileType(FileType t) { m_iFileType = t; }
216
	void SetFileType(FileType t) { m_iFileType = t; }
217
	void setFileType(FileType t) { m_iFileType = t; }
217
	void setFileType(FileType t) { m_iFileType = t; }
218
	void SetFilename(CyString filename);
218
	void SetFilename(CyString filename);
219
	void setFilename(const Utils::String &filename);
219
	void setFilename(const Utils::String &filename);
220
	void SetName ( CyString name ) { m_sName = name; }
220
	void SetName(CyString name) { _sName = name.ToString(); }
-
 
221
	void setName(const Utils::String &name) { _sName = name; }
221
	void SetDir ( CyString dir ) { m_sDir = dir; }
222
	void SetDir ( CyString dir ) { m_sDir = dir; }
222
	void SetCreationTime ( time_t time ) { m_tTime = time; }
223
	void SetCreationTime ( time_t time ) { m_tTime = time; }
223
	void SetFileSize ( long size ) { m_lSize = size; }
224
	void SetFileSize ( long size ) { m_lSize = size; }
224
	void SetDataSize ( long size ) { m_lDataSize = size; }
225
	void SetDataSize ( long size ) { m_lDataSize = size; }
225
	void SetUncompressedDataSize ( long size ) { m_lUncomprDataSize = size; }
226
	void SetUncompressedDataSize ( long size ) { m_lUncomprDataSize = size; }
Line 236... Line 237...
236
	// get functions
237
	// get functions
237
	int GetUsed () { return m_iUsed; }
238
	int GetUsed () { return m_iUsed; }
238
	int GetLastError () { return m_iLastError; }
239
	int GetLastError () { return m_iLastError; }
239
	int GetFileType() { return m_iFileType; }
240
	int GetFileType() { return m_iFileType; }
240
	FileType fileType() { return m_iFileType; }
241
	FileType fileType() { return m_iFileType; }
241
	CyString GetFilename () { return m_sName; }
242
	CyString GetFilename() { return _sName; }
-
 
243
	const Utils::String &filename() const { return _sName; }
242
	CyString GetFullFilename() { return CyString(_sFullDir) + "/" + m_sName; }
244
	CyString GetFullFilename() { return CyString(_sFullDir) + "/" + CyString(_sName); }
243
	Utils::String fullFilename() { return _sFullDir + "/" + m_sName.ToString(); }
245
	Utils::String fullFilename() { return _sFullDir + "/" + _sName; }
244
	long GetSize () { return m_lSize; }
246
	long GetSize () { return m_lSize; }
245
	time_t GetCreationTime () { return m_tTime; }
247
	time_t GetCreationTime () { return m_tTime; }
246
	CyString GetName () { return m_sName; }
248
	CyString GetName() { return _sName; }
-
 
249
	const Utils::String &name() { return _sName; }
247
	CyString GetDir() { return m_sDir; }
250
	CyString GetDir() { return m_sDir; }
248
	CyString GetDataSizeString ();
251
	CyString GetDataSizeString ();
249
	CyString GetUncompressedSizeString ();
252
	CyString GetUncompressedSizeString ();
250
	CyString GetDirectory(CBaseFile *spkfile);
253
	CyString GetDirectory(CBaseFile *spkfile);
251
	Utils::String getDirectory(CBaseFile *spkfile) const;
254
	Utils::String getDirectory(CBaseFile *spkfile) const;
Line 260... Line 263...
260
	CyString GetOriginalName() { return CyString(_sOriginalName); }
263
	CyString GetOriginalName() { return CyString(_sOriginalName); }
261
	const Utils::String &originalName() { return _sOriginalName; }
264
	const Utils::String &originalName() { return _sOriginalName; }
262
	CyString GetInMod() { return m_sInMod; }
265
	CyString GetInMod() { return m_sInMod; }
263
	CyString GetSignature() { if ( !m_bUpdatedSignature ) UpdateSignature(); return m_sSignature; }
266
	CyString GetSignature() { if ( !m_bUpdatedSignature ) UpdateSignature(); return m_sSignature; }
264
	void UpdateSignature();
267
	void UpdateSignature();
-
 
268
	void ChangeBaseName(CyString b) { _sName = CyString(b + "." + this->GetFileExt()).ToString(); }
265
	void ChangeBaseName(CyString b) { m_sName = b + "." + this->GetFileExt(); }
269
	void changeBaseName(const Utils::String &b) { _sName = b + "." + this->fileExt(); }
266
	bool RenameScript(CyString baseName);
270
	bool RenameScript(CyString baseName);
267
	bool IsInMod() { return !m_sInMod.Empty(); }
271
	bool IsInMod() { return !m_sInMod.Empty(); }
268
 
272
 
269
	void FixOriginalName() { _sOriginalName = m_sName.ToString(); }
273
	void FixOriginalName() { _sOriginalName = _sName; }
270
	void SetOriginalName(const Utils::String &name) { _sOriginalName = name; }
274
	void SetOriginalName(const Utils::String &name) { _sOriginalName = name; }
271
 
275
 
272
	bool isFileInAddon() const;
276
	bool isFileInAddon() const;
273
	bool IsFakePatch () const;
277
	bool IsFakePatch () const;
274
	bool IsAutoTextFile();
278
	bool isAutoTextFile();
275
	int  GetTextFileID(CyString name = NullString);
279
	int  GetTextFileID(CyString name = NullString);
276
	bool IsCompressedToFile () { return m_bCompressedToFile; }
280
	bool IsCompressedToFile () { return m_bCompressedToFile; }
277
	bool CompareNew ( C_File *file );
281
	bool CompareNew ( C_File *file );
278
	CyString GetFileExt () { return m_sName.GetToken ( m_sName.NumToken('.'), '.' ); }
282
	CyString GetFileExt() { return _sName.token(".", -1); }
-
 
283
	Utils::String fileExt() const;
-
 
284
	bool CheckFileExt ( const CyString &ext ) { 
279
	bool CheckFileExt ( const CyString &ext ) { if ( GetFileExt().Compare(ext) ) return true; return false; }
285
		if ( GetFileExt().Compare(ext) ) return true; return false; 
-
 
286
	}
280
	CyString ChangeFileExt(CyString ext);
287
	CyString ChangeFileExt(CyString ext);
-
 
288
	const Utils::String &changeFileExt(const Utils::String &ext);
281
	bool CheckPackedExtension();
289
	bool CheckPackedExtension();
282
	bool shouldCheckBaseName() const;
290
	bool shouldCheckBaseName() const;
283
 
291
 
284
	int GetCompressionType () { return m_iDataCompression; }
292
	int GetCompressionType () { return m_iDataCompression; }
285
	long GetDataSize () { return m_lDataSize; }
293
	long GetDataSize () { return m_lDataSize; }
Line 368... Line 376...
368
 
376
 
369
	// private functions
377
	// private functions
370
	void Reset();
378
	void Reset();
371
	Utils::String _getFullFileToDir(const Utils::String &dir, bool includedir, CBaseFile *file) const;
379
	Utils::String _getFullFileToDir(const Utils::String &dir, bool includedir, CBaseFile *file) const;
372
 
380
 
373
	CyString  m_sName; // just the filename
381
	Utils::String  _sName; // just the filename
374
	CyString  m_sDir;  // the extra dir (only for extras)
382
	CyString  m_sDir;  // the extra dir (only for extras)
375
	CyString  m_sInMod; // in a mod files
383
	CyString  m_sInMod; // in a mod files
376
	CyString  m_sSignature;
384
	CyString  m_sSignature;
377
 
385
 
378
	// file pointer varibles
386
	// file pointer varibles