Rev 1 | Rev 57 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#ifndef __GAME_EXE_H__#define __GAME_EXE_H__#include "CyString.h"#include "lists.h"#include "File.h"#define EXEFLAG_NONE 0#define EXEFLAG_TCTEXT 1#define EXEFLAG_MYDOCLOG 2#define EXEFLAG_NOXOR 4#define EXEFLAG_NOSAVESUBDIR 8#define EXEFLAG_ADDON 16#define EXE_VERSIONPOS 7#define EXE_VERSION_NAMESTART (EXE_VERSIONPOS + 2)#define EXE_VERSION_SIZESTART (EXE_VERSIONPOS + 1)tstruct SGameExeVersion {Utils::String sName;int iName;Utils::String fVersion;CLinkList<int> lSize;} SGameExeVersion;tstruct SGameExe {Utils::String sExe;Utils::String sName;Utils::String sModKey;int iFlags;int iMaxPatch;int iName;Utils::String sMyDoc;Utils::String sAddon;int iAddonTo;int iTextNum;CLinkList<SGameExeVersion> lVersions;} SGameExe;class SPKEXPORT CGameExe{private:CLinkList<SGameExe> m_lExe;public:void Reset();void ParseExe(const Utils::String &line);int ParseFlags(const Utils::String &flags);bool ReadFile(const Utils::String &file);int AddExe(const Utils::String &exe);int FindExe(const Utils::String &exe);SGameExe *GetGameExe(const Utils::String &exe);int FindVersion(int exe, int size, Utils::String *fVersion);int FindVersion(const Utils::String &exe, int size, Utils::String *fVersion);int GetGameType(const Utils::String &gameExe);int GetGameVersion(const Utils::String &gameExe, Utils::String *fVersion);bool GetGameVersionName(const Utils::String &gameExe, Utils::String *versionName);Utils::String ExtractGameName(const Utils::String &dir);Utils::String GetGameRunExe(const Utils::String &dir);Utils::String GetGameName(const Utils::String &gameExe);Utils::String GetGameNameFromType(int type);Utils::String GetGameVersionFromType(int game, int gameVersion, const Utils::String &fGameVersion);Utils::String GetGameDir(const Utils::String &dir);Utils::String GetProperDir(const Utils::String &dir);Utils::String GetAddonDir(const Utils::String &dir);int GetGameAddons(const Utils::String &dir, CyStringList &exe);int GetGameFlags(int game);int GetMaxPatch(int game);Utils::String GetModKey(int game);int ConvertGameType(int gametype, int *version);int GetNumGames() { return m_lExe.size(); }SGameExe *GetGame(int game) { if ( game >= 0 && game < m_lExe.size() ) return m_lExe[game]; return NULL; }private:void _SetExeName(Utils::String *sName, int *iName, const Utils::String &n);Utils::String _textFileName(const Utils::String &sGameDir);Utils::String _readTextFile(const Utils::String &sGameDir);Utils::String _extractTextData(const Utils::String &sData, long iPage, long iID);};#endif //__GAME_EXE_H__