Added method Path::getDirname().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek
2008-04-07 21:53:57 +00:00
parent a0562001d0
commit cf55c8e221
4 changed files with 57 additions and 2 deletions

View File

@ -269,6 +269,10 @@ namespace sys {
/// @returns std::string containing the basename of the path
/// @brief Get the base name of the path
std::string getBasename() const;
/// This function strips off the suffix of the path beginning with the
/// path separator ('/' on Unix, '\' on Windows) and returns the result.
std::string getDirname() const;
/// This function strips off the path and basename(up to and
/// including the last dot) of the file or directory name and
@ -567,11 +571,19 @@ namespace sys {
/// MemoryBuffer::getFile instead.
static void UnMapFilePages(const char *Base, uint64_t FileSize);
/// @}
/// @name Internal methods.
/// @{
protected:
std::string getDirnameCharSep(char Sep) const;
/// @}
/// @name Data
/// @{
protected:
mutable std::string path; ///< Storage for the path name.
/// @}
};