From 1e9fbdc38cad9519024a7302fabefd0d792aa039 Mon Sep 17 00:00:00 2001 From: Bill Lorensen Date: Wed, 12 Sep 2001 17:09:02 -0400 Subject: ENH: Added LowerCase method. --- Source/cmSystemTools.cxx | 13 +++++++++++++ Source/cmSystemTools.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index fb2f297..4d9bf11 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -417,6 +417,19 @@ std::string cmSystemTools::Capitalized(const std::string& s) } +// Return a lower case string +std::string cmSystemTools::LowerCase(const std::string& s) +{ + std::string n; + n.resize(s.size()); + for (size_t i = 0; i < s.size(); i++) + { + n[i] = tolower(s[i]); + } + return n; +} + + // convert windows slashes to unix slashes \ with / const char *cmSystemTools::ConvertToUnixSlashes(std::string& path) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index c7c44af..c85a4ea 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -96,6 +96,11 @@ public: static std::string Capitalized(const std::string&); /** + * Return a lower case string + */ + static std::string LowerCase(const std::string&); + + /** * Replace Windows file system slashes with Unix-style slashes. */ static const char *ConvertToUnixSlashes(std::string& path); -- cgit v0.12