mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Made directory and file printable with operator <<
This commit is contained in:
parent
24fda7ccf8
commit
339c3040c5
@ -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 <
|
||||
|
@ -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 (
|
||||
|
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user