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 {
21 class CGameInfoTag : public IArchivable, public ISerializable, public ISortable
22 {
23 public:
24  CGameInfoTag() { Reset(); }
25  CGameInfoTag(const CGameInfoTag& tag) { *this = tag; }
26  CGameInfoTag& operator=(const CGameInfoTag& tag);
27  virtual ~CGameInfoTag() = default;
28  void Reset();
29 
30  bool operator==(const CGameInfoTag& tag) const;
31  bool operator!=(const CGameInfoTag& tag) const { return !(*this == tag); }
32 
33  bool IsLoaded() const { return m_bLoaded; }
34  void SetLoaded(bool bOnOff = true) { m_bLoaded = bOnOff; }
35 
36  // File path
37  const std::string& GetURL() const { return m_strURL; }
38  void SetURL(const std::string& strURL) { m_strURL = strURL; }
39 
40  // Title
41  const std::string& GetTitle() const { return m_strTitle; }
42  void SetTitle(const std::string& strTitle) { m_strTitle = strTitle; }
43 
44  // Platform
45  const std::string& GetPlatform() const { return m_strPlatform; }
46  void SetPlatform(const std::string& strPlatform) { m_strPlatform = strPlatform; }
47 
48  // Genres
49  const std::vector<std::string>& GetGenres() const { return m_genres; }
50  void SetGenres(const std::vector<std::string>& genres) { m_genres = genres; }
51 
52  // Developer
53  const std::string& GetDeveloper() const { return m_strDeveloper; }
54  void SetDeveloper(const std::string& strDeveloper) { m_strDeveloper = strDeveloper; }
55 
56  // Overview
57  const std::string& GetOverview() const { return m_strOverview; }
58  void SetOverview(const std::string& strOverview) { m_strOverview = strOverview; }
59 
60  // Year
61  unsigned int GetYear() const { return m_year; }
62  void SetYear(unsigned int year) { m_year = year; }
63 
64  // Game Code (ID)
65  const std::string& GetID() const { return m_strID; }
66  void SetID(const std::string& strID) { m_strID = strID; }
67 
68  // Region
69  const std::string& GetRegion() const { return m_strRegion; }
70  void SetRegion(const std::string& strRegion) { m_strRegion = strRegion; }
71 
72  // Publisher / Licensee
73  const std::string& GetPublisher() const { return m_strPublisher; }
74  void SetPublisher(const std::string& strPublisher) { m_strPublisher = strPublisher; }
75 
76  // Format (PAL/NTSC)
77  const std::string& GetFormat() const { return m_strFormat; }
78  void SetFormat(const std::string& strFormat) { m_strFormat = strFormat; }
79 
80  // Cartridge Type, e.g. "ROM+MBC5+RAM+BATT" or "CD"
81  const std::string& GetCartridgeType() const { return m_strCartridgeType; }
82  void SetCartridgeType(const std::string& strCartridgeType)
83  {
84  m_strCartridgeType = strCartridgeType;
85  }
86 
87  // Game client add-on ID
88  const std::string& GetGameClient() const { return m_strGameClient; }
89  void SetGameClient(const std::string& strGameClient) { m_strGameClient = strGameClient; }
90 
91  void Archive(CArchive& ar) override;
92  void Serialize(CVariant& value) const override;
93  void ToSortable(SortItem& sortable, Field field) const override;
94 
95 private:
96  bool m_bLoaded;
97  std::string m_strURL;
98  std::string m_strTitle;
99  std::string m_strPlatform;
100  std::vector<std::string> m_genres;
101  std::string m_strDeveloper;
102  std::string m_strOverview;
103  unsigned int m_year;
104  std::string m_strID;
105  std::string m_strRegion;
106  std::string m_strPublisher;
107  std::string m_strFormat;
108  std::string m_strCartridgeType;
109  std::string m_strGameClient;
110 };
111 } // namespace GAME
112 } // namespace KODI
Definition: GameInfoTag.h:21
Definition: Variant.h:29
Definition: ISerializable.h:13
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: Archive.h:29
Definition: ISortable.h:15
Definition: IArchivable.h:13