11unsigned int ALStringCleaner::uids=0;
13ALStringCleaner::ALStringCleaner()
18bool ALStringCleaner::invalidASCIIChar(
char c)
20 return !(c>=0 && ((c > 44 && c < 47) || (c > 47 && c < 58) || (c > 64 && c < 91) || (c > 96 && c < 123) || (c == 95)));
23bool ALStringCleaner::invalidCharE(
char c)
25 return (c ==
'é' || c ==
'è' || c ==
'ê' || c ==
'ë');
28bool ALStringCleaner::invalidCharA(
char c)
30 return (c ==
'à' || c ==
'á' || c ==
'â' || c ==
'ã' || c ==
'ä' || c ==
'å' || c ==
'æ');
33bool ALStringCleaner::isSpace(
char toTest)
35 return (toTest ==
'\f' || toTest ==
'\n' || toTest ==
'\t' || toTest ==
'\r' || toTest ==
'\v' || toTest == 0x20);
43 for(
unsigned int n=0; n<
str.size(); ++n)
45 if (invalidCharE(
str[n]))
47 else if (invalidCharA(
str[n]))
49 else if(invalidASCIIChar(
str[n]))
57 for(
unsigned int n=0; n<
str.size(); ++n)
59 if (invalidCharE(
str[n]))
61 else if (invalidCharA(
str[n]))
63 else if(!invalidASCIIChar(
str[n]))
76 for(
unsigned int n=0; n<
str.size(); ++n)
86 for(
unsigned int n=0; n<
str.size(); ++n)
98 std::transform(
str.begin(),
str.end(),
str.begin(), ::tolower);
101unsigned int ALStringCleaner::getFirstID()
108 unsigned int id = getFirstID();
109 std::stringstream ss;
111 std::string
str = ss.str();
118 std::stringstream ss;
120 std::string
str = ss.str();
static std::string curentUID()
return the current UID WITHOUT incrementing the UID.
static void resetUID()
reset the uid to 0.
static std::string cleanASCII(std::string str, bool replace=true, char replaceBy='_')
Clean a string of non-ASCII chars, can delete or replace them.
static void toLowerCase(std::string str)
Convert a string to lower case.
static std::string getUID()
return a unique ID.
static std::string cleanSpaces(std::string str, bool replace=true, char replaceBy='_')
Clean a string of spaces, can delete or replace them.
static std::string cleanString(std::string str, bool toLower=true, bool clASCII=true, bool clSpaces=true, bool bUID=true)
Clean a string.
STBI_EXTERN unsigned long const char * str