mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Common/IniFile: Move interface into Common namespace
Gets this out of the global namespace and into the Common namespace
This commit is contained in:
@ -50,7 +50,7 @@ void ControlGroup::AddDeadzoneSetting(SettingValue<double>* value, double maximu
|
||||
|
||||
ControlGroup::~ControlGroup() = default;
|
||||
|
||||
void ControlGroup::LoadConfig(IniFile::Section* sec, const std::string& defdev,
|
||||
void ControlGroup::LoadConfig(Common::IniFile::Section* sec, const std::string& defdev,
|
||||
const std::string& base)
|
||||
{
|
||||
const std::string group(base + name + "/");
|
||||
@ -103,7 +103,7 @@ void ControlGroup::LoadConfig(IniFile::Section* sec, const std::string& defdev,
|
||||
}
|
||||
}
|
||||
|
||||
void ControlGroup::SaveConfig(IniFile::Section* sec, const std::string& defdev,
|
||||
void ControlGroup::SaveConfig(Common::IniFile::Section* sec, const std::string& defdev,
|
||||
const std::string& base)
|
||||
{
|
||||
const std::string group(base + name + "/");
|
||||
|
@ -68,9 +68,9 @@ public:
|
||||
DefaultValue default_value = DefaultValue::AlwaysEnabled);
|
||||
virtual ~ControlGroup();
|
||||
|
||||
virtual void LoadConfig(IniFile::Section* sec, const std::string& defdev = "",
|
||||
virtual void LoadConfig(Common::IniFile::Section* sec, const std::string& defdev = "",
|
||||
const std::string& base = "");
|
||||
virtual void SaveConfig(IniFile::Section* sec, const std::string& defdev = "",
|
||||
virtual void SaveConfig(Common::IniFile::Section* sec, const std::string& defdev = "",
|
||||
const std::string& base = "");
|
||||
|
||||
void SetControlExpression(int index, const std::string& expression);
|
||||
|
@ -139,7 +139,7 @@ void EmulatedController::SetDefaultDevice(ciface::Core::DeviceQualifier devq)
|
||||
}
|
||||
}
|
||||
|
||||
void EmulatedController::LoadConfig(IniFile::Section* sec, const std::string& base)
|
||||
void EmulatedController::LoadConfig(Common::IniFile::Section* sec, const std::string& base)
|
||||
{
|
||||
const auto lock = GetStateLock();
|
||||
std::string defdev = GetDefaultDevice().ToString();
|
||||
@ -153,7 +153,7 @@ void EmulatedController::LoadConfig(IniFile::Section* sec, const std::string& ba
|
||||
cg->LoadConfig(sec, defdev, base);
|
||||
}
|
||||
|
||||
void EmulatedController::SaveConfig(IniFile::Section* sec, const std::string& base)
|
||||
void EmulatedController::SaveConfig(Common::IniFile::Section* sec, const std::string& base)
|
||||
{
|
||||
const auto lock = GetStateLock();
|
||||
const std::string defdev = GetDefaultDevice().ToString();
|
||||
@ -168,7 +168,7 @@ void EmulatedController::LoadDefaults(const ControllerInterface& ciface)
|
||||
{
|
||||
const auto lock = GetStateLock();
|
||||
// load an empty inifile section, clears everything
|
||||
IniFile::Section sec;
|
||||
Common::IniFile::Section sec;
|
||||
LoadConfig(&sec);
|
||||
|
||||
const std::string& default_device_string = ciface.GetDefaultDeviceString();
|
||||
|
@ -182,8 +182,8 @@ public:
|
||||
|
||||
virtual void LoadDefaults(const ControllerInterface& ciface);
|
||||
|
||||
virtual void LoadConfig(IniFile::Section* sec, const std::string& base = "");
|
||||
virtual void SaveConfig(IniFile::Section* sec, const std::string& base = "");
|
||||
virtual void LoadConfig(Common::IniFile::Section* sec, const std::string& base = "");
|
||||
virtual void SaveConfig(Common::IniFile::Section* sec, const std::string& base = "");
|
||||
|
||||
bool IsDefaultDeviceConnected() const;
|
||||
const ciface::Core::DeviceQualifier& GetDefaultDevice() const;
|
||||
|
@ -60,8 +60,10 @@ public:
|
||||
|
||||
virtual ~NumericSettingBase() = default;
|
||||
|
||||
virtual void LoadFromIni(const IniFile::Section& section, const std::string& group_name) = 0;
|
||||
virtual void SaveToIni(IniFile::Section& section, const std::string& group_name) const = 0;
|
||||
virtual void LoadFromIni(const Common::IniFile::Section& section,
|
||||
const std::string& group_name) = 0;
|
||||
virtual void SaveToIni(Common::IniFile::Section& section,
|
||||
const std::string& group_name) const = 0;
|
||||
|
||||
virtual InputReference& GetInputReference() = 0;
|
||||
virtual const InputReference& GetInputReference() const = 0;
|
||||
@ -111,7 +113,7 @@ public:
|
||||
|
||||
void SetToDefault() override { m_value.SetValue(m_default_value); }
|
||||
|
||||
void LoadFromIni(const IniFile::Section& section, const std::string& group_name) override
|
||||
void LoadFromIni(const Common::IniFile::Section& section, const std::string& group_name) override
|
||||
{
|
||||
std::string str_value;
|
||||
if (section.Get(group_name + m_details.ini_name, &str_value))
|
||||
@ -125,7 +127,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SaveToIni(IniFile::Section& section, const std::string& group_name) const override
|
||||
void SaveToIni(Common::IniFile::Section& section, const std::string& group_name) const override
|
||||
{
|
||||
if (IsSimpleValue())
|
||||
{
|
||||
|
@ -226,8 +226,8 @@ void ReshapableInput::SetCenter(ReshapableInput::ReshapeData center)
|
||||
m_center = center;
|
||||
}
|
||||
|
||||
void ReshapableInput::LoadConfig(IniFile::Section* section, const std::string& default_device,
|
||||
const std::string& base_name)
|
||||
void ReshapableInput::LoadConfig(Common::IniFile::Section* section,
|
||||
const std::string& default_device, const std::string& base_name)
|
||||
{
|
||||
ControlGroup::LoadConfig(section, default_device, base_name);
|
||||
|
||||
@ -269,8 +269,8 @@ void ReshapableInput::LoadConfig(IniFile::Section* section, const std::string& d
|
||||
}
|
||||
}
|
||||
|
||||
void ReshapableInput::SaveConfig(IniFile::Section* section, const std::string& default_device,
|
||||
const std::string& base_name)
|
||||
void ReshapableInput::SaveConfig(Common::IniFile::Section* section,
|
||||
const std::string& default_device, const std::string& base_name)
|
||||
{
|
||||
ControlGroup::SaveConfig(section, default_device, base_name);
|
||||
|
||||
|
@ -117,8 +117,8 @@ protected:
|
||||
virtual Control* GetModifierInput() const;
|
||||
|
||||
private:
|
||||
void LoadConfig(IniFile::Section*, const std::string&, const std::string&) override;
|
||||
void SaveConfig(IniFile::Section*, const std::string&, const std::string&) override;
|
||||
void LoadConfig(Common::IniFile::Section*, const std::string&, const std::string&) override;
|
||||
void SaveConfig(Common::IniFile::Section*, const std::string&, const std::string&) override;
|
||||
|
||||
CalibrationData m_calibration;
|
||||
SettingValue<double> m_deadzone_setting;
|
||||
|
Reference in New Issue
Block a user