MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / tryGetSuffixedKey

Function tryGetSuffixedKey

radiantcore/entity/AttachmentData.cpp:25–36  ·  view source on GitHub ↗

Extract and return the string suffix for a key (which might be the empty string if there is no suffix). Returns false if the key did not match the prefix.

Source from the content-addressed store, hash-verified

23// string if there is no suffix). Returns false if the key did not match
24// the prefix.
25bool tryGetSuffixedKey(const std::string& key, const std::string& prefix,
26 std::string& suffixedOutput)
27{
28 if (string::istarts_with(key, prefix))
29 {
30 suffixedOutput = key.substr(prefix.length());
31 return true;
32 }
33
34 suffixedOutput.clear();
35 return false;
36}
37
38} // namespace
39

Callers 1

parseDefAttachKeysMethod · 0.85

Calls 3

istarts_withFunction · 0.85
lengthMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected