usbloadergx/source/cheats/gct.h

76 lines
2.0 KiB
C
Raw Normal View History

2009-07-31 14:45:14 +02:00
/*
* gct.h
* Class to handle Ocarina TXT Cheatfiles
*
2009-07-31 14:45:14 +02:00
*/
#ifndef _GCT_H
#define _GCT_H
#include <sstream>
#define MAXCHEATS 300
2009-07-31 14:45:14 +02:00
using namespace std;
//!Handles Ocarina TXT Cheatfiles
class GCTCheats
{
private:
string sGameID;
string sGameTitle;
string sCheatName[MAXCHEATS];
string sCheats[MAXCHEATS];
string sCheatComment[MAXCHEATS];
int iCntCheats;
2009-07-31 14:45:14 +02:00
public:
//!Constructor
2010-09-24 02:48:03 +02:00
GCTCheats(void);
//!Destructor
2010-09-24 02:48:03 +02:00
~GCTCheats(void);
//!Open txt file with cheats
//!\param filename name of TXT file
//!\return error code
2010-09-24 02:48:03 +02:00
int openTxtfile(const char * filename);
//!Creates GCT file for one cheat
//!\param nr selected Cheat Numbers
//!\param filename name of GCT file
//!\return error code
2010-09-24 02:48:03 +02:00
int createGCT(int nr, const char * filename);
//!Creates GCT file from a buffer
//!\param chtbuffer buffer that holds the cheat data
//!\param filename name of GCT file
//!\return error code
2010-09-24 02:48:03 +02:00
int createGCT(const char * chtbuffer, const char * filename);
//!Creates GCT file
//!\param nr[] array of selected Cheat Numbers
//!\param cnt size of array
//!\param filename name of GCT file
//!\return error code
2010-09-24 02:48:03 +02:00
int createGCT(int nr[], int cnt, const char * filename);
//!Gets Count cheats
//!\return Count cheats
int getCnt();
//!Gets Game Name
//!\return Game Name
2010-09-24 02:48:03 +02:00
string getGameName(void);
//!Gets GameID
//!\return GameID
2010-09-24 02:48:03 +02:00
string getGameID(void);
//!Gets cheat data
//!\return cheat data
2010-09-24 02:48:03 +02:00
string getCheat(int nr);
//!Gets Cheat Name
//!\return Cheat Name
2010-09-24 02:48:03 +02:00
string getCheatName(int nr);
//!Gets Cheat Comment
//!\return Cheat Comment
2010-09-24 02:48:03 +02:00
string getCheatComment(int nr);
//!Check if string is a code
//!\return true/false
2010-09-24 02:48:03 +02:00
bool IsCode(const std::string& s);
2009-07-31 14:45:14 +02:00
};
#endif /* _GCT_H */