From 59ecf48b72a39b270db4c707d1460a9b867d275b Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 25 Oct 2011 21:44:57 +0100 Subject: [PATCH] Support stream output by SGPath directly. --- simgear/misc/path_test.cxx | 2 +- simgear/misc/sg_path.hxx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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. -- 2.39.5