SettingsHandler: Namespace code under the Common namespace
Adds another file in Common to the Common namespace.
This commit is contained in:
parent
bf0ee9f702
commit
5677e5d74a
|
@ -22,6 +22,8 @@
|
|||
#include "Common/SettingsHandler.h"
|
||||
#include "Common/Timer.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
SettingsHandler::SettingsHandler()
|
||||
{
|
||||
Reset();
|
||||
|
@ -134,3 +136,4 @@ std::string SettingsHandler::GenerateSerialNumber()
|
|||
stream << std::put_time(std::localtime(&t), "%j%H%M%S");
|
||||
return stream.str();
|
||||
}
|
||||
} // namespace Common
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue