diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index 6ce08f6579..e7292438ef 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -4,24 +4,18 @@ // Thanks to Treeki for writing the original class - 29/01/2012 +#include "Common/SettingsHandler.h" + #include -#include -#include #include #include #include #include -#ifdef _WIN32 -#include -#include -#include -#endif - #include "Common/CommonTypes.h" -#include "Common/SettingsHandler.h" -#include "Common/Timer.h" +namespace Common +{ SettingsHandler::SettingsHandler() { Reset(); @@ -37,7 +31,7 @@ const SettingsHandler::Buffer& SettingsHandler::GetBytes() const return m_buffer; } -void SettingsHandler::SetBytes(SettingsHandler::Buffer&& buffer) +void SettingsHandler::SetBytes(Buffer&& buffer) { Reset(); m_buffer = std::move(buffer); @@ -134,3 +128,4 @@ std::string SettingsHandler::GenerateSerialNumber() stream << std::put_time(std::localtime(&t), "%j%H%M%S"); return stream.str(); } +} // namespace Common diff --git a/Source/Core/Common/SettingsHandler.h b/Source/Core/Common/SettingsHandler.h index 114a2bc0b6..4fd1b0ea42 100644 --- a/Source/Core/Common/SettingsHandler.h +++ b/Source/Core/Common/SettingsHandler.h @@ -11,6 +11,8 @@ #include "Common/CommonTypes.h" +namespace Common +{ class SettingsHandler { public: @@ -42,3 +44,4 @@ private: u32 m_position, m_key; std::string decoded; }; +} // namespace Common diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp index f406c47e5b..1a3b4bfe28 100644 --- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp +++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp @@ -223,7 +223,7 @@ bool CBoot::SetupWiiMemory() auto entryPos = region_settings.find(SConfig::GetInstance().m_region); const RegionSetting& region_setting = entryPos->second; - SettingsHandler gen; + Common::SettingsHandler gen; std::string serno; CreateSystemMenuTitleDirs(); const std::string settings_file_path(Common::GetTitleDataPath(Titles::SYSTEM_MENU) + @@ -231,7 +231,7 @@ bool CBoot::SetupWiiMemory() const auto fs = IOS::HLE::GetIOS()->GetFS(); { - SettingsHandler::Buffer data; + Common::SettingsHandler::Buffer data; const auto file = fs->OpenFile(IOS::SYSMENU_UID, IOS::SYSMENU_GID, settings_file_path, IOS::HLE::FS::Mode::Read); if (file && file->Read(data.data(), data.size())) @@ -248,7 +248,7 @@ bool CBoot::SetupWiiMemory() if (Core::WantsDeterminism()) serno = "123456789"; else - serno = SettingsHandler::GenerateSerialNumber(); + serno = Common::SettingsHandler::GenerateSerialNumber(); INFO_LOG(BOOT, "No previous serial number found, generated one instead: %s", serno.c_str()); } else diff --git a/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp b/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp index ea92553721..18c6d1f713 100644 --- a/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp +++ b/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp @@ -92,10 +92,10 @@ IPCCommandResult NetKDRequest::IOCtl(const IOCtlRequest& request) const auto fs = m_ios.GetFS(); if (const auto file = fs->OpenFile(PID_KD, PID_KD, settings_file_path, FS::Mode::Read)) { - SettingsHandler::Buffer data; + Common::SettingsHandler::Buffer data; if (file->Read(data.data(), data.size())) { - const SettingsHandler gen{std::move(data)}; + const Common::SettingsHandler gen{std::move(data)}; area = gen.GetValue("AREA"); model = gen.GetValue("MODEL"); }