diff options
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Unix/Path.inc | 6 | ||||
-rw-r--r-- | lib/System/Win32/Path.inc | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index 9f4b591..6035a14 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -75,6 +75,12 @@ using namespace sys; extern const char sys::PathSeparator = ':'; +Path::Path(const std::string& p) + : path(p) {} + +Path::Path(const char *StrStart, unsigned StrLen) + : path(StrStart, StrLen) {} + bool Path::isValid() const { // Check some obvious things diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index ce5fe2a..b5897053 100644 --- a/lib/System/Win32/Path.inc +++ b/lib/System/Win32/Path.inc @@ -46,6 +46,16 @@ namespace llvm { namespace sys { const char PathSeparator = ';'; +Path::Path(const std::string& p) + : path(p) { + FlipBackSlashes(path); +} + +Path::Path(const char *StrStart, unsigned StrLen) + : path(StrStart, StrLen) { + FlipBackSlashes(path); +} + bool Path::isValid() const { if (path.empty()) @@ -230,7 +240,7 @@ Path::isRootDirectory() const { } std::string Path::getDirname() const { - return getDirnameCharSep(path, '\\'); + return getDirnameCharSep(path, '/'); } std::string |