forked from OSchip/llvm-project
Make getDirnameSep a static method (not part of Path's interface).
llvm-svn: 49354
This commit is contained in:
parent
e0680b7e7a
commit
a518bb79b1
|
@ -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
|
||||
/// @{
|
||||
|
|
|
@ -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 ".";
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue