kodi
SettingUtils.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 <memory>
12 #include <vector>
13 
14 class CVariant;
15 class CSettingList;
16 class CSetting;
17 
19 {
20 public:
27  static std::vector<CVariant> GetList(const std::shared_ptr<const CSettingList>& settingList);
35  static bool SetList(const std::shared_ptr<CSettingList>& settingList,
36  const std::vector<CVariant>& value);
37 
38  static std::vector<CVariant> ListToValues(const std::shared_ptr<const CSettingList>& setting,
39  const std::vector<std::shared_ptr<CSetting>>& values);
40  static bool ValuesToList(const std::shared_ptr<const CSettingList>& setting,
41  const std::vector<CVariant>& values,
42  std::vector<std::shared_ptr<CSetting>>& newValues);
43 
51  static bool FindIntInList(const std::shared_ptr<const CSettingList>& settingList, int value);
52 };
static std::vector< CVariant > GetList(const std::shared_ptr< const CSettingList > &settingList)
Gets the values of the given list setting.
Definition: SettingUtils.cpp:17
List setting implementation.
Definition: Setting.h:168
static bool FindIntInList(const std::shared_ptr< const CSettingList > &settingList, int value)
Search in a list of Ints for a given value.
Definition: SettingUtils.cpp:129
Setting base class containing all the properties which are common to all settings independent of the ...
Definition: Setting.h:46
Definition: Variant.h:31
Definition: SettingUtils.h:18
static bool SetList(const std::shared_ptr< CSettingList > &settingList, const std::vector< CVariant > &value)
Sets the values of the given list setting.
Definition: SettingUtils.cpp:22