Made directory and file printable with operator <<

This commit is contained in:
Davis King 2013-12-27 17:29:40 -05:00
parent 24fda7ccf8
commit 339c3040c5
3 changed files with 46 additions and 0 deletions

View File

@ -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 <

View File

@ -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 (

View File

@ -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 (