| Line 16... | Line 16... | 
          
            | 16 | #define EXE_VERSIONPOS			7
 | 16 | #define EXE_VERSIONPOS			7
 | 
          
            | 17 | #define EXE_VERSION_NAMESTART	(EXE_VERSIONPOS + 2)
 | 17 | #define EXE_VERSION_NAMESTART	(EXE_VERSIONPOS + 2)
 | 
          
            | 18 | #define EXE_VERSION_SIZESTART	(EXE_VERSIONPOS + 1)
 | 18 | #define EXE_VERSION_SIZESTART	(EXE_VERSIONPOS + 1)
 | 
          
            | 19 |  
 | 19 |  
 | 
          
            | 20 | tstruct SGameExeVersion {
 | 20 | tstruct SGameExeVersion {
 | 
          
            | 21 | 	Utils::StringsName;
 | 21 | 	Utils::WString	sName;
 | 
          
            | 22 | 	int				iName;
 | 22 | 	int				iName;
 | 
          
            | 23 | 	Utils::StringfVersion;
 | 23 | 	Utils::WString	fVersion;
 | 
          
            | 24 | 	CLinkList<int> lSize;
 | 24 | 	CLinkList<int> lSize;
 | 
          
            | 25 | } SGameExeVersion;
 | 25 | } SGameExeVersion;
 | 
          
            | 26 |  
 | 26 |  
 | 
          
            | 27 | tstruct SGameExe {
 | 27 | tstruct SGameExe {
 | 
          
            | 28 | 	Utils::StringsExe;
 | 28 | 	Utils::WString sExe;
 | 
          
            | 29 | 	Utils::StringsName;
 | 29 | 	Utils::WString sName;
 | 
          
            | 30 | 	Utils::StringsModKey;
 | 30 | 	Utils::WString sModKey;
 | 
          
            | 31 | 	int		 iFlags;
 | 31 | 	int		 iFlags;
 | 
          
            | 32 | 	int		 iMaxPatch;
 | 32 | 	int		 iMaxPatch;
 | 
          
            | 33 | 	int		 iName;
 | 33 | 	int		 iName;
 | 
          
            | 34 | 	Utils::StringsMyDoc;
 | 34 | 	Utils::WString sMyDoc;
 | 
          
            | 35 | 	Utils::StringsAddon;
 | 35 | 	Utils::WString sAddon;
 | 
          
            | 36 | 	int		 iAddonTo;
 | 36 | 	int		 iAddonTo;
 | 
          
            | 37 | 	int		 iTextNum;
 | 37 | 	int		 iTextNum;
 | 
          
            | 38 | 	CLinkList<SGameExeVersion> lVersions;
 | 38 | 	CLinkList<SGameExeVersion> lVersions;
 | 
          
            | 39 | } SGameExe;
 | 39 | } SGameExe;
 | 
          
            | 40 |  
 | 40 |  
 | 
          
            | 41 | tstruct GameDirectory
 | 41 | tstruct GameDirectory
 | 
          
            | 42 | {
 | 42 | {
 | 
          
            | 43 | 	Utils::Stringdir;
 | 43 | 	Utils::WString dir;
 | 
          
            | 44 | 	Utils::Stringname;
 | 44 | 	Utils::WString name;
 | 
          
            | 45 | 	Utils::Stringversion;
 | 45 | 	Utils::WString version;
 | 
          
            | 46 | 	int			  id;
 | 46 | 	int			  id;
 | 
          
            | 47 | 	int			  langid;
 | 47 | 	int			  langid;
 | 
          
            | 48 | 	Utils::Stringlangname;
 | 48 | 	Utils::WString langname;
 | 
          
            | 49 | 	Utils::Stringlogdir;
 | 49 | 	Utils::WString logdir;
 | 
          
            | 50 | 	Utils::Stringaddon;
 | 50 | 	Utils::WString addon;
 | 
          
            | 51 | 	Utils::Stringexe;
 | 51 | 	Utils::WString exe;
 | 
          
            | 52 | 	Utils::Stringbasename;
 | 52 | 	Utils::WString basename;
 | 
          
            | 53 | } GameDirectory;
 | 53 | } GameDirectory;
 | 
          
            | 54 |  
 | 54 |  
 | 
          
            | 55 | class SPKEXPORT CGameExe 
 | 55 | class SPKEXPORT CGameExe 
 | 
          
            | 56 | {
 | 56 | {
 | 
          
            | 57 | private:
 | 57 | private:
 | 
          
            | 58 | 	CLinkList<SGameExe> m_lExe;
 | 58 | 	CLinkList<SGameExe> m_lExe;
 | 
          
            | 59 |  
 | 59 |  
 | 
          
            | 60 | public:
 | 60 | public:
 | 
          
            | 61 | 	void Reset();
 | 61 | 	void Reset();
 | 
          
            | 62 |  
 | 62 |  
 | 
          
            | 63 | 	void ParseExe(const Utils::String&line);
 | 63 | 	void parseExe(const Utils::WString &line);
 | 
          
            | 64 | 	int  ParseFlags(const Utils::String&flags);
 | 64 | 	int  parseFlags(const Utils::WString &flags);
 | 
          
            | 65 | 	bool ReadFile(const Utils::String&file);
 | 65 | 	bool readFile(const Utils::WString &file);
 | 
          
            | 66 |  
 | 66 |  
 | 
          
            | 67 | 	int AddExe(const Utils::String&exe);
 | 67 | 	int addExe(const Utils::WString &exe);
 | 
          
            | 68 | 	SGameExe *gameExe(const Utils::String&exe) const;
 | 68 | 	SGameExe *gameExe(const Utils::WString &exe) const;
 | 
          
            | 69 |  
 | 69 |  
 | 
          
            | 70 | 	int FindVersion(const Utils::String&exe, int size, Utils::String*fVersion);
 | 70 | 	int findVersion(const Utils::WString &exe, int size, Utils::WString *fVersion);
 | 
          
            | 71 |  
 | 71 |  
 | 
          
            | 72 | 	int findAddonType(const Utils::String&gameExe) const;
 | 72 | 	int findAddonType(const Utils::WString &gameExe) const;
 | 
          
            | 73 | 	int GetGameType(const Utils::String&gameExe) const;
 | 73 | 	int getGameType(const Utils::WString &gameExe) const;
 | 
          
            | 74 | 	int GetGameVersion(const Utils::String&gameExe, Utils::String*fVersion) const;
 | 74 | 	int getGameVersion(const Utils::WString &gameExe, Utils::WString *fVersion) const;
 | 
          
            | 75 | 	bool GetGameVersionName(const Utils::String&gameExe, Utils::String*versionName) const;
 | 75 | 	bool getGameVersionName(const Utils::WString &gameExe, Utils::WString *versionName) const;
 | 
          
            | 76 | 	Utils::StringextractGameName(const Utils::String&dir, Utils::String*extra = nullptr) const;
 | 76 | 	Utils::WString extractGameName(const Utils::WString &dir, Utils::WString *extra = nullptr) const;
 | 
          
            | 77 | 	Utils::StringGetGameRunExe(const Utils::String&dir) const;
 | 77 | 	Utils::WString gameRunExe(const Utils::WString &dir) const;
 | 
          
            | 78 | 	Utils::StringGetGameName(const Utils::String&gameExe) const;
 | 78 | 	Utils::WString gameName(const Utils::WString &gameExe) const;
 | 
          
            | 79 | 	Utils::StringGetGameBaseName(const Utils::String&gameExe) const;
 | 79 | 	Utils::WString gameBaseName(const Utils::WString &gameExe) const;
 | 
          
            | 80 | 	Utils::StringGetGameNameFromType(int type) const;
 | 80 | 	Utils::WString gameNameFromType(int type) const;
 | 
          
            | 81 | 	Utils::StringGetGameVersionFromType(int game, int gameVersion, const Utils::String&fGameVersion) const;
 | 81 | 	Utils::WString gameVersionFromType(int game, int gameVersion, const Utils::WString &fGameVersion) const;
 | 
          
            | 82 | 	Utils::StringGetGameDir(const Utils::String&dir) const;
 | 82 | 	Utils::WString gameDir(const Utils::WString &dir) const;
 | 
          
            | 83 | 	Utils::StringGetProperDir(const Utils::String&dir) const;
 | 83 | 	Utils::WString properDir(const Utils::WString &dir) const;
 | 
          
            | 84 | 	Utils::StringGetAddonDir(const Utils::String&dir) const;
 | 84 | 	Utils::WString addonDir(const Utils::WString &dir) const;
 | 
          
            | 85 | 	bool isAddon(const Utils::String&ext) const;
 | 85 | 	bool isAddon(const Utils::WString &ext) const;
 | 
          
            | 86 | 	int getTextID(const Utils::String&dir) const;
 | 86 | 	int getTextID(const Utils::WString &dir) const;
 | 
          
            | 87 | 	int getGameAddons(const Utils::String&dir, Utils::CStringList&exe) const;
 | 87 | 	int getGameAddons(const Utils::WString &dir, Utils::WStringList &exe) const;
 | 
          
            | 88 | 	int GetGameFlags(int game);
 | 88 | 	int gameFlags(int game);
 | 
          
            | 89 | 	int GetMaxPatch(int game);
 | 89 | 	int maxPatch(int game);
 | 
          
            | 90 | 	Utils::StringgetModKey(int game) const;
 | 90 | 	Utils::WString getModKey(int game) const;
 | 
          
            | 91 | 	void GetDirectoryData(GameDirectory *gameDir) const;
 | 91 | 	void getDirectoryData(GameDirectory *gameDir) const;
 | 
          
            | 92 |  
 | 92 |  
 | 
          
            | 93 | 	int ConvertGameType(int gametype, int *version);
 | 93 | 	int convertGameType(int gametype, int *version);
 | 
          
            | 94 |  
 | 94 |  
 | 
          
            | 95 | 	int GetNumGames() { return m_lExe.size(); }
 | 95 | 	int numGames() { return m_lExe.size(); }
 | 
          
            | 96 | 	SGameExe *GetGame(int game) const;
 | 96 | 	SGameExe *game(int game) const;
 | 
          
            | 97 | 	unsigned int gameCount() const;
 | 97 | 	unsigned int gameCount() const;
 | 
          
            | 98 |  
 | 98 |  
 | 
          
            | 99 | private:
 | 99 | private:
 | 
          
            | 100 | 	int _findExe(const Utils::String&exe) const;
 | 100 | 	int _findExe(const Utils::WString &exe) const;
 | 
          
            | 101 | 	int _findVersion(int exe, int size, Utils::String*fVersion) const;
 | 101 | 	int _findVersion(int exe, int size, Utils::WString *fVersion) const;
 | 
          
            | 102 |  
 | 102 |  
 | 
          
            | 103 | 	void _SetExeName(Utils::String*sName, int *iName, const Utils::String&n);
 | 103 | 	void _setExeName(Utils::WString *sName, int *iName, const Utils::WString &n);
 | 
          
            | 104 | 	Utils::String_textFileName(const Utils::String&sGameDir) const;
 | 104 | 	Utils::WString _textFileName(const Utils::WString &sGameDir) const;
 | 
          
            | 105 | 	Utils::String_readTextFile(const Utils::String&sGameDir) const;
 | 105 | 	Utils::WString _readTextFile(const Utils::WString &sGameDir) const;
 | 
          
            | 106 | 	Utils::String_extractTextData(const Utils::String&sData, long iPage, long iID, int iGameID) const;
 | 106 | 	Utils::WString _extractTextData(const Utils::WString &sData, long iPage, long iID, int iGameID) const;
 | 
          
            | 107 | };
 | 107 | };
 | 
          
            | 108 |  
 | 108 |  
 | 
          
            | 109 |  
 | 109 |  
 | 
          
            | 110 | #endif //__GAME_EXE_H__
 | 110 | #endif //__GAME_EXE_H__
 |