llvm.org GIT mirror llvm / 64aed54
Add a LowercaseString() utility function, courtesy of brg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14383 91177308-0d34-0410-b5e6-96231b3b80d8 Misha Brukman 16 years ago
2 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9696 return Buffer;
9797 }
9898
99 std::string LowercaseString (const std::string &S) {
100 std::string result (S);
101 for (unsigned i = 0; i < S.length(); ++i)
102 if (isupper (result[i]))
103 result[i] = tolower(result[i]);
104 return result;
105 }
99106
100107 /// getToken - This function extracts one token from source, ignoring any
101108 /// leading characters that appear in the Delimiters string, and ending the
9696 return Buffer;
9797 }
9898
99 std::string LowercaseString (const std::string &S) {
100 std::string result (S);
101 for (unsigned i = 0; i < S.length(); ++i)
102 if (isupper (result[i]))
103 result[i] = tolower(result[i]);
104 return result;
105 }
99106
100107 /// getToken - This function extracts one token from source, ignoring any
101108 /// leading characters that appear in the Delimiters string, and ending the