Subversion Repositories spk

Rev

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

Rev 84 Rev 94
Line 4... Line 4...
4
#include "File.h"
4
#include "File.h"
5
#include "TextDB.h"
5
#include "Utils/StringList.h"
6
 
-
 
7
#include <map>
6
#include <map>
8
 
7
 
9
class CBaseFile;
8
class CBaseFile;
10
class CXspFile;
9
class CXspFile;
11
 
10
 
-
 
11
namespace Utils {
-
 
12
	class CStringList;
-
 
13
}
12
namespace SPK {
14
namespace SPK {
-
 
15
	class CTextDB;
13
 
16
 
14
tclass CVirtualFileSystem
17
tclass CVirtualFileSystem
15
{
18
{
16
public:
19
public:
17
	typedef std::map<Utils::String, Utils::String> FileList;
20
	typedef std::map<Utils::String, Utils::String> FileList;
Line 25... Line 28...
25
	FileList *m_pModMap;
28
	FileList *m_pModMap;
26
	FileList *m_pMap;
29
	FileList *m_pMap;
27
 
30
 
28
	CTextDB	 *m_pTexts;
31
	CTextDB	 *m_pTexts;
29
	CTextDB  *m_pModTexts;
32
	CTextDB  *m_pModTexts;
-
 
33
 
-
 
34
	Utils::CStringList	*_lShields;
-
 
35
	Utils::CStringList	*_lLasers;
-
 
36
	Utils::CStringList	*_lMissiles;
-
 
37
	Utils::CStringList	*_lCockpits;
-
 
38
	Utils::CStringList	*_lComponentSections;
-
 
39
	Utils::CStringList	*_lDummySections;
-
 
40
	Utils::CStringList	*_lBodiesSections;
30
 
41
 
31
	int m_iLang;
42
	int m_iLang;
32
 
43
 
33
public:
44
public:
34
	CVirtualFileSystem(void);
45
	CVirtualFileSystem(void);
Line 43... Line 54...
43
	bool LoadFilesystem(const Utils::String &dir, int maxPatch = 0);
54
	bool LoadFilesystem(const Utils::String &dir, int maxPatch = 0);
44
	bool LoadFilesystem(const Utils::String &dir, const Utils::String &mod, int maxPatch = 0);
55
	bool LoadFilesystem(const Utils::String &dir, const Utils::String &mod, int maxPatch = 0);
45
	bool loadMod(const Utils::String &mod);
56
	bool loadMod(const Utils::String &mod);
46
	bool addMod(const Utils::String &mod);
57
	bool addMod(const Utils::String &mod);
47
	bool isFileAvailable(const Utils::String &file);
58
	bool isFileAvailable(const Utils::String &file);
48
 
59
 
49
	CyStringList *GetTShipsEntries();
60
	CyStringList *GetTShipsEntries();
50
	Utils::String getTShipsEntry(const Utils::String &sId);
61
	Utils::String getTShipsEntry(const Utils::String &sId);
51
 
62
 
52
	void updateModTexts(int iPage);
63
	void updateModTexts(int iPage);
53
	void updateModTexts(int iFromPage, int iToPage);
64
	void updateModTexts(int iFromPage, int iToPage);
54
	void updateTexts(int iPage);
65
	void updateTexts(int iPage);
55
	void updateTexts(int iFromPage, int iToPage);
66
	void updateTexts(int iFromPage, int iToPage);
56
 
67
 
57
	Utils::String findText(int iLang, int iPage, int iID) const;
68
	Utils::String findText(int iLang, int iPage, int iID) const;
58
	bool textExists(int iLang, int iPage, int iID) const;
69
	bool textExists(int iLang, int iPage, int iID) const;
59
 
70
 
60
	void clearMods(bool bIncludeStandard = false);
71
	void clearMods(bool bIncludeStandard = false);
61
	bool loadShipData(CyStringList *list);
72
	bool loadShipData(CyStringList *list);
62
	void setLanguage(int iLang);
73
	void setLanguage(int iLang);
-
 
74
 
-
 
75
	Utils::String firstShield();
-
 
76
	Utils::String nextShield();
-
 
77
	Utils::String firstComponentSection();
-
 
78
	Utils::String nextComponentSection();
-
 
79
	Utils::String firstDummySection();
-
 
80
	Utils::String nextDummySection();
-
 
81
	Utils::String firstBodiesSection();
-
 
82
	Utils::String nextBodiesSection();
-
 
83
	std::pair<Utils::String, Utils::String> firstLaser();
-
 
84
	std::pair<Utils::String, Utils::String> nextLaser();
-
 
85
	std::pair<Utils::String, Utils::String> firstMissile();
-
 
86
	std::pair<Utils::String, Utils::String> nextMissile();
-
 
87
	Utils::String firstCockpit();
-
 
88
	Utils::String nextCockpit();
63
 
89
 
64
private:
90
private:
65
	void _updateTexts(int iFromPage, int iToPage, FileList *pFileList, CTextDB *pTextList);
91
	void _updateTexts(int iFromPage, int iToPage, FileList *pFileList, CTextDB *pTextList);
66
	Utils::String _convertExtension(const Utils::String &sFile);
92
	Utils::String _convertExtension(const Utils::String &sFile);
67
	void _clear();
93
	void _clear();
Line 69... Line 95...
69
	void _addModFile(const Utils::String &sFile, const Utils::String &sMod, FileList *pList);
95
	void _addModFile(const Utils::String &sFile, const Utils::String &sMod, FileList *pList);
70
	Utils::String _findFile(const Utils::String &file);
96
	Utils::String _findFile(const Utils::String &file);
71
	void _addDir(const Utils::String &sStart, const Utils::String &sDir);
97
	void _addDir(const Utils::String &sStart, const Utils::String &sDir);
72
	Utils::String _extractFromCat(const Utils::String &sCat, const Utils::String &sFile, const Utils::String &sTo);
98
	Utils::String _extractFromCat(const Utils::String &sCat, const Utils::String &sFile, const Utils::String &sTo);
73
	Utils::String _extract(const Utils::String &sFile, const Utils::String &sTo);
99
	Utils::String _extract(const Utils::String &sFile, const Utils::String &sTo);
-
 
100
 
-
 
101
	Utils::CStringList *_updateList(const Utils::String &typesFile, int iTextPos);
-
 
102
	void _updateShields();
-
 
103
	void _updateLasers();
-
 
104
	void _updateMissiles();
-
 
105
	void _updateCockpits();
-
 
106
	void _updateComponentSections();
-
 
107
	void _updateDummySections();
-
 
108
	void _updateBodiesSections();
-
 
109
 
-
 
110
	Utils::String _returnText(Utils::SStringList *s);
-
 
111
	Utils::String _returnID(Utils::SStringList *s);
-
 
112
	Utils::String _returnLine(Utils::SStringList *s);
-
 
113
	std::pair<Utils::String, Utils::String> _returnPair(Utils::SStringList *s);
-
 
114
	Utils::CStringList *_updateSectionList(const Utils::String &sFile, bool singleEntry);
74
};
115
};
75
 
116
 
76
}
117
}