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