xbmc
SettingUpdate.h
1 /*
2  * Copyright (C) 2013-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/logtypes.h"
12 
13 #include <string>
14 
15 class TiXmlNode;
16 
17 enum class SettingUpdateType {
18  Unknown = 0,
19  Rename,
20  Change
21 };
22 
24 {
25 public:
27  virtual ~CSettingUpdate() = default;
28 
29  inline bool operator<(const CSettingUpdate& rhs) const
30  {
31  return m_type < rhs.m_type && m_value < rhs.m_value;
32  }
33 
34  virtual bool Deserialize(const TiXmlNode *node);
35 
36  SettingUpdateType GetType() const { return m_type; }
37  const std::string& GetValue() const { return m_value; }
38 
39 private:
40  bool setType(const std::string &type);
41 
42  SettingUpdateType m_type = SettingUpdateType::Unknown;
43  std::string m_value;
44 
45  static Logger s_logger;
46 };
Definition: SettingUpdate.h:23