Line 213... |
Line 213... |
213 |
void IncUsed () { ++m_iUsed; }
|
213 |
void IncUsed () { ++m_iUsed; }
|
214 |
void DeleteData ();
|
214 |
void DeleteData ();
|
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 SetName ( CyString name ) { m_sName = name; }
|
220 |
void SetName ( CyString name ) { m_sName = name; }
|
220 |
void SetDir ( CyString dir ) { m_sDir = dir; }
|
221 |
void SetDir ( CyString dir ) { m_sDir = dir; }
|
221 |
void SetCreationTime ( time_t time ) { m_tTime = time; }
|
222 |
void SetCreationTime ( time_t time ) { m_tTime = time; }
|
222 |
void SetFileSize ( long size ) { m_lSize = size; }
|
223 |
void SetFileSize ( long size ) { m_lSize = size; }
|
223 |
void SetDataSize ( long size ) { m_lDataSize = size; }
|
224 |
void SetDataSize ( long size ) { m_lDataSize = size; }
|
224 |
void SetUncompressedDataSize ( long size ) { m_lUncomprDataSize = size; }
|
225 |
void SetUncompressedDataSize ( long size ) { m_lUncomprDataSize = size; }
|
225 |
void SetDataCompression ( int c ) { m_iDataCompression = c; }
|
226 |
void SetDataCompression ( int c ) { m_iDataCompression = c; }
|
226 |
void SetShared ( bool b ) { m_bShared = b; }
|
227 |
void SetShared ( bool b ) { m_bShared = b; }
|
227 |
void SetSigned ( bool b ) { m_bSigned = b; }
|
228 |
void SetSigned ( bool b ) { m_bSigned = b; }
|
228 |
void SetFullDir ( CyString dir ) { m_sFullDir = dir; }
|
229 |
void SetFullDir(CyString dir) { _sFullDir = dir.ToString(); }
|
- |
|
230 |
void setFullDir(const Utils::String &dir) { _sFullDir = dir; }
|
229 |
void SetInMod ( CyString s ) { m_sInMod = s; }
|
231 |
void SetInMod ( CyString s ) { m_sInMod = s; }
|
230 |
void SetCompressedToFile ( bool b ) { m_bCompressedToFile = b; }
|
232 |
void SetCompressedToFile ( bool b ) { m_bCompressedToFile = b; }
|
231 |
void SetData(const unsigned char *data, size_t size) { m_sData = (unsigned char *)data, m_lDataSize = (long)size; }
|
233 |
void SetData(const unsigned char *data, size_t size) { m_sData = (unsigned char *)data, m_lDataSize = (long)size; }
|
232 |
void copyData(const unsigned char *data, size_t size);
|
234 |
void copyData(const unsigned char *data, size_t size);
|
233 |
|
235 |
|
Line 235... |
Line 237... |
235 |
int GetUsed () { return m_iUsed; }
|
237 |
int GetUsed () { return m_iUsed; }
|
236 |
int GetLastError () { return m_iLastError; }
|
238 |
int GetLastError () { return m_iLastError; }
|
237 |
int GetFileType() { return m_iFileType; }
|
239 |
int GetFileType() { return m_iFileType; }
|
238 |
FileType fileType() { return m_iFileType; }
|
240 |
FileType fileType() { return m_iFileType; }
|
239 |
CyString GetFilename () { return m_sName; }
|
241 |
CyString GetFilename () { return m_sName; }
|
240 |
CyString GetFullFilename () { return m_sFullDir + "/" + m_sName; }
|
242 |
CyString GetFullFilename() { return CyString(_sFullDir) + "/" + m_sName; }
|
- |
|
243 |
Utils::String fullFilename() { return _sFullDir + "/" + m_sName.ToString(); }
|
241 |
long GetSize () { return m_lSize; }
|
244 |
long GetSize () { return m_lSize; }
|
242 |
time_t GetCreationTime () { return m_tTime; }
|
245 |
time_t GetCreationTime () { return m_tTime; }
|
243 |
CyString GetName () { return m_sName; }
|
246 |
CyString GetName () { return m_sName; }
|
244 |
CyString GetDir() { return m_sDir; }
|
247 |
CyString GetDir() { return m_sDir; }
|
245 |
CyString GetDataSizeString ();
|
248 |
CyString GetDataSizeString ();
|
Line 249... |
Line 252... |
249 |
int GetVersion () { return m_iVersion; }
|
252 |
int GetVersion () { return m_iVersion; }
|
250 |
time_t GetLastModified() { return m_tTime; }
|
253 |
time_t GetLastModified() { return m_tTime; }
|
251 |
CyString GetFileTypeString () { return ::GetFileTypeString ( m_iFileType ); }
|
254 |
CyString GetFileTypeString () { return ::GetFileTypeString ( m_iFileType ); }
|
252 |
CyString GetCreationTimeString ();
|
255 |
CyString GetCreationTimeString ();
|
253 |
CyString GetTempFile () { return m_sTmpFile; }
|
256 |
CyString GetTempFile () { return m_sTmpFile; }
|
254 |
CyString GetFullDir () { return m_sFullDir; }
|
257 |
CyString GetFullDir() { return _sFullDir; }
|
- |
|
258 |
const Utils::String fullDir() const { return _sFullDir; }
|
255 |
CyString GetBaseName ();
|
259 |
CyString GetBaseName ();
|
256 |
CyString GetOriginalName() { return CyString(_sOriginalName); }
|
260 |
CyString GetOriginalName() { return CyString(_sOriginalName); }
|
257 |
const Utils::String &originalName() { return _sOriginalName; }
|
261 |
const Utils::String &originalName() { return _sOriginalName; }
|
258 |
CyString GetInMod() { return m_sInMod; }
|
262 |
CyString GetInMod() { return m_sInMod; }
|
259 |
CyString GetSignature() { if ( !m_bUpdatedSignature ) UpdateSignature(); return m_sSignature; }
|
263 |
CyString GetSignature() { if ( !m_bUpdatedSignature ) UpdateSignature(); return m_sSignature; }
|
Line 290... |
Line 294... |
290 |
}
|
294 |
}
|
291 |
CyString GetNameDirectory(CBaseFile *spkfile);
|
295 |
CyString GetNameDirectory(CBaseFile *spkfile);
|
292 |
Utils::String getNameDirectory(CBaseFile *spkfile) const;
|
296 |
Utils::String getNameDirectory(CBaseFile *spkfile) const;
|
293 |
|
297 |
|
294 |
unsigned int game() const;
|
298 |
unsigned int game() const;
|
- |
|
299 |
bool isForGame(int game) const;
|
- |
|
300 |
int getForSingleGame() const;
|
295 |
void setGame(unsigned int i);
|
301 |
void setGame(unsigned int i);
|
296 |
//TODO
|
302 |
//TODO
|
297 |
unsigned int GetGame() const { return _iGame; }
|
303 |
unsigned int GetGame() const { return _iGame; }
|
298 |
|
304 |
|
299 |
unsigned char *GetData () { return m_sData; }
|
305 |
unsigned char *GetData () { return m_sData; }
|
Line 303... |
Line 309... |
303 |
bool ReadSignedFile();
|
309 |
bool ReadSignedFile();
|
304 |
|
310 |
|
305 |
// file reading functions
|
311 |
// file reading functions
|
306 |
long ReadFileSize ();
|
312 |
long ReadFileSize ();
|
307 |
time_t ReadLastModified ();
|
313 |
time_t ReadLastModified ();
|
- |
|
314 |
bool readFromFile(const Utils::String filename);
|
308 |
bool ReadFromFile (CyString filename);
|
315 |
bool ReadFromFile (CyString filename);
|
309 |
bool ReadFromFile ();
|
316 |
bool ReadFromFile ();
|
310 |
bool readFromFile(CFileIO &File);
|
317 |
bool readFromFile(CFileIO &File);
|
311 |
bool readFromFile(CFileIO &File, int lSize, bool bDoSize = true);
|
318 |
bool readFromFile(CFileIO &File, int lSize, bool bDoSize = true);
|
312 |
//bool readFromFile(std::fstream &stream, long lSize, bool bDoSize = true );
|
319 |
//bool readFromFile(std::fstream &stream, long lSize, bool bDoSize = true );
|
313 |
bool ReadFromData ( char *data, long size );
|
320 |
bool ReadFromData ( char *data, long size );
|
314 |
int ReadScriptVersion ();
|
321 |
int ReadScriptVersion ();
|
315 |
CyString GetFilePointer ();
|
322 |
CyString GetFilePointer();
|
316 |
Utils::String filePointer() const;
|
323 |
Utils::String filePointer() const;
|
317 |
bool isExternalFile() const;
|
324 |
bool isExternalFile() const;
|
318 |
|
325 |
|
319 |
// file writing functions
|
326 |
// file writing functions
|
320 |
bool WriteToFile ( CyString filename, unsigned char * = NULL, long = 0 );
|
327 |
bool writeToDir(const Utils::String &dir, CBaseFile *, bool = true, const Utils::String &appendDir = Utils::String::Null(), unsigned char * = NULL, long = 0);
|
321 |
bool WriteToDir ( CyString &dir, CBaseFile *, bool = true, CyString appendDir = NullString, unsigned char * = NULL, long = 0 );
|
328 |
bool writeToFile(const Utils::String &filename, unsigned char * = NULL, long = 0);
|
322 |
bool WriteFilePointer ( unsigned char *cData = NULL, long len = 0 );
|
329 |
bool writeFilePointer(unsigned char *cData = NULL, long len = 0);
|
323 |
|
330 |
|
324 |
// file compression functions
|
331 |
// file compression functions
|
325 |
unsigned char *CompressToData(int compressionType, unsigned long *outSize, CProgressInfo *progress = NULL, int level = DEFAULT_COMPRESSION_LEVEL);
|
332 |
unsigned char *CompressToData(int compressionType, unsigned long *outSize, CProgressInfo *progress = NULL, int level = DEFAULT_COMPRESSION_LEVEL);
|
326 |
bool UncompressToFile ( CyString, CBaseFile *, bool = true, CProgressInfo * = NULL );
|
333 |
bool UncompressToFile ( CyString, CBaseFile *, bool = true, CProgressInfo * = NULL );
|
327 |
bool ChangeCompression(int compresstyp, CProgressInfo *progress);
|
334 |
bool ChangeCompression(int compresstyp, CProgressInfo *progress);
|
Line 359... |
Line 366... |
359 |
protected:
|
366 |
protected:
|
360 |
static int m_iTempNum; // Used when creating temp files, allows new tmp files without overrighing used ones
|
367 |
static int m_iTempNum; // Used when creating temp files, allows new tmp files without overrighing used ones
|
361 |
|
368 |
|
362 |
// private functions
|
369 |
// private functions
|
363 |
void Reset();
|
370 |
void Reset();
|
364 |
CyString GetFullFileToDir ( CyString dir, bool includedir, CBaseFile *file );
|
371 |
Utils::String _getFullFileToDir(const Utils::String &dir, bool includedir, CBaseFile *file) const;
|
365 |
|
372 |
|
366 |
CyString m_sName; // just the filename
|
373 |
CyString m_sName; // just the filename
|
367 |
CyString m_sDir; // the extra dir (only for extras)
|
374 |
CyString m_sDir; // the extra dir (only for extras)
|
368 |
CyString m_sInMod; // in a mod files
|
375 |
CyString m_sInMod; // in a mod files
|
369 |
CyString m_sSignature;
|
376 |
CyString m_sSignature;
|
370 |
|
377 |
|
371 |
// file pointer varibles
|
378 |
// file pointer varibles
|
372 |
CyString m_sFullDir; // the full dir path of the file (This is used for file pointers when not loaded data in file)
|
379 |
Utils::String _sFullDir; // the full dir path of the file (This is used for file pointers when not loaded data in file)
|
373 |
long m_lSize; // size of current file pointer
|
380 |
long m_lSize; // size of current file pointer
|
374 |
|
381 |
|
375 |
// Main file varibles
|
382 |
// Main file varibles
|
376 |
int m_iVersion; // used when reading script versions
|
383 |
int m_iVersion; // used when reading script versions
|
377 |
bool m_bSigned; // signed status of file, installer only, read from file
|
384 |
bool m_bSigned; // signed status of file, installer only, read from file
|