summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2003-06-03 14:30:23 (GMT)
committerKen Martin <ken.martin@kitware.com>2003-06-03 14:30:23 (GMT)
commitba68f771b369e65476e7ce12aa8dd1cf18d7f529 (patch)
tree4580bb0cd83663ac32e7234b47f1a03881a2b709 /Source/cmSystemTools.cxx
parent4f55e4870d0dea6f700943ccd4bac958c478cff4 (diff)
downloadCMake-ba68f771b369e65476e7ce12aa8dd1cf18d7f529.zip
CMake-ba68f771b369e65476e7ce12aa8dd1cf18d7f529.tar.gz
CMake-ba68f771b369e65476e7ce12aa8dd1cf18d7f529.tar.bz2
yikes added new custom command support
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 46bcabd..0ef39fd 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1932,6 +1932,25 @@ std::string cmSystemTools::GetFilenameExtension(const std::string& filename)
}
}
+/**
+ * Return file extension of a full filename (dot included).
+ * Warning: this is the shortest extension (for example: .tar.gz)
+ */
+std::string
+cmSystemTools::GetFilenameLastExtension(const std::string& filename)
+{
+ std::string name = cmSystemTools::GetFilenameName(filename);
+ std::string::size_type dot_pos = name.rfind(".");
+ if(dot_pos != std::string::npos)
+ {
+ return name.substr(dot_pos);
+ }
+ else
+ {
+ return "";
+ }
+}
+
/**
* Return file name without extension of a full filename (i.e. without path).