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

Method LoadPatchText

CoreLib/SymbolMapper.cpp:555–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555bool SymbolMappingLoader::LoadPatchText(std::string_view s, std::vector<uint8_t>& bytes)
556{
557 char const * c = s.data();
558 while (*c) {
559 if (*c == ' ' || *c == '\t' || *c == '\r' || *c == '\n') {
560 c++;
561 continue;
562 }
563
564 if (*c == '/') {
565 while (*c && *c != '\r' && *c != '\n') c++;
566 continue;
567 }
568
569 if (!c[1] || !c[2] || !std::isspace(c[2])) {
570 ERR("Bytes must be separated by whitespace");
571 return false;
572 }
573
574 auto patByte = HexByteToByte(c[0], c[1]);
575 if (!patByte) {
576 return false;
577 }
578
579 bytes.push_back(*patByte);
580 c += 3;
581 }
582
583 return true;
584}
585
586bool SymbolMappingLoader::LoadPatch(tinyxml2::XMLElement* ele, Pattern const& pattern, SymbolMappings::Patch& patch)
587{

Callers

nothing calls this directly

Calls 3

HexByteToByteFunction · 0.85
dataMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected