Codechange: Store file search paths as std::string.

This commit is contained in:
Michael Lutz
2020-12-06 21:11:43 +01:00
parent dd138fc460
commit 0c6e8a8123
7 changed files with 89 additions and 69 deletions

View File

@@ -362,6 +362,17 @@ bool strtolower(char *str)
return changed;
}
bool strtolower(std::string &str, std::string::size_type offs)
{
bool changed = false;
for (auto ch = str.begin() + offs; ch != str.end(); ++ch) {
auto new_ch = static_cast<char>(tolower(static_cast<unsigned char>(*ch)));
changed |= new_ch != *ch;
*ch = new_ch;
}
return changed;
}
/**
* Only allow certain keys. You can define the filter to be used. This makes
* sure no invalid keys can get into an editbox, like BELL.