summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2001-05-24 17:40:46 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2001-05-24 17:40:46 (GMT)
commitabfa5238cacc17a8d6c521c7f9e9396bc2190c67 (patch)
tree0c387066d09270e4c7aa3add45ee3718acbbaeb4 /Source/cmSystemTools.cxx
parent812eed0e11992bd612a47f46eeb9ef0ab043c533 (diff)
downloadCMake-abfa5238cacc17a8d6c521c7f9e9396bc2190c67.zip
CMake-abfa5238cacc17a8d6c521c7f9e9396bc2190c67.tar.gz
CMake-abfa5238cacc17a8d6c521c7f9e9396bc2190c67.tar.bz2
new Capitalized function. Will be used in the VTK Tcl wrapper for example (in a more portable way).
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7f9bb12..3e9642f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -316,6 +316,21 @@ bool cmSystemTools::FileExists(const char* filename)
}
+// Return a capitalized string (i.e the first letter is uppercased, all other
+// are lowercased)
+std::string cmSystemTools::Capitalized(std::string& s)
+{
+ std::string n;
+ n.resize(s.size());
+ n[0] = toupper(s[0]);
+ for (size_t i = 1; i < s.size(); i++)
+ {
+ n[i] = tolower(s[i]);
+ }
+ return n;
+}
+
+
// convert windows slashes to unix slashes \ with /
void cmSystemTools::ConvertToUnixSlashes(std::string& path)
{