MCPcopy Create free account
hub / github.com/Norbyte/bg3se / LoadReference

Method LoadReference

CoreLib/SymbolMapper.cpp:610–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608
609
610bool SymbolMappingLoader::LoadReference(tinyxml2::XMLElement* ele, Pattern const& pattern, SymbolMappings::Reference& ref)
611{
612 auto type = ele->Attribute("Type");
613 if (!type) {
614 ERR("Mapping reference must have a Type property.");
615 return false;
616 }
617
618 if (strcmp(type, "Absolute") == 0) {
619 ref.Type = SymbolMappings::ReferenceType::kAbsolute;
620 } else if (strcmp(type, "Indirect") == 0) {
621 ref.Type = SymbolMappings::ReferenceType::kIndirect;
622 } else {
623 ERR("Unsupported mapping reference type: %s", type);
624 return false;
625 }
626
627 auto offset = GetOffsetAttribute(ele, pattern, "Offset");
628 if (!offset) {
629 ERR("Mapping reference has invalid Offset value.");
630 return false;
631 }
632
633 ref.Offset = *offset;
634 return true;
635}
636
637bool SymbolMappingLoader::LoadCondition(tinyxml2::XMLElement* ele, Pattern const& pattern, SymbolMappings::Condition& condition)
638{

Callers

nothing calls this directly

Calls 2

GetOffsetAttributeFunction · 0.85
AttributeMethod · 0.45

Tested by

no test coverage detected