Make getDirnameSep a static method (not part of Path's interface).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49354 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2008-04-07 22:01:32 +00:00
parent cf55c8e221
commit 9b01cc0ede
4 changed files with 7 additions and 10 deletions

View File

@ -571,13 +571,6 @@ 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
/// @{

View File

@ -196,7 +196,7 @@ static void getPathList(const char*path, std::vector<Path>& Paths) {
Paths.push_back(tmpPath);
}
std::string Path::getDirnameCharSep(char Sep) const {
static std::string getDirnameCharSep(const std::string& path, char Sep) {
if (path.empty())
return ".";

View File

@ -277,7 +277,9 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
}
std::string Path::getDirname() const { return getDirnameCharSep('/'); }
std::string Path::getDirname() const {
return getDirnameCharSep(path, '/');
}
std::string
Path::getBasename() const {

View File

@ -229,7 +229,9 @@ Path::isRootDirectory() const {
return len > 0 && path[len-1] == '/';
}
std::string Path::getDirname() const { return getDirnameCharSep('\\'); }
std::string Path::getDirname() const {
return getDirnameCharSep(path, '\\');
}
std::string
Path::getBasename() const {