Make getDirnameSep a static method (not part of Path's interface).
authorTed Kremenek <kremenek@apple.com>
Mon, 7 Apr 2008 22:01:32 +0000 (22:01 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 7 Apr 2008 22:01:32 +0000 (22:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49354 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/System/Path.h
lib/System/Path.cpp
lib/System/Unix/Path.inc
lib/System/Win32/Path.inc

index 5846fa92537f4bebddef2848cec3b79b215709c7..36b48e7cc631f49cd40d1914c862fe3b96a15c38 100644 (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
     /// @{
index 43c36d5e09b9c97f1100c65027afd2d77eed6b54..e8fd5f29634c91358c02a2c3f3d34a5ab495ffe0 100644 (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 ".";
index fe2e3c6777819c327a3f3f5553f940f3b7937da3..aca4b936e87246c1479f9a3f2777520a6c4a2cf5 100644 (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 {
index 35bae337da7f5e0f1f5bed3595c3654ffdc9ddb3..357cb2f27eea492e4d7cf38776472a8870bbb464 100644 (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 {