From e18bc08fbc674584fe3a3a0c6b866a5aea201a91 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Wed, 20 Feb 2008 19:41:22 +0000 Subject: 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 --- lib/System/Path.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/System/Path.cpp') 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) -- cgit v1.1