| 553 | } |
| 554 | |
| 555 | bool 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 | |
| 586 | bool SymbolMappingLoader::LoadPatch(tinyxml2::XMLElement* ele, Pattern const& pattern, SymbolMappings::Patch& patch) |
| 587 | { |
nothing calls this directly
no test coverage detected