MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / fromJson

Method fromJson

pcsx2-qt/Debugger/Memory/MemoryView.cpp:719–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717}
718
719bool MemoryView::fromJson(const JsonValueWrapper& json)
720{
721 if (!DebuggerView::fromJson(json))
722 return false;
723
724 auto start_address = json.value().FindMember("startAddress");
725 if (start_address != json.value().MemberEnd() && start_address->value.IsUint())
726 m_table.UpdateStartAddress(start_address->value.GetUint());
727
728 auto view_type = json.value().FindMember("viewType");
729 if (view_type != json.value().MemberEnd() && view_type->value.IsInt())
730 {
731 MemoryViewType type = static_cast<MemoryViewType>(view_type->value.GetInt());
732 if (type == MemoryViewType::BYTE ||
733 type == MemoryViewType::BYTEHW ||
734 type == MemoryViewType::WORD ||
735 type == MemoryViewType::DWORD ||
736 type == MemoryViewType::FLOAT)
737 m_table.SetViewType(type);
738 }
739
740 auto little_endian = json.value().FindMember("littleEndian");
741 if (little_endian != json.value().MemberEnd() && little_endian->value.IsBool())
742 m_table.SetLittleEndian(little_endian->value.GetBool());
743
744 update();
745
746 return true;
747}
748
749void MemoryView::paintEvent(QPaintEvent* event)
750{

Callers 1

loadMethod · 0.45

Calls 9

FindMemberMethod · 0.80
MemberEndMethod · 0.80
UpdateStartAddressMethod · 0.80
GetIntMethod · 0.80
SetViewTypeMethod · 0.80
SetLittleEndianMethod · 0.80
GetBoolMethod · 0.80
updateFunction · 0.50
valueMethod · 0.45

Tested by

no test coverage detected