MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / stripEscapeCodes

Function stripEscapeCodes

source/core/StarText.cpp:38–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37 static RE2 stripEscapeRegex = strf("\\{:c}[^;]*{:c}", CmdEsc, EndEsc);
38 String stripEscapeCodes(String const& s) {
39 if (s.empty())
40 return s;
41 std::string result = s.utf8();
42 RE2::GlobalReplace(&result, stripEscapeRegex, "");
43 return String(std::move(result));
44 }
45
46 bool processText(StringView text, TextCallback textFunc, CommandsCallback commandsFunc, bool includeCommandSides) {
47 std::string_view str = text.utf8();

Callers 11

inviteMethod · 0.85
playerUuidByNameMethod · 0.85
playerUuidListByNameMethod · 0.85
savePlayerMethod · 0.85
updateRunningMethod · 0.85
setCurrentSpeechMethod · 0.85
updateMethod · 0.85
TitleScreenMethod · 0.85
updateMethod · 0.85
enterStageMethod · 0.85
makeUtilityCallbacksMethod · 0.85

Calls 2

StringClass · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected