MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / unescape

Function unescape

launcher/settings/INIFile.cpp:76–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76QString unescape(QString orig)
77{
78 QString out;
79 QChar prev = QChar::Null;
80 for (auto c : orig) {
81 if (prev == '\\') {
82 if (c == 'n')
83 out += '\n';
84 else if (c == 't')
85 out += '\t';
86 else if (c == '#')
87 out += '#';
88 else
89 out += c;
90 prev = QChar::Null;
91 } else {
92 if (c == '\\') {
93 prev = c;
94 continue;
95 }
96 out += c;
97 prev = QChar::Null;
98 }
99 }
100 return out;
101}
102
103QString unquote(QString str)
104{

Callers 1

parseOldFileFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected