new method for creating a path, which does not create a temporary string.
authorChris Lattner <sabre@nondot.org>
Sun, 29 Apr 2007 06:16:32 +0000 (06:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Apr 2007 06:16:32 +0000 (06:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36552 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/System/Path.h

index 84d99122b1ec674d810a35b0eaf0a94dd662c246..573edda15c2e40162cc0d44a8df4f859391ea76e 100644 (file)
@@ -174,6 +174,14 @@ namespace sys {
       /// @brief Construct a Path from a string.
       explicit Path(const std::string& p) : path(p) {}
 
+      /// This constructor will accept a character range as a path.  No checking
+      /// is done on this path to determine if it is valid.  To determine
+      /// validity of the path, use the isValid method. 
+      /// @param p The path to assign.
+      /// @brief Construct a Path from a string.
+      explicit Path(const char *StrStart, unsigned StrLen)
+        : path(StrStart, StrStart+StrLen) {}
+      
     /// @}
     /// @name Operators
     /// @{