Subversion Repositories spk

Rev

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

Rev 1 Rev 35
Line 4... Line 4...
4
#include "File.h"
4
#include "File.h"
-
 
5
#include "TextDB.h"
5
 
6
 
6
#include <map>
7
#include <map>
-
 
8
 
7
#define MAP std::map<std::string, std::string>;
9
class CBaseFile;
-
 
10
class CXspFile;
-
 
11
 
-
 
12
namespace SPK {
8
 
13
 
9
tclass CVirtualFileSystem
14
tclass CVirtualFileSystem
10
{
15
{
-
 
16
public:
-
 
17
	typedef std::map<std::string, std::string> FileList;
-
 
18
	typedef std::map<std::string, std::string>::iterator FileListItr;
-
 
19
 
-
 
20
private:
-
 
21
	Utils::String	m_sAddon;
-
 
22
	Utils::String	m_sDir;
-
 
23
	bool		m_bLoaded;
-
 
24
 
-
 
25
	FileList *m_pModMap;
-
 
26
	FileList *m_pMap;
-
 
27
 
-
 
28
	CTextDB	 *m_pTexts;
-
 
29
	CTextDB  *m_pModTexts;
-
 
30
 
-
 
31
	int m_iLang;
-
 
32
 
11
public:
33
public:
12
	CVirtualFileSystem(void);
34
	CVirtualFileSystem(void);
13
	~CVirtualFileSystem(void);
35
	~CVirtualFileSystem(void);
14
 
36
 
15
	void SetAddon(CyString addon) { m_sAddon = addon; }
37
	void SetAddon(const Utils::String &addon) { m_sAddon = addon; }
16
 
38
 
-
 
39
	void extractTexts(CXspFile *pPackage, int textId);
-
 
40
	C_File *extractGameFileToPackage(CBaseFile *pPackage, const Utils::String &sFile, FileType iFileType, const Utils::String &sTo);
-
 
41
	C_File *extractGameFileToPackage(CBaseFile *pPackage, const Utils::String &sFile, FileType iFileType);
17
	bool ExtractGameFile(CyString &file, CyString &to);
42
	bool ExtractGameFile(const Utils::String &file, const Utils::String &to);
18
	bool LoadFilesystem(CyString &dir, CyString &mod = NullString, int maxPatch = 0);
43
	bool LoadFilesystem(const Utils::String &dir, int maxPatch = 0);
-
 
44
	bool LoadFilesystem(const Utils::String &dir, const Utils::String &mod, int maxPatch = 0);
19
	bool LoadMod(CyString &mod);
45
	bool loadMod(const Utils::String &mod);
-
 
46
	bool addMod(const Utils::String &mod);
20
	CyString GetFile(CyString &file);
47
	Utils::String findFile(const Utils::String &file);
-
 
48
 
-
 
49
	CyStringList *GetTShipsEntries();
-
 
50
	Utils::String getTShipsEntry(const Utils::String &sId);
-
 
51
 
-
 
52
	void updateModTexts(int iPage);
-
 
53
	void updateModTexts(int iFromPage, int iToPage);
-
 
54
	void updateTexts(int iPage);
-
 
55
	void updateTexts(int iFromPage, int iToPage);
-
 
56
 
-
 
57
	Utils::String findText(int iLang, int iPage, int iID) const;
-
 
58
	bool textExists(int iLang, int iPage, int iID) const;
-
 
59
 
-
 
60
	void clearMods();
-
 
61
	bool loadShipData(CyStringList *list);
-
 
62
	void setLanguage(int iLang);
21
 
63
 
22
private:
64
private:
23
	CyString	m_sAddon;
65
	void _updateTexts(int iFromPage, int iToPage, FileList *pFileList, CTextDB *pTextList);
24
	CyString	m_sDir;
66
	Utils::String _convertExtension(const Utils::String &sFile);
25
	bool		m_bLoaded;
67
	void _clear();
26
 
-
 
27
	MAP *m_pMap;
-
 
28
};
68
};
-
 
69
 
-
 
70
}