1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Add an uppercase conversion utility function.

llvm-svn: 43146
This commit is contained in:
Christopher Lamb 2007-10-18 19:31:38 +00:00
parent 7f21e45b06
commit b9c6101dd5

View File

@ -109,6 +109,14 @@ static inline std::string LowercaseString(const std::string &S) {
return result;
}
static inline std::string UppercaseString(const std::string &S) {
std::string result(S);
for (unsigned i = 0; i < S.length(); ++i)
if (islower(result[i]))
result[i] = char(toupper(result[i]));
return result;
}
/// StringsEqualNoCase - Return true if the two strings are equal, ignoring
/// case.
static inline bool StringsEqualNoCase(const std::string &LHS,