xbmc
GameInfoTag.h
1 /*
2  * Copyright (C) 2012-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "utils/IArchivable.h"
12 #include "utils/ISerializable.h"
13 #include "utils/ISortable.h"
14 
15 #include <string>
16 
17 namespace KODI
18 {
19 namespace GAME
20 {
24 class CGameInfoTag : public IArchivable, public ISerializable, public ISortable
25 {
26 public:
27  CGameInfoTag() { Reset(); }
28  CGameInfoTag(const CGameInfoTag& tag) { *this = tag; }
29  CGameInfoTag& operator=(const CGameInfoTag& tag);
30  virtual ~CGameInfoTag() = default;
31  void Reset();
32 
33  bool operator==(const CGameInfoTag& tag) const;
34  bool operator!=(const CGameInfoTag& tag) const { return !(*this == tag); }
35 
36  bool IsLoaded() const { return m_bLoaded; }
37  void SetLoaded(bool bOnOff = true) { m_bLoaded = bOnOff; }
38 
39  // File path
40  const std::string& GetURL() const { return m_strURL; }
41  void SetURL(const std::string& strURL) { m_strURL = strURL; }
42 
43  // Title
44  const std::string& GetTitle() const { return m_strTitle; }
45  void SetTitle(const std::string& strTitle) { m_strTitle = strTitle; }
46 
47  // Platform
48  const std::string& GetPlatform() const { return m_strPlatform; }
49  void SetPlatform(const std::string& strPlatform) { m_strPlatform = strPlatform; }
50 
51  // Genres
52  const std::vector<std::string>& GetGenres() const { return m_genres; }
53  void SetGenres(const std::vector<std::string>& genres) { m_genres = genres; }
54 
55  // Developer
56  const std::string& GetDeveloper() const { return m_strDeveloper; }
57  void SetDeveloper(const std::string& strDeveloper) { m_strDeveloper = strDeveloper; }
58 
59  // Overview
60  const std::string& GetOverview() const { return m_strOverview; }
61  void SetOverview(const std::string& strOverview) { m_strOverview = strOverview; }
62 
63  // Year
64  unsigned int GetYear() const { return m_year; }
65  void SetYear(unsigned int year) { m_year = year; }
66 
67  // Game Code (ID)
68  const std::string& GetID() const { return m_strID; }
69  void SetID(const std::string& strID) { m_strID = strID; }
70 
71  // Region
72  const std::string& GetRegion() const { return m_strRegion; }
73  void SetRegion(const std::string& strRegion) { m_strRegion = strRegion; }
74 
75  // Publisher / Licensee
76  const std::string& GetPublisher() const { return m_strPublisher; }
77  void SetPublisher(const std::string& strPublisher) { m_strPublisher = strPublisher; }
78 
79  // Format (PAL/NTSC)
80  const std::string& GetFormat() const { return m_strFormat; }
81  void SetFormat(const std::string& strFormat) { m_strFormat = strFormat; }
82 
83  // Cartridge Type, e.g. "ROM+MBC5+RAM+BATT" or "CD"
84  const std::string& GetCartridgeType() const { return m_strCartridgeType; }
85  void SetCartridgeType(const std::string& strCartridgeType)
86  {
87  m_strCartridgeType = strCartridgeType;
88  }
89 
90  // Game client add-on ID
91  const std::string& GetGameClient() const { return m_strGameClient; }
92  void SetGameClient(const std::string& strGameClient) { m_strGameClient = strGameClient; }
93 
94  // Caption
95  const std::string& GetCaption() const { return m_strCaption; }
96  void SetCaption(const std::string& strCaption) { m_strCaption = strCaption; }
97 
98  void Archive(CArchive& ar) override;
99  void Serialize(CVariant& value) const override;
100  void ToSortable(SortItem& sortable, Field field) const override;
101 
102 private:
103  bool m_bLoaded;
104  std::string m_strURL;
105  std::string m_strTitle;
106  std::string m_strPlatform;
107  std::vector<std::string> m_genres;
108  std::string m_strDeveloper;
109  std::string m_strOverview;
110  unsigned int m_year;
111  std::string m_strID;
112  std::string m_strRegion;
113  std::string m_strPublisher;
114  std::string m_strFormat;
115  std::string m_strCartridgeType;
116  std::string m_strGameClient;
117  std::string m_strCaption;
118 };
119 } // namespace GAME
120 } // namespace KODI
Definition: GameInfoTag.h:24
Definition: Variant.h:31
Definition: ISerializable.h:13
Definition: AudioDecoder.h:18
Definition: Archive.h:29
Definition: ISortable.h:15
Definition: IArchivable.h:13