Commit 339c3040 authored by Davis King's avatar Davis King

Made directory and file printable with operator <<

parent 24fda7cc
...@@ -290,6 +290,18 @@ namespace dlib ...@@ -290,6 +290,18 @@ namespace dlib
}; };
// ----------------------------------------------------------------------------------------
inline std::ostream& operator<< (
std::ostream& out,
const directory& item
) { out << (std::string)item; return out; }
inline std::ostream& operator<< (
std::ostream& out,
const file& item
) { out << (std::string)item; return out; }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template < template <
......
...@@ -282,6 +282,18 @@ namespace dlib ...@@ -282,6 +282,18 @@ namespace dlib
}; };
// ----------------------------------------------------------------------------------------
inline std::ostream& operator<< (
std::ostream& out,
const directory& item
) { out << (std::string)item; return out; }
inline std::ostream& operator<< (
std::ostream& out,
const file& item
) { out << (std::string)item; return out; }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
inline void swap ( inline void swap (
......
...@@ -457,6 +457,28 @@ namespace dlib ...@@ -457,6 +457,28 @@ namespace dlib
}; };
// ----------------------------------------------------------------------------------------
inline std::ostream& operator<< (
std::ostream& out,
const directory& item
);
/*!
ensures
- performs: out << item.full_name()
- returns out
!*/
inline std::ostream& operator<< (
std::ostream& out,
const file& item
);
/*!
ensures
- performs: out << item.full_name()
- returns out
!*/
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
inline void swap ( inline void swap (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment