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

llvm-svn: 49354
This commit is contained in:
Ted Kremenek 2008-04-07 22:01:32 +00:00
parent e0680b7e7a
commit a518bb79b1
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 {