add newline feature to the text node, add about window with credits, add about menu with submenus
This commit is contained in:
25
src/util.cpp
25
src/util.cpp
@@ -105,6 +105,31 @@ std::vector<std::string> split(const std::string& subject, char d, int max_split
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string unescape(const std::string& s)
|
||||
{
|
||||
std::string res;
|
||||
std::string::const_iterator it = s.begin();
|
||||
while (it != s.end())
|
||||
{
|
||||
char c = *it++;
|
||||
if (c == '\\' && it != s.end())
|
||||
{
|
||||
switch (*it++) {
|
||||
case '\\': c = '\\'; break;
|
||||
case 'n': c = '\n'; break;
|
||||
case 't': c = '\t'; break;
|
||||
// all other escapes
|
||||
default:
|
||||
// invalid escape sequence - skip it. alternatively you can copy it as is, throw an exception...
|
||||
continue;
|
||||
}
|
||||
}
|
||||
res += c;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static const char* gl2str(GLenum err)
|
||||
{
|
||||
switch (err)
|
||||
|
||||
Reference in New Issue
Block a user