Support stream output by SGPath directly.

This commit is contained in:
James Turner 2011-10-25 21:44:57 +01:00
parent 2fb13c76f5
commit 59ecf48b72
2 changed files with 8 additions and 1 deletions

View 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());

View 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.