From: James Turner Date: Tue, 25 Oct 2011 20:44:57 +0000 (+0100) Subject: Support stream output by SGPath directly. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=59ecf48b72a39b270db4c707d1460a9b867d275b;p=simgear.git Support stream output by SGPath directly. --- diff --git a/simgear/misc/path_test.cxx b/simgear/misc/path_test.cxx index 2d789e64..4d976e01 100644 --- a/simgear/misc/path_test.cxx +++ b/simgear/misc/path_test.cxx @@ -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()); diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx index e71c5f54..c19b977d 100644 --- a/simgear/misc/sg_path.hxx +++ b/simgear/misc/sg_path.hxx @@ -236,6 +236,13 @@ private: mutable time_t _modTime; }; +/// Output to an ostream +template +inline +std::basic_ostream& +operator<<(std::basic_ostream& s, const SGPath& p) +{ return s << "Path \"" << p.str() << "\""; } + /** * Split a directory string into a list of it's parent directories.