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  : m_id(lid),
26  m_romname(std::move(lromname)),
27  m_system(std::move(lsystem)),
28  m_gamename(std::move(lgamename)),
29  m_genre(std::move(lgenre)),
30  m_country(std::move(lcountry)),
31  m_crcValue(std::move(lcrc_value)),
32  m_gametype(std::move(lgametype)),
33  m_allsystems(std::move(lallsystems)),
34  m_plot(std::move(lplot)),
35  m_publisher(std::move(lpublisher)),
36  m_version(std::move(lversion)),
37  m_romcount(lromcount),
38  m_diskcount(ldiskcount),
39  m_year(std::move(lyear)),
40  m_favorite(lfavorite),
41  m_rompath(std::move(lrompath)),
42  m_screenshot(std::move(lscreenshot)),
43  m_fanart(std::move(lfanart)),
44  m_boxart(std::move(lboxart)),
45  m_inetref(std::move(linetref))
46  {
47  }
48 
49  RomInfo(const RomInfo &lhs) = default;
50 
51  ~RomInfo() = default;
52 
53  static bool FindImage(QString BaseFileName, QString *result);
54 
55  int Id() const { return m_id; }
56  void setId(int lid) { m_id = lid; }
57 
58  QString Rompath() const { return m_rompath; }
59  void setRompath(const QString &lrompath) { m_rompath = lrompath; }
60 
61  QString Screenshot() const { return m_screenshot; }
62  void setScreenshot(const QString &lscreenshot) { m_screenshot = lscreenshot; }
63 
64  QString Fanart() const { return m_fanart; }
65  void setFanart(const QString &lfanart) { m_fanart = lfanart; }
66 
67  QString Boxart() const { return m_boxart; }
68  void setBoxart(const QString &lboxart) { m_boxart = lboxart; }
69 
70  QString Romname() const { return m_romname; }
71  void setRomname(const QString &lromname) { m_romname = lromname; }
72 
73  QString System() const { return m_system; }
74  void setSystem(const QString &lsystem) { m_system = lsystem; }
75 
76  QString Gamename() const { return m_gamename; }
77  void setGamename(const QString &lgamename) { m_gamename = lgamename; }
78 
79  QString Genre() const { return m_genre; }
80  void setGenre(const QString &lgenre) { m_genre = lgenre; }
81 
82  QString Country() const { return m_country; }
83  void setCountry(const QString &lcountry) { m_country = lcountry; }
84 
85  QString GameType() const { return m_gametype; }
86  void setGameType(const QString &lgametype) { m_gametype = lgametype; }
87 
88  int RomCount() const { return m_romcount; }
89  void setRomCount(int lromcount) { m_romcount = lromcount; }
90 
91  QString AllSystems() const { return m_allsystems; }
92  void setAllSystems(const QString &lallsystems) { m_allsystems = lallsystems; }
93 
94  int DiskCount() const { return m_diskcount; }
95  void setDiskCount(int ldiskcount) { m_diskcount = ldiskcount; }
96 
97  QString CRC_VALUE() const { return m_crcValue; }
98  void setCRC_VALUE(const QString &lcrc_value) { m_crcValue = lcrc_value; }
99 
100  QString Plot() const { return m_plot; }
101  void setPlot(const QString &lplot) { m_plot = lplot; }
102 
103  QString Publisher() const { return m_publisher; }
104  void setPublisher(const QString &lpublisher) { m_publisher = lpublisher; }
105 
106  QString Version() const { return m_version; }
107  void setVersion(const QString &lversion) { m_version = lversion; }
108 
109  QString Year() const { return m_year; }
110  void setYear(const QString &lyear) { m_year = lyear; }
111 
112  QString Inetref() const { return m_inetref; }
113  void setInetref(const QString &linetref) { m_inetref = linetref; }
114 
115  bool Favorite() const { return m_favorite; }
116  void setFavorite(bool updateDatabase = false);
117 
118  QString getExtension() const;
119  QString toString() const;
120 
121  void setField(const QString& field, const QString& data);
122  void fillData();
123 
124  void SaveToDatabase() const;
125  void DeleteFromDatabase() const;
126 
127  protected:
128  int m_id;
129  QString m_romname;
130  QString m_system;
131  QString m_gamename;
132  QString m_genre;
133  QString m_country;
134  QString m_crcValue;
135  QString m_gametype;
136  QString m_allsystems;
137  QString m_plot;
138  QString m_publisher;
139  QString m_version;
142  QString m_year;
144  QString m_rompath;
145  QString m_screenshot;
146  QString m_fanart;
147  QString m_boxart;
148  QString m_inetref;
149 };
150 
151 bool operator==(const RomInfo& a, const RomInfo& b);
152 
154 
155 #endif
RomInfo::m_favorite
bool m_favorite
Definition: rominfo.h:143
RomInfo::CRC_VALUE
QString CRC_VALUE() const
Definition: rominfo.h:97
RomInfo::Boxart
QString Boxart() const
Definition: rominfo.h:67
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
RomInfo::setGameType
void setGameType(const QString &lgametype)
Definition: rominfo.h:86
RomInfo::m_id
int m_id
Definition: rominfo.h:128
RomInfo::m_publisher
QString m_publisher
Definition: rominfo.h:138
RomInfo::Id
int Id() const
Definition: rominfo.h:55
RomInfo::Plot
QString Plot() const
Definition: rominfo.h:100
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:91
RomInfo::Country
QString Country() const
Definition: rominfo.h:82
RomInfo::Gamename
QString Gamename() const
Definition: rominfo.h:76
RomInfo::Favorite
bool Favorite() const
Definition: rominfo.h:115
RomInfo::RomCount
int RomCount() const
Definition: rominfo.h:88
RomInfo::setBoxart
void setBoxart(const QString &lboxart)
Definition: rominfo.h:68
RomInfo::setCountry
void setCountry(const QString &lcountry)
Definition: rominfo.h:83
RomInfo::GetAllRomInfo
static QList< RomInfo * > GetAllRomInfo()
Definition: rominfo.cpp:317
RomInfo::Genre
QString Genre() const
Definition: rominfo.h:79
RomInfo::Version
QString Version() const
Definition: rominfo.h:106
RomInfo::RomInfo
RomInfo(const RomInfo &lhs)=default
RomInfo::setSystem
void setSystem(const QString &lsystem)
Definition: rominfo.h:74
RomInfo::System
QString System() const
Definition: rominfo.h:73
RomInfo::m_country
QString m_country
Definition: rominfo.h:133
RomInfo::setId
void setId(int lid)
Definition: rominfo.h:56
RomInfo::m_crcValue
QString m_crcValue
Definition: rominfo.h:134
RomInfo::m_plot
QString m_plot
Definition: rominfo.h:137
RomInfo::m_romname
QString m_romname
Definition: rominfo.h:129
RomInfo::Screenshot
QString Screenshot() const
Definition: rominfo.h:61
RomInfo::m_inetref
QString m_inetref
Definition: rominfo.h:148
RomInfo::fillData
void fillData()
Definition: rominfo.cpp:244
RomInfo::m_screenshot
QString m_screenshot
Definition: rominfo.h:145
RomInfo::setInetref
void setInetref(const QString &linetref)
Definition: rominfo.h:113
RomInfo::setGamename
void setGamename(const QString &lgamename)
Definition: rominfo.h:77
RomInfo::Rompath
QString Rompath() const
Definition: rominfo.h:58
RomInfo::setAllSystems
void setAllSystems(const QString &lallsystems)
Definition: rominfo.h:92
RomInfo::setVersion
void setVersion(const QString &lversion)
Definition: rominfo.h:107
RomInfo::m_rompath
QString m_rompath
Definition: rominfo.h:144
RomInfo::setPublisher
void setPublisher(const QString &lpublisher)
Definition: rominfo.h:104
RomInfo::setFavorite
void setFavorite(bool updateDatabase=false)
Definition: rominfo.cpp:210
RomInfo::m_year
QString m_year
Definition: rominfo.h:142
RomInfo::setFanart
void setFanart(const QString &lfanart)
Definition: rominfo.h:65
RomInfo::m_gamename
QString m_gamename
Definition: rominfo.h:131
RomInfo::setPlot
void setPlot(const QString &lplot)
Definition: rominfo.h:101
RomInfo::m_genre
QString m_genre
Definition: rominfo.h:132
RomInfo::GetRomInfoById
static RomInfo * GetRomInfoById(int id)
Definition: rominfo.cpp:365
RomInfo::setDiskCount
void setDiskCount(int ldiskcount)
Definition: rominfo.h:95
RomInfo::Publisher
QString Publisher() const
Definition: rominfo.h:103
RomInfo::setRomname
void setRomname(const QString &lromname)
Definition: rominfo.h:71
RomInfo::setRompath
void setRompath(const QString &lrompath)
Definition: rominfo.h:59
RomInfo
Definition: rominfo.h:13
RomInfo::DiskCount
int DiskCount() const
Definition: rominfo.h:94
RomInfo::setCRC_VALUE
void setCRC_VALUE(const QString &lcrc_value)
Definition: rominfo.h:98
RomInfo::m_gametype
QString m_gametype
Definition: rominfo.h:135
RomInfo::m_boxart
QString m_boxart
Definition: rominfo.h:147
RomInfo::Fanart
QString Fanart() const
Definition: rominfo.h:64
RomInfo::setRomCount
void setRomCount(int lromcount)
Definition: rominfo.h:89
operator==
bool operator==(const RomInfo &a, const RomInfo &b)
Definition: rominfo.cpp:12
RomInfo::getExtension
QString getExtension() const
Definition: rominfo.cpp:231
RomInfo::setYear
void setYear(const QString &lyear)
Definition: rominfo.h:110
RomInfo::toString
QString toString() const
Definition: rominfo.cpp:413
RomInfo::DeleteFromDatabase
void DeleteFromDatabase() const
Definition: rominfo.cpp:94
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:169
romInDB
int romInDB(const QString &rom, const QString &gametype)
Definition: rominfo.cpp:114
RomInfo::m_version
QString m_version
Definition: rominfo.h:139
RomInfo::m_allsystems
QString m_allsystems
Definition: rominfo.h:136
RomInfo::m_diskcount
int m_diskcount
Definition: rominfo.h:141
RomInfo::setScreenshot
void setScreenshot(const QString &lscreenshot)
Definition: rominfo.h:62
RomInfo::GameType
QString GameType() const
Definition: rominfo.h:85
RomInfo::m_fanart
QString m_fanart
Definition: rominfo.h:146
RomInfo::Inetref
QString Inetref() const
Definition: rominfo.h:112
RomInfo::Year
QString Year() const
Definition: rominfo.h:109
RomInfo::Romname
QString Romname() const
Definition: rominfo.h:70
RomInfo::m_system
QString m_system
Definition: rominfo.h:130
RomInfo::setGenre
void setGenre(const QString &lgenre)
Definition: rominfo.h:80
RomInfo::m_romcount
int m_romcount
Definition: rominfo.h:140