Subversion Repositories spk

Rev

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

Rev 56 Rev 57
Line 2... Line 2...
2
#define __GAME_EXE_H__
2
#define __GAME_EXE_H__
3
 
3
 
4
#include "CyString.h"
-
 
5
#include "lists.h"
4
#include "lists.h"
6
#include "File.h"
5
#include "File.h"
7
 
6
 
-
 
7
enum {
8
#define EXEFLAG_NONE			0
8
	EXEFLAG_NONE			= 0,
9
#define EXEFLAG_TCTEXT			1
9
	EXEFLAG_TCTEXT			= 1,
10
#define EXEFLAG_MYDOCLOG		2
10
	EXEFLAG_MYDOCLOG		= 2,
11
#define EXEFLAG_NOXOR			4
11
	EXEFLAG_NOXOR			= 4,
12
#define EXEFLAG_NOSAVESUBDIR	8
12
	EXEFLAG_NOSAVESUBDIR	= 8,
13
#define EXEFLAG_ADDON			16
13
	EXEFLAG_ADDON			= 16,
-
 
14
};
14
 
15
 
15
#define EXE_VERSIONPOS			7
16
#define EXE_VERSIONPOS			7
16
#define EXE_VERSION_NAMESTART	(EXE_VERSIONPOS + 2)
17
#define EXE_VERSION_NAMESTART	(EXE_VERSIONPOS + 2)
17
#define EXE_VERSION_SIZESTART	(EXE_VERSIONPOS + 1)
18
#define EXE_VERSION_SIZESTART	(EXE_VERSIONPOS + 1)
18
 
19
 
Line 48... Line 49...
48
	void ParseExe(const Utils::String &line);
49
	void ParseExe(const Utils::String &line);
49
	int  ParseFlags(const Utils::String &flags);
50
	int  ParseFlags(const Utils::String &flags);
50
	bool ReadFile(const Utils::String &file);
51
	bool ReadFile(const Utils::String &file);
51
 
52
 
52
	int AddExe(const Utils::String &exe);
53
	int AddExe(const Utils::String &exe);
53
	int FindExe(const Utils::String &exe);
-
 
54
	SGameExe *GetGameExe(const Utils::String &exe);
54
	SGameExe *gameExe(const Utils::String &exe);
55
 
55
 
56
	int FindVersion(int exe, int size, Utils::String *fVersion);
-
 
57
	int FindVersion(const Utils::String &exe, int size, Utils::String *fVersion);
56
	int FindVersion(const Utils::String &exe, int size, Utils::String *fVersion);
58
 
57
 
59
	int GetGameType(const Utils::String &gameExe);
58
	int GetGameType(const Utils::String &gameExe);
60
	int GetGameVersion(const Utils::String &gameExe, Utils::String *fVersion);
59
	int GetGameVersion(const Utils::String &gameExe, Utils::String *fVersion);
61
	bool GetGameVersionName(const Utils::String &gameExe, Utils::String *versionName);
60
	bool GetGameVersionName(const Utils::String &gameExe, Utils::String *versionName);
Line 76... Line 75...
76
 
75
 
77
	int GetNumGames() { return m_lExe.size(); }
76
	int GetNumGames() { return m_lExe.size(); }
78
	SGameExe *GetGame(int game) { if ( game >= 0 && game < m_lExe.size() ) return m_lExe[game]; return NULL; }
77
	SGameExe *GetGame(int game) { if ( game >= 0 && game < m_lExe.size() ) return m_lExe[game]; return NULL; }
79
 
78
 
80
private:
79
private:
-
 
80
	int _findExe(const Utils::String &exe) const;
-
 
81
	int _findVersion(int exe, int size, Utils::String *fVersion);
-
 
82
 
81
	void _SetExeName(Utils::String *sName, int *iName, const Utils::String &n);
83
	void _SetExeName(Utils::String *sName, int *iName, const Utils::String &n);
82
	Utils::String _textFileName(const Utils::String &sGameDir);
84
	Utils::String _textFileName(const Utils::String &sGameDir);
83
	Utils::String _readTextFile(const Utils::String &sGameDir);
85
	Utils::String _readTextFile(const Utils::String &sGameDir);
84
	Utils::String _extractTextData(const Utils::String &sData, long iPage, long iID);
86
	Utils::String _extractTextData(const Utils::String &sData, long iPage, long iID);
85
};
87
};