1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

hopefully a fix for the majority of the windows 7 problems - thanks to zerochen

This commit is contained in:
Perttu Ahola 2011-02-12 20:15:57 +02:00
parent e9fe230381
commit 3bb040043c
3 changed files with 55 additions and 33 deletions

View file

@ -1686,6 +1686,22 @@ inline bool string_allowed(const std::string &s, const std::string &allowed_char
return true;
}
/*
Forcefully wraps string into rows using \n
(no word wrap, used for showing paths in gui)
*/
inline std::string wrap_rows(const std::string &from, u32 rowlen)
{
std::string to;
for(u32 i=0; i<from.size(); i++)
{
if(i != 0 && i%rowlen == 0)
to += '\n';
to += from[i];
}
return to;
}
/*
Some helper stuff
*/