MythTV  master
rominfo.h
Go to the documentation of this file.
1 #ifndef ROMINFO_H_
2 #define ROMINFO_H_
3 
4 #include <QMetaType>
5 #include <QString>
6 #include <QList>
7 
8 int romInDB(const QString& rom, const QString& gametype);
9 
10 class RomInfo
11 {
12  public:
13  static QList<RomInfo*> GetAllRomInfo();
14  static RomInfo *GetRomInfoById(int id);
15 
16  RomInfo(int lid = 0, QString lromname = "", QString lsystem = "", QString lgamename ="",
17  QString lgenre = "", QString lyear = "", bool lfavorite = false,
18  QString lrompath = "", QString lcountry ="", QString lcrc_value = "",
19  int ldiskcount = 0, QString lgametype = "", int lromcount = 0,
20  QString lallsystems = "", QString lplot = "", QString lpublisher = "",
21  QString lversion = "", QString lscreenshot = "", QString lfanart = "",
22  QString lboxart = "", QString linetref = "")
23  {
24  m_id = lid;
25  m_romname = lromname;
26  m_system = lsystem;
27  m_gamename = lgamename;
28  m_genre = lgenre;
29  m_year = lyear;
30  m_favorite = lfavorite;
31  m_rompath = lrompath;
32  m_screenshot = lscreenshot;
33  m_fanart = lfanart;
34  m_boxart = lboxart;
35  m_country = lcountry;
36  m_crc_value = lcrc_value;
37  m_diskcount = ldiskcount;
38  m_gametype = lgametype;
39  m_romcount = lromcount;
40  m_allsystems = lallsystems;
41  m_plot = lplot;
42  m_publisher = lpublisher;
43  m_version = lversion;
44  m_inetref = linetref;
45  }
46 
47  RomInfo(const RomInfo &lhs)
48  {
49  m_id = lhs.m_id;
50  m_romname = lhs.m_romname;
51  m_system = lhs.m_system;
52  m_gamename = lhs.m_gamename;
53  m_genre = lhs.m_genre;
54  m_year = lhs.m_year;
55  m_favorite = lhs.m_favorite;
56  m_rompath = lhs.m_rompath;
58  m_fanart = lhs.m_fanart;
59  m_boxart = lhs.m_boxart;
60  m_country = lhs.m_country;
63  m_gametype = lhs.m_gametype;
64  m_romcount = lhs.m_romcount;
66  m_plot = lhs.m_plot;
68  m_version = lhs.m_version;
69  m_inetref = lhs.m_inetref;
70  }
71 
72  ~RomInfo() = default;
73 
74  static bool FindImage(QString BaseFileName, QString *result);
75 
76  int Id() const { return m_id; }
77  void setId(const int &lid) { m_id = lid; }
78 
79  QString Rompath() const { return m_rompath; }
80  void setRompath(const QString &lrompath) { m_rompath = lrompath; }
81 
82  QString Screenshot() const { return m_screenshot; }
83  void setScreenshot(const QString &lscreenshot) { m_screenshot = lscreenshot; }
84 
85  QString Fanart() const { return m_fanart; }
86  void setFanart(const QString &lfanart) { m_fanart = lfanart; }
87 
88  QString Boxart() const { return m_boxart; }
89  void setBoxart(const QString &lboxart) { m_boxart = lboxart; }
90 
91  QString Romname() const { return m_romname; }
92  void setRomname(const QString &lromname) { m_romname = lromname; }
93 
94  QString System() const { return m_system; }
95  void setSystem(const QString &lsystem) { m_system = lsystem; }
96 
97  QString Gamename() const { return m_gamename; }
98  void setGamename(const QString &lgamename) { m_gamename = lgamename; }
99 
100  QString Genre() const { return m_genre; }
101  void setGenre(const QString &lgenre) { m_genre = lgenre; }
102 
103  QString Country() const { return m_country; }
104  void setCountry(const QString &lcountry) { m_country = lcountry; }
105 
106  QString GameType() const { return m_gametype; }
107  void setGameType(const QString &lgametype) { m_gametype = lgametype; }
108 
109  int RomCount() const { return m_romcount; }
110  void setRomCount(const int &lromcount) { m_romcount = lromcount; }
111 
112  QString AllSystems() const { return m_allsystems; }
113  void setAllSystems(const QString &lallsystems) { m_allsystems = lallsystems; }
114 
115  int DiskCount() const { return m_diskcount; }
116  void setDiskCount(const int &ldiskcount) { m_diskcount = ldiskcount; }
117 
118  QString CRC_VALUE() const { return m_crc_value; }
119  void setCRC_VALUE(const QString &lcrc_value) { m_crc_value = lcrc_value; }
120 
121  QString Plot() const { return m_plot; }
122  void setPlot(const QString &lplot) { m_plot = lplot; }
123 
124  QString Publisher() const { return m_publisher; }
125  void setPublisher(const QString &lpublisher) { m_publisher = lpublisher; }
126 
127  QString Version() const { return m_version; }
128  void setVersion(const QString &lversion) { m_version = lversion; }
129 
130  QString Year() const { return m_year; }
131  void setYear(const QString &lyear) { m_year = lyear; }
132 
133  QString Inetref() const { return m_inetref; }
134  void setInetref(const QString &linetref) { m_inetref = linetref; }
135 
136  int Favorite() const { return m_favorite; }
137  void setFavorite(bool updateDatabase = false);
138 
139  QString getExtension();
140  QString toString();
141 
142  void setField(const QString& field, const QString& data);
143  void fillData();
144 
145  void SaveToDatabase();
146  void DeleteFromDatabase();
147 
148  protected:
149  int m_id;
150  QString m_romname;
151  QString m_system;
152  QString m_gamename;
153  QString m_genre;
154  QString m_country;
155  QString m_crc_value;
156  QString m_gametype;
157  QString m_allsystems;
158  QString m_plot;
159  QString m_publisher;
160  QString m_version;
163  QString m_year;
165  QString m_rompath;
166  QString m_screenshot;
167  QString m_fanart;
168  QString m_boxart;
169  QString m_inetref;
170 };
171 
172 bool operator==(const RomInfo& a, const RomInfo& b);
173 
175 
176 #endif
QString AllSystems() const
Definition: rominfo.h:112
int romInDB(const QString &rom, const QString &gametype)
Definition: rominfo.cpp:114
QString m_year
Definition: rominfo.h:163
void setRomCount(const int &lromcount)
Definition: rominfo.h:110
void setPlot(const QString &lplot)
Definition: rominfo.h:122
QString m_publisher
Definition: rominfo.h:159
QString Screenshot() const
Definition: rominfo.h:82
void fillData()
Definition: rominfo.cpp:247
void DeleteFromDatabase()
Definition: rominfo.cpp:94
void setGameType(const QString &lgametype)
Definition: rominfo.h:107
QString Plot() const
Definition: rominfo.h:121
~RomInfo()=default
QString Gamename() const
Definition: rominfo.h:97
QString m_gametype
Definition: rominfo.h:156
static bool FindImage(QString BaseFileName, QString *result)
Definition: rominfo.cpp:141
QString Country() const
Definition: rominfo.h:103
QString Romname() const
Definition: rominfo.h:91
void setBoxart(const QString &lboxart)
Definition: rominfo.h:89
QString m_inetref
Definition: rominfo.h:169
QString m_romname
Definition: rominfo.h:150
Q_DECLARE_METATYPE(GrabberScript *)
QString m_genre
Definition: rominfo.h:153
void setId(const int &lid)
Definition: rominfo.h:77
void setInetref(const QString &linetref)
Definition: rominfo.h:134
QString Version() const
Definition: rominfo.h:127
void setVersion(const QString &lversion)
Definition: rominfo.h:128
unsigned char b
Definition: ParseText.cpp:329
void setPublisher(const QString &lpublisher)
Definition: rominfo.h:125
QString m_version
Definition: rominfo.h:160
QString m_boxart
Definition: rominfo.h:168
void setField(const QString &field, const QString &data)
Definition: rominfo.cpp:172
QString m_allsystems
Definition: rominfo.h:157
int RomCount() const
Definition: rominfo.h:109
QString m_plot
Definition: rominfo.h:158
void setScreenshot(const QString &lscreenshot)
Definition: rominfo.h:83
void setAllSystems(const QString &lallsystems)
Definition: rominfo.h:113
QString m_crc_value
Definition: rominfo.h:155
int m_id
Definition: rominfo.h:149
void setRompath(const QString &lrompath)
Definition: rominfo.h:80
QString toString()
Definition: rominfo.cpp:416
void setDiskCount(const int &ldiskcount)
Definition: rominfo.h:116
int m_diskcount
Definition: rominfo.h:162
void setFavorite(bool updateDatabase=false)
Definition: rominfo.cpp:213
QString Year() const
Definition: rominfo.h:130
QString m_gamename
Definition: rominfo.h:152
int m_romcount
Definition: rominfo.h:161
static RomInfo * GetRomInfoById(int id)
Definition: rominfo.cpp:368
bool m_favorite
Definition: rominfo.h:164
static QList< RomInfo * > GetAllRomInfo()
Definition: rominfo.cpp:320
QString Rompath() const
Definition: rominfo.h:79
QString CRC_VALUE() const
Definition: rominfo.h:118
void setRomname(const QString &lromname)
Definition: rominfo.h:92
QString Boxart() const
Definition: rominfo.h:88
RomInfo(int lid=0, QString lromname="", QString lsystem="", QString lgamename="", QString lgenre="", QString lyear="", bool lfavorite=false, QString lrompath="", QString lcountry="", QString lcrc_value="", int ldiskcount=0, QString lgametype="", int lromcount=0, QString lallsystems="", QString lplot="", QString lpublisher="", QString lversion="", QString lscreenshot="", QString lfanart="", QString lboxart="", QString linetref="")
Definition: rominfo.h:16
QString Genre() const
Definition: rominfo.h:100
int DiskCount() const
Definition: rominfo.h:115
void setCountry(const QString &lcountry)
Definition: rominfo.h:104
bool operator==(const RomInfo &a, const RomInfo &b)
Definition: rominfo.cpp:12
QString Fanart() const
Definition: rominfo.h:85
void setFanart(const QString &lfanart)
Definition: rominfo.h:86
QString m_country
Definition: rominfo.h:154
QString Inetref() const
Definition: rominfo.h:133
QString GameType() const
Definition: rominfo.h:106
int Id() const
Definition: rominfo.h:76
void setYear(const QString &lyear)
Definition: rominfo.h:131
QString m_fanart
Definition: rominfo.h:167
QString Publisher() const
Definition: rominfo.h:124
QString m_system
Definition: rominfo.h:151
void setGenre(const QString &lgenre)
Definition: rominfo.h:101
RomInfo(const RomInfo &lhs)
Definition: rominfo.h:47
QString m_screenshot
Definition: rominfo.h:166
void SaveToDatabase()
Definition: rominfo.cpp:17
void setGamename(const QString &lgamename)
Definition: rominfo.h:98
QString System() const
Definition: rominfo.h:94
QString getExtension()
Definition: rominfo.cpp:234
int Favorite() const
Definition: rominfo.h:136
void setSystem(const QString &lsystem)
Definition: rominfo.h:95
void setCRC_VALUE(const QString &lcrc_value)
Definition: rominfo.h:119
QString m_rompath
Definition: rominfo.h:165