Line 207... |
Line 207... |
207 |
static Utils::String GetDirectory(FileType eType, const Utils::String &filename, CBaseFile *file);
|
207 |
static Utils::String GetDirectory(FileType eType, const Utils::String &filename, CBaseFile *file);
|
208 |
static bool DoesTypeHaveExtraDir(int i);
|
208 |
static bool DoesTypeHaveExtraDir(int i);
|
209 |
|
209 |
|
210 |
public:
|
210 |
public:
|
211 |
|
211 |
|
212 |
void ClearUsed () { m_iUsed = 0; }
|
212 |
void clearUsed () { _iUsed = 0; }
|
213 |
void IncUsed () { ++m_iUsed; }
|
213 |
void incUsed () { ++_iUsed; }
|
214 |
void DeleteData ();
|
214 |
void DeleteData ();
|
215 |
// varible setting functions
|
215 |
// varible setting functions
|
216 |
void SetFileType(FileType t) { m_iFileType = t; }
|
- |
|
217 |
void setFileType(FileType t) { m_iFileType = t; }
|
216 |
void setFileType(FileType t) { m_iFileType = t; }
|
218 |
void SetFilename(CyString filename);
|
217 |
void SetFilename(CyString filename);
|
219 |
void setFilename(const Utils::String &filename);
|
218 |
void setFilename(const Utils::String &filename);
|
220 |
void SetName(CyString name) { _sName = name.ToString(); }
|
219 |
void SetName(CyString name) { _sName = name.ToString(); }
|
221 |
void setName(const Utils::String &name) { _sName = name; }
|
220 |
void setName(const Utils::String &name) { _sName = name; }
|
Line 228... |
Line 227... |
228 |
void SetDataCompression ( int c ) { m_iDataCompression = c; }
|
227 |
void SetDataCompression ( int c ) { m_iDataCompression = c; }
|
229 |
void SetShared ( bool b ) { m_bShared = b; }
|
228 |
void SetShared ( bool b ) { m_bShared = b; }
|
230 |
void SetSigned ( bool b ) { m_bSigned = b; }
|
229 |
void SetSigned ( bool b ) { m_bSigned = b; }
|
231 |
void SetFullDir(CyString dir) { _sFullDir = dir.ToString(); }
|
230 |
void SetFullDir(CyString dir) { _sFullDir = dir.ToString(); }
|
232 |
void setFullDir(const Utils::String &dir) { _sFullDir = dir; }
|
231 |
void setFullDir(const Utils::String &dir) { _sFullDir = dir; }
|
233 |
void SetInMod ( CyString s ) { m_sInMod = s; }
|
232 |
void setInMod (const Utils::String &s) { _sInMod = s; }
|
234 |
void SetCompressedToFile ( bool b ) { m_bCompressedToFile = b; }
|
233 |
void SetCompressedToFile ( bool b ) { m_bCompressedToFile = b; }
|
235 |
void SetData(const unsigned char *data, size_t size) { m_sData = (unsigned char *)data, m_lDataSize = (long)size; }
|
234 |
void SetData(const unsigned char *data, size_t size) { m_sData = (unsigned char *)data, m_lDataSize = (long)size; }
|
236 |
void copyData(const unsigned char *data, size_t size);
|
235 |
void copyData(const unsigned char *data, size_t size);
|
237 |
|
236 |
|
238 |
// get functions
|
237 |
// get functions
|
239 |
int GetUsed () { return m_iUsed; }
|
238 |
int getUsed () { return _iUsed; }
|
240 |
int GetLastError () { return m_iLastError; }
|
239 |
int GetLastError () { return m_iLastError; }
|
241 |
int GetFileType() { return m_iFileType; }
|
240 |
int GetFileType() { return m_iFileType; }
|
242 |
FileType fileType() { return m_iFileType; }
|
241 |
FileType fileType() { return m_iFileType; }
|
243 |
//CyString GetFilename() { return _sName; }
|
242 |
//CyString GetFilename() { return _sName; }
|
244 |
const Utils::String &filename() const { return _sName; }
|
243 |
const Utils::String &filename() const { return _sName; }
|
Line 257... |
Line 256... |
257 |
int GetVersion () { return m_iVersion; }
|
256 |
int GetVersion () { return m_iVersion; }
|
258 |
time_t GetLastModified() { return m_tTime; }
|
257 |
time_t GetLastModified() { return m_tTime; }
|
259 |
Utils::String fileTypeString() const { return ::GetFileTypeString(m_iFileType); }
|
258 |
Utils::String fileTypeString() const { return ::GetFileTypeString(m_iFileType); }
|
260 |
CyString GetFileTypeString() { return ::GetFileTypeString(m_iFileType); }
|
259 |
CyString GetFileTypeString() { return ::GetFileTypeString(m_iFileType); }
|
261 |
CyString GetCreationTimeString ();
|
260 |
CyString GetCreationTimeString ();
|
262 |
CyString GetTempFile () { return m_sTmpFile; }
|
261 |
const Utils::String &getTempFile () const { return _sTmpFile; }
|
263 |
CyString GetFullDir() { return _sFullDir; }
|
262 |
CyString GetFullDir() { return _sFullDir; }
|
264 |
const Utils::String fullDir() const { return _sFullDir; }
|
263 |
const Utils::String fullDir() const { return _sFullDir; }
|
265 |
CyString GetBaseName();
|
264 |
CyString GetBaseName();
|
266 |
Utils::String baseName() const;
|
265 |
Utils::String baseName() const;
|
267 |
CyString GetOriginalName() { return CyString(_sOriginalName); }
|
266 |
CyString GetOriginalName() { return CyString(_sOriginalName); }
|
268 |
const Utils::String &originalName() { return _sOriginalName; }
|
267 |
const Utils::String &originalName() const { return _sOriginalName; }
|
269 |
CyString GetInMod() { return m_sInMod; }
|
268 |
const Utils::String &getInMod() const { return _sInMod; }
|
270 |
CyString GetSignature() { if ( !m_bUpdatedSignature ) UpdateSignature(); return m_sSignature; }
|
269 |
const Utils::String &getSignature() { if ( !m_bUpdatedSignature ) updateSignature(); return _sSignature; }
|
271 |
void UpdateSignature();
|
270 |
void updateSignature();
|
272 |
void ChangeBaseName(CyString b) { _sName = CyString(b + "." + this->GetFileExt()).ToString(); }
|
271 |
void ChangeBaseName(CyString b) { _sName = CyString(b + "." + this->GetFileExt()).ToString(); }
|
273 |
void changeBaseName(const Utils::String &b) { _sName = b + "." + this->fileExt(); }
|
272 |
void changeBaseName(const Utils::String &b) { _sName = b + "." + this->fileExt(); }
|
274 |
bool RenameScript(CyString baseName);
|
273 |
bool RenameScript(CyString baseName);
|
275 |
bool IsInMod() { return !m_sInMod.Empty(); }
|
274 |
bool isInMod() { return !_sInMod.empty(); }
|
276 |
|
275 |
|
277 |
void FixOriginalName() { _sOriginalName = _sName; }
|
276 |
void FixOriginalName() { _sOriginalName = _sName; }
|
278 |
void SetOriginalName(const Utils::String &name) { _sOriginalName = name; }
|
277 |
void SetOriginalName(const Utils::String &name) { _sOriginalName = name; }
|
279 |
|
278 |
|
280 |
bool isFileInAddon() const;
|
279 |
bool isFileInAddon() const;
|
Line 382... |
Line 381... |
382 |
void Reset();
|
381 |
void Reset();
|
383 |
Utils::String _getFullFileToDir(const Utils::String &dir, bool includedir, CBaseFile *file) const;
|
382 |
Utils::String _getFullFileToDir(const Utils::String &dir, bool includedir, CBaseFile *file) const;
|
384 |
|
383 |
|
385 |
Utils::String _sName; // just the filename
|
384 |
Utils::String _sName; // just the filename
|
386 |
Utils::String _sDir; // the extra dir (only for extras)
|
385 |
Utils::String _sDir; // the extra dir (only for extras)
|
387 |
CyString m_sInMod; // in a mod files
|
386 |
Utils::String _sInMod; // in a mod files
|
388 |
CyString m_sSignature;
|
387 |
Utils::String _sSignature;
|
389 |
|
388 |
|
390 |
// file pointer varibles
|
389 |
// file pointer varibles
|
391 |
Utils::String _sFullDir; // the full dir path of the file (This is used for file pointers when not loaded data in file)
|
390 |
Utils::String _sFullDir; // the full dir path of the file (This is used for file pointers when not loaded data in file)
|
392 |
long m_lSize; // size of current file pointer
|
391 |
long m_lSize; // size of current file pointer
|
393 |
|
392 |
|
394 |
// Main file varibles
|
393 |
// Main file varibles
|
395 |
int m_iVersion; // used when reading script versions
|
394 |
int m_iVersion; // used when reading script versions
|
396 |
bool m_bSigned; // signed status of file, installer only, read from file
|
395 |
bool m_bSigned; // signed status of file, installer only, read from file
|
397 |
bool m_bShared; // is file a marked shared file (Not used much anymore)
|
396 |
bool m_bShared; // is file a marked shared file (Not used much anymore)
|
398 |
int m_iUsed; // used by installer, number of plugins that uses the file
|
397 |
int _iUsed; // used by installer, number of plugins that uses the file
|
399 |
time_t m_tTime; // Creation time of the file
|
398 |
time_t m_tTime; // Creation time of the file
|
400 |
|
399 |
|
401 |
// File data varibles
|
400 |
// File data varibles
|
402 |
long m_lDataSize; // size of the data stream in what ever compression is set
|
401 |
long m_lDataSize; // size of the data stream in what ever compression is set
|
403 |
long m_lUncomprDataSize; // size of stream if it was uncompressed
|
402 |
long m_lUncomprDataSize; // size of stream if it was uncompressed
|
Line 405... |
Line 404... |
405 |
int m_iDataCompression; // the current compression of m_sData
|
404 |
int m_iDataCompression; // the current compression of m_sData
|
406 |
|
405 |
|
407 |
FileType m_iFileType; // type if file, ie Script, Text, etc
|
406 |
FileType m_iFileType; // type if file, ie Script, Text, etc
|
408 |
|
407 |
|
409 |
bool m_bUsedMalloc; // malloc type of m_sData, so it can use with free() or delete
|
408 |
bool m_bUsedMalloc; // malloc type of m_sData, so it can use with free() or delete
|
410 |
CyString m_sTmpFile;
|
409 |
Utils::String _sTmpFile;
|
411 |
|
410 |
|
412 |
bool m_bCompressedToFile;
|
411 |
bool m_bCompressedToFile;
|
413 |
|
412 |
|
414 |
bool m_bSkip;
|
413 |
bool m_bSkip;
|
415 |
bool m_bLoaded;
|
414 |
bool m_bLoaded;
|