aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-02-20 19:41:22 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-02-20 19:41:22 +0000
commit382ff1c0c264d7bf3b60e3c023097cf397557182 (patch)
tree12c9ee8ce537a0c59afd0a422ff47d7f4c831d9b /lib/System
parentb2bd9aeb7935f3a059756f1ecebec8a1776ad725 (diff)
downloadexternal_llvm-382ff1c0c264d7bf3b60e3c023097cf397557182.zip
external_llvm-382ff1c0c264d7bf3b60e3c023097cf397557182.tar.gz
external_llvm-382ff1c0c264d7bf3b60e3c023097cf397557182.tar.bz2
Add convenient helper to get suffix of the file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Path.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp
index 6f0667f..11035cf 100644
--- a/lib/System/Path.cpp
+++ b/lib/System/Path.cpp
@@ -172,7 +172,10 @@ bool Path::hasMagicNumber(const std::string &Magic) const {
return false;
}
-
+std::string
+Path::getSuffix() const {
+ return path.substr(path.rfind('.') + 1);
+}
// Include the truly platform-specific parts of this class.
#if defined(LLVM_ON_UNIX)