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

Function SimplifyComponentName

BG3Extender/GameDefinitions/EntitySystem.cpp:764–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762}
763
764STDString SimplifyComponentName(StringView name)
765{
766 STDString key{ name };
767 if (key.length() > 52 && strncmp(key.c_str(), "class ls::_StringView<char> __cdecl ls::GetTypeName<", 52) == 0) {
768 key = key.substr(52);
769 }
770
771 if (key.length() > 6 && strncmp(key.c_str(), "class ", 6) == 0) {
772 key = key.substr(6);
773 }
774 else if (key.length() > 7 && strncmp(key.c_str(), "struct ", 7) == 0) {
775 key = key.substr(7);
776 }
777
778 if (key.length() > 7 && strncmp(key.c_str() + key.size() - 7, ">(void)", 7) == 0) {
779 key = key.substr(0, key.size() - 7);
780 }
781
782 return key;
783}
784
785void* EntitySystemHelpersBase::CreateComponentRaw(EntityHandle entity, ExtComponentType type)
786{

Callers 1

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected