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

Function extractCodes

source/core/StarText.cpp:96–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 String extractCodes(String const& s) {
97 bool escape = false;
98 StringList result;
99 String escapeCode;
100 for (auto c : preprocessEscapeCodes(s)) {
101 if (c == StartEsc)
102 escape = true;
103 if (c == EndEsc) {
104 escape = false;
105 for (auto command : escapeCode.split(','))
106 result.append(command);
107 escapeCode = "";
108 }
109 if (escape && (c != StartEsc))
110 escapeCode.append(c);
111 }
112 if (!result.size())
113 return "";
114 return "^" + result.join(",") + ";";
115 }
116}
117
118}

Callers

nothing calls this directly

Calls 5

preprocessEscapeCodesFunction · 0.85
splitMethod · 0.45
appendMethod · 0.45
sizeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected