Merge pull request #26117 from notspiff/infoscanner_inforet_enum_class
[xbmc.git] / xbmc / addons / settings / SettingUrlEncodedString.cpp
blobf09875f16ab36b3fa4e78cc879ce5e1b8a976717
1 /*
2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "SettingUrlEncodedString.h"
11 #include "URL.h"
12 #include "settings/lib/SettingsManager.h"
14 namespace ADDON
17 CSettingUrlEncodedString::CSettingUrlEncodedString(
18 const std::string& id, CSettingsManager* settingsManager /* = nullptr */)
19 : CSettingString(id, settingsManager)
20 { }
22 CSettingUrlEncodedString::CSettingUrlEncodedString(
23 const std::string& id,
24 int label,
25 const std::string& value,
26 CSettingsManager* settingsManager /* = nullptr */)
27 : CSettingString(id, label, value, settingsManager)
28 { }
30 CSettingUrlEncodedString::CSettingUrlEncodedString(const std::string &id, const CSettingUrlEncodedString &setting)
31 : CSettingString(id, setting)
32 { }
34 std::string CSettingUrlEncodedString::GetDecodedValue() const
36 return CURL::Decode(CSettingString::GetValue());
39 bool CSettingUrlEncodedString::SetDecodedValue(const std::string &decodedValue)
41 return CSettingString::SetValue(CURL::Encode(decodedValue));
44 } /* namespace ADDON */