Subversion Repositories spk

Rev

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

Rev 94 Rev 101
Line 1... Line 1...
1
#pragma once
1
#pragma once
2
 
2
 
3
#include "CyString.h"
-
 
4
#include "File.h"
3
#include "File.h"
5
#include "Utils/StringList.h"
4
#include "Utils/StringList.h"
6
#include <map>
5
#include <map>
7
 
6
 
8
class CBaseFile;
7
class CBaseFile;
Line 29... Line 28...
29
	FileList *m_pMap;
28
	FileList *m_pMap;
30
 
29
 
31
	CTextDB	 *m_pTexts;
30
	CTextDB	 *m_pTexts;
32
	CTextDB  *m_pModTexts;
31
	CTextDB  *m_pModTexts;
33
 
32
 
-
 
33
	Utils::CStringList	*_lShips;
34
	Utils::CStringList	*_lShields;
34
	Utils::CStringList	*_lShields;
35
	Utils::CStringList	*_lLasers;
35
	Utils::CStringList	*_lLasers;
36
	Utils::CStringList	*_lMissiles;
36
	Utils::CStringList	*_lMissiles;
37
	Utils::CStringList	*_lCockpits;
37
	Utils::CStringList	*_lCockpits;
38
	Utils::CStringList	*_lComponentSections;
38
	Utils::CStringList	*_lComponentSections;
Line 43... Line 43...
43
 
43
 
44
public:
44
public:
45
	CVirtualFileSystem(void);
45
	CVirtualFileSystem(void);
46
	~CVirtualFileSystem(void);
46
	~CVirtualFileSystem(void);
47
 
47
 
-
 
48
	// setters
48
	void SetAddon(const Utils::String &addon) { m_sAddon = addon; }
49
	void setAddon(const Utils::String &addon);
-
 
50
	void setLanguage(int iLang);
49
 
51
 
-
 
52
	// extractions
50
	void extractTexts(CXspFile *pPackage, int textId);
53
	void extractTexts(CXspFile *pPackage, int textId);
51
	C_File *extractGameFileToPackage(CBaseFile *pPackage, const Utils::String &sFile, FileType iFileType, const Utils::String &sTo);
54
	C_File *extractGameFileToPackage(CBaseFile *pPackage, const Utils::String &sFile, FileType iFileType, const Utils::String &sTo);
52
	C_File *extractGameFileToPackage(CBaseFile *pPackage, const Utils::String &sFile, FileType iFileType);
55
	C_File *extractGameFileToPackage(CBaseFile *pPackage, const Utils::String &sFile, FileType iFileType);
53
	Utils::String ExtractGameFile(const Utils::String &file, const Utils::String &to);
56
	Utils::String ExtractGameFile(const Utils::String &file, const Utils::String &to);
-
 
57
 
-
 
58
	// loading
54
	bool LoadFilesystem(const Utils::String &dir, int maxPatch = 0);
59
	bool LoadFilesystem(const Utils::String &dir, int maxPatch = 0);
55
	bool LoadFilesystem(const Utils::String &dir, const Utils::String &mod, int maxPatch = 0);
60
	bool LoadFilesystem(const Utils::String &dir, const Utils::String &mod, int maxPatch = 0);
56
	bool loadMod(const Utils::String &mod);
61
	bool loadMod(const Utils::String &mod);
57
	bool addMod(const Utils::String &mod);
62
	bool addMod(const Utils::String &mod);
58
	bool isFileAvailable(const Utils::String &file);
-
 
59
 
63
 
-
 
64
	// getters
60
	CyStringList *GetTShipsEntries();
65
	const Utils::String &directory() const;
-
 
66
	bool isFileAvailable(const Utils::String &file);
61
	Utils::String getTShipsEntry(const Utils::String &sId);
67
	Utils::String getTShipsEntry(const Utils::String &sId);
-
 
68
	Utils::String findText(int iLang, int iPage, int iID) const;
-
 
69
	bool textExists(int iLang, int iPage, int iID) const;
-
 
70
	bool isTextUpdated() const;
62
 
71
 
-
 
72
	// Updates
63
	void updateModTexts(int iPage);
73
	void updateModTexts(int iPage);
64
	void updateModTexts(int iFromPage, int iToPage);
74
	void updateModTexts(int iFromPage, int iToPage);
65
	void updateTexts(int iPage);
75
	void updateTexts(int iPage);
66
	void updateTexts(int iFromPage, int iToPage);
76
	void updateTexts(int iFromPage, int iToPage);
67
 
-
 
68
	Utils::String findText(int iLang, int iPage, int iID) const;
-
 
69
	bool textExists(int iLang, int iPage, int iID) const;
-
 
70
 
77
 
71
	void clearMods(bool bIncludeStandard = false);
78
	void clearMods(bool bIncludeStandard = false);
72
	bool loadShipData(CyStringList *list);
-
 
73
	void setLanguage(int iLang);
-
 
74
 
79
 
-
 
80
	// Iterators
-
 
81
	Utils::CStringList *getTShipsEntries();
75
	Utils::String firstShield();
82
	Utils::String firstShield();
76
	Utils::String nextShield();
83
	Utils::String nextShield();
77
	Utils::String firstComponentSection();
84
	Utils::String firstComponentSection();
78
	Utils::String nextComponentSection();
85
	Utils::String nextComponentSection();
79
	Utils::String firstDummySection();
86
	Utils::String firstDummySection();
Line 104... Line 111...
104
	void _updateMissiles();
111
	void _updateMissiles();
105
	void _updateCockpits();
112
	void _updateCockpits();
106
	void _updateComponentSections();
113
	void _updateComponentSections();
107
	void _updateDummySections();
114
	void _updateDummySections();
108
	void _updateBodiesSections();
115
	void _updateBodiesSections();
-
 
116
	void _updateShips();
109
 
117
 
110
	Utils::String _returnText(Utils::SStringList *s);
118
	Utils::String _returnText(Utils::SStringList *s);
111
	Utils::String _returnID(Utils::SStringList *s);
119
	Utils::String _returnID(Utils::SStringList *s);
112
	Utils::String _returnLine(Utils::SStringList *s);
120
	Utils::String _returnLine(Utils::SStringList *s);
113
	std::pair<Utils::String, Utils::String> _returnPair(Utils::SStringList *s);
121
	std::pair<Utils::String, Utils::String> _returnPair(Utils::SStringList *s);