Watches: Fix Save and Load from strings

This commit is contained in:
Sepalani 2021-03-04 17:55:52 +04:00
parent be500a98e2
commit 6786340a7c
1 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,7 @@
#include "Common/Debug/Watches.h"
#include <algorithm>
#include <locale>
#include <sstream>
namespace Common::Debug
@ -88,11 +89,11 @@ void Watches::LoadFromStrings(const std::vector<std::string>& watches)
{
for (const std::string& watch : watches)
{
std::stringstream ss;
std::istringstream ss(watch);
ss.imbue(std::locale::classic());
u32 address;
std::string name;
ss << std::hex << watch;
ss >> address;
ss >> std::hex >> address;
ss >> std::ws;
std::getline(ss, name);
SetWatch(address, name);
@ -105,6 +106,7 @@ std::vector<std::string> Watches::SaveToStrings() const
for (const auto& watch : m_watches)
{
std::ostringstream ss;
ss.imbue(std::locale::classic());
ss << std::hex << watch.address << " " << watch.name;
watches.push_back(ss.str());
}