]> git.mxchange.org Git - simgear.git/commitdiff
Support stream output by SGPath directly.
authorJames Turner <zakalawe@mac.com>
Tue, 25 Oct 2011 20:44:57 +0000 (21:44 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 25 Oct 2011 20:44:57 +0000 (21:44 +0100)
simgear/misc/path_test.cxx
simgear/misc/sg_path.hxx

index 2d789e647ebbd61ecd883b1888813ef3bc660d74..4d976e01ffdd52328dfc9dedc0e82f2e263addfc 100644 (file)
@@ -27,7 +27,7 @@ using std::endl;
 void test_dir()
 {
     simgear::Dir temp = simgear::Dir::tempDir("foo");
-    cout << "created:" << temp.path().str() << endl;
+    cout << "created:" << temp.path() << endl;
   
     VERIFY(temp.exists());
     VERIFY(temp.path().isDir());
index e71c5f54d9a55e7312e9b7ef8ac20102edddd380..c19b977dcbe77fddb500cb56232f20812b41bfe8 100644 (file)
@@ -236,6 +236,13 @@ private:
     mutable time_t _modTime;
 };
 
+/// Output to an ostream
+template<typename char_type, typename traits_type>
+inline
+std::basic_ostream<char_type, traits_type>&
+operator<<(std::basic_ostream<char_type, traits_type>& s, const SGPath& p)
+{ return s << "Path \"" << p.str() << "\""; }
+
 
 /**
  * Split a directory string into a list of it's parent directories.