[llvm-commits] CVS: llvm/include/llvm/System/Path.h

Reid Spencer reid at x10sys.com
Sun Dec 12 22:57:26 PST 2004



Changes in directory llvm/include/llvm/System:

Path.h updated: 1.13 -> 1.14
---
Log message:

* Add a std::ostream inserter for sys::Path
* Correct the std::string constructor to take a const reference.


---
Diffs of the changes:  (+7 -1)

Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.13 llvm/include/llvm/System/Path.h:1.14
--- llvm/include/llvm/System/Path.h:1.13	Sun Dec 12 20:57:53 2004
+++ llvm/include/llvm/System/Path.h	Mon Dec 13 00:57:15 2004
@@ -18,6 +18,7 @@
 #include <set>
 #include <string>
 #include <vector>
+#include <ostream>
 
 namespace llvm {
 namespace sys {
@@ -161,7 +162,7 @@
       /// @throws std::string if the path string is not legal.
       /// @param unverified_path The path to verify and assign.
       /// @brief Construct a Path from a string.
-      explicit Path(std::string unverified_path);
+      explicit Path(const std::string& unverified_path);
 
     /// @}
     /// @name Operators
@@ -547,6 +548,11 @@
   LLVMFileType IdentifyFileType(const char*magic, unsigned length);
 }
 
+inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) {
+  strm << aPath.toString();
+  return strm;
+}
+
 }
 
 // vim: sw=2






More information about the llvm-commits mailing list