MCPcopy Create free account
hub / github.com/cemu-project/Cemu / Load

Method Load

src/gui/MemorySearcherTool.cpp:271–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void MemorySearcherTool::Load()
272{
273 const auto memorySearcherPath = ActiveSettings::GetUserDataPath("memorySearcher/{:016x}.ini", CafeSystem::GetForegroundTitleId());
274 auto memSearcherIniContents = FileStream::LoadIntoMemory(memorySearcherPath);
275 if (!memSearcherIniContents)
276 return;
277
278 IniParser iniParser(*memSearcherIniContents, _pathToUtf8(memorySearcherPath));
279 while (iniParser.NextSection())
280 {
281 auto option_description = iniParser.FindOption("description");
282 auto option_address = iniParser.FindOption("address");
283 auto option_type = iniParser.FindOption("type");
284 auto option_value = iniParser.FindOption("value");
285
286 if (!option_description || !option_address || !option_type || !option_value)
287 continue;
288
289 try
290 {
291 const auto addr = StringHelpers::ToInt64(*option_address);
292 if (!IsAddressValid(addr))
293 continue;
294 }
295 catch (const std::invalid_argument&)
296 {
297 continue;
298 }
299
300 bool found = false;
301 for (const auto& entry : kDataTypeNames)
302 {
303 if (boost::iequals(entry.ToStdString(), *option_type))
304 {
305 found = true;
306 break;
307 }
308 }
309
310 if (!found && !boost::iequals(kDatatypeString.ToStdString(), *option_type))
311 continue;
312
313 wxVector<wxVariant> data;
314 data.push_back(std::string(*option_description).c_str());
315 data.push_back(std::string(*option_address).c_str());
316 data.push_back(std::string(*option_type).c_str());
317 data.push_back(std::string(*option_value).c_str());
318 data.push_back(!option_value->empty());
319 m_listEntryTable->AppendItem(data);
320 }
321}
322
323void MemorySearcherTool::Save()
324{

Callers 4

ValidateConfigMethod · 0.45
LoadSettingsMethod · 0.45
OnInitMethod · 0.45
GameProfileWindowMethod · 0.45

Calls 7

GetForegroundTitleIdFunction · 0.85
_pathToUtf8Function · 0.85
ToInt64Function · 0.85
NextSectionMethod · 0.80
FindOptionMethod · 0.80
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected