sort map lists non case sensitive in menu

This commit is contained in:
titiger
2015-01-03 02:03:31 +01:00
parent f4529566fa
commit 109a5b9985
4 changed files with 11 additions and 4 deletions

View File

@@ -229,6 +229,7 @@ string ext(const string &s);
string replaceBy(const string &s, char c1, char c2);
vector<string> split(string s,string d);
string toLower(const string &s);
bool compareNonCaseSensitive(const string a, const string b);
void copyStringToBuffer(char *buffer, int bufferSize, const string& s);
//numeric fcs

View File

@@ -735,6 +735,10 @@ string toLower(const string &s){
return rs;
}
bool compareNonCaseSensitive(const string a, const string b) {
return (toLower(a) < toLower(b));
}
void copyStringToBuffer(char *buffer, int bufferSize, const string& s){
strncpy(buffer, s.c_str(), bufferSize-1);
buffer[bufferSize-1]= '\0';