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_crcValue = 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;
63  m_crcValue = lhs.m_crcValue;
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_crcValue; }
121  void setCRC_VALUE(const QString &lcrc_value) { m_crcValue = 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_crcValue;
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
RomInfo::m_favorite
bool m_favorite
Definition: rominfo.h:166
RomInfo::CRC_VALUE
QString CRC_VALUE() const
Definition: rominfo.h:120
RomInfo::Boxart
QString Boxart() const
Definition: rominfo.h:90
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
RomInfo::setId
void setId(const int &lid)
Definition: rominfo.h:79
RomInfo::setGameType
void setGameType(const QString &lgametype)
Definition: rominfo.h:109
RomInfo::m_id
int m_id
Definition: rominfo.h:151
RomInfo::m_publisher
QString m_publisher
Definition: rominfo.h:161
RomInfo::Id
int Id() const
Definition: rominfo.h:78
RomInfo::Plot
QString Plot() const
Definition: rominfo.h:123
RomInfo::FindImage
static bool FindImage(QString BaseFileName, QString *result)
Definition: rominfo.cpp:141
RomInfo::~RomInfo
~RomInfo()=default
RomInfo::AllSystems
QString AllSystems() const
Definition: rominfo.h:114
RomInfo::Country
QString Country() const
Definition: rominfo.h:105
RomInfo::Gamename
QString Gamename() const
Definition: rominfo.h:99
RomInfo::Favorite
bool Favorite() const
Definition: rominfo.h:138
RomInfo::RomCount
int RomCount() const
Definition: rominfo.h:111
RomInfo::setBoxart
void setBoxart(const QString &lboxart)
Definition: rominfo.h:91
RomInfo::setCountry
void setCountry(const QString &lcountry)
Definition: rominfo.h:106
RomInfo::GetAllRomInfo
static QList< RomInfo * > GetAllRomInfo()
Definition: rominfo.cpp:320
RomInfo::Genre
QString Genre() const
Definition: rominfo.h:102
RomInfo::Version
QString Version() const
Definition: rominfo.h:129
RomInfo::setSystem
void setSystem(const QString &lsystem)
Definition: rominfo.h:97
RomInfo::System
QString System() const
Definition: rominfo.h:96
RomInfo::m_country
QString m_country
Definition: rominfo.h:156
RomInfo::m_crcValue
QString m_crcValue
Definition: rominfo.h:157
RomInfo::m_plot
QString m_plot
Definition: rominfo.h:160
RomInfo::m_romname
QString m_romname
Definition: rominfo.h:152
RomInfo::Screenshot
QString Screenshot() const
Definition: rominfo.h:84
RomInfo::m_inetref
QString m_inetref
Definition: rominfo.h:171
RomInfo::RomInfo
RomInfo(const RomInfo &lhs)
Definition: rominfo.h:49
RomInfo::fillData
void fillData()
Definition: rominfo.cpp:247
RomInfo::m_screenshot
QString m_screenshot
Definition: rominfo.h:168
RomInfo::setInetref
void setInetref(const QString &linetref)
Definition: rominfo.h:136
RomInfo::setGamename
void setGamename(const QString &lgamename)
Definition: rominfo.h:100
RomInfo::Rompath
QString Rompath() const
Definition: rominfo.h:81
RomInfo::setAllSystems
void setAllSystems(const QString &lallsystems)
Definition: rominfo.h:115
RomInfo::setDiskCount
void setDiskCount(const int &ldiskcount)
Definition: rominfo.h:118
RomInfo::setVersion
void setVersion(const QString &lversion)
Definition: rominfo.h:130
RomInfo::m_rompath
QString m_rompath
Definition: rominfo.h:167
RomInfo::setPublisher
void setPublisher(const QString &lpublisher)
Definition: rominfo.h:127
RomInfo::setFavorite
void setFavorite(bool updateDatabase=false)
Definition: rominfo.cpp:213
RomInfo::m_year
QString m_year
Definition: rominfo.h:165
RomInfo::setFanart
void setFanart(const QString &lfanart)
Definition: rominfo.h:88
RomInfo::m_gamename
QString m_gamename
Definition: rominfo.h:154
RomInfo::setPlot
void setPlot(const QString &lplot)
Definition: rominfo.h:124
RomInfo::m_genre
QString m_genre
Definition: rominfo.h:155
RomInfo::GetRomInfoById
static RomInfo * GetRomInfoById(int id)
Definition: rominfo.cpp:368
RomInfo::Publisher
QString Publisher() const
Definition: rominfo.h:126
RomInfo::setRomname
void setRomname(const QString &lromname)
Definition: rominfo.h:94
RomInfo::setRompath
void setRompath(const QString &lrompath)
Definition: rominfo.h:82
RomInfo
Definition: rominfo.h:13
RomInfo::DiskCount
int DiskCount() const
Definition: rominfo.h:117
RomInfo::setCRC_VALUE
void setCRC_VALUE(const QString &lcrc_value)
Definition: rominfo.h:121
RomInfo::m_gametype
QString m_gametype
Definition: rominfo.h:158
RomInfo::m_boxart
QString m_boxart
Definition: rominfo.h:170
RomInfo::Fanart
QString Fanart() const
Definition: rominfo.h:87
operator==
bool operator==(const RomInfo &a, const RomInfo &b)
Definition: rominfo.cpp:12
RomInfo::getExtension
QString getExtension() const
Definition: rominfo.cpp:234
RomInfo::setYear
void setYear(const QString &lyear)
Definition: rominfo.h:133
RomInfo::toString
QString toString() const
Definition: rominfo.cpp:416
RomInfo::DeleteFromDatabase
void DeleteFromDatabase() const
Definition: rominfo.cpp:94
RomInfo::setRomCount
void setRomCount(const int &lromcount)
Definition: rominfo.h:112
RomInfo::SaveToDatabase
void SaveToDatabase() const
Definition: rominfo.cpp:17
RomInfo::RomInfo
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
RomInfo::setField
void setField(const QString &field, const QString &data)
Definition: rominfo.cpp:172
romInDB
int romInDB(const QString &rom, const QString &gametype)
Definition: rominfo.cpp:114
RomInfo::m_version
QString m_version
Definition: rominfo.h:162
RomInfo::m_allsystems
QString m_allsystems
Definition: rominfo.h:159
RomInfo::m_diskcount
int m_diskcount
Definition: rominfo.h:164
RomInfo::setScreenshot
void setScreenshot(const QString &lscreenshot)
Definition: rominfo.h:85
RomInfo::GameType
QString GameType() const
Definition: rominfo.h:108
RomInfo::m_fanart
QString m_fanart
Definition: rominfo.h:169
RomInfo::Inetref
QString Inetref() const
Definition: rominfo.h:135
RomInfo::Year
QString Year() const
Definition: rominfo.h:132
RomInfo::Romname
QString Romname() const
Definition: rominfo.h:93
RomInfo::m_system
QString m_system
Definition: rominfo.h:153
RomInfo::setGenre
void setGenre(const QString &lgenre)
Definition: rominfo.h:103
RomInfo::m_romcount
int m_romcount
Definition: rominfo.h:163