Namespace ostream and endl into std::

Use <iostream> without the .h
This commit is contained in:
Peter Howkins
2012-03-13 17:54:48 +00:00
parent 167fd854e1
commit 7294970c18
4 changed files with 54 additions and 0 deletions

View File

@@ -372,18 +372,33 @@ void SearchPath::Print()
*
****************************************************************/
#if defined(linux)
void SearchPath::PrettyPrint
(
std::ostream & os
) const
#else
void SearchPath::PrettyPrint
(
ostream & os
) const
#endif
{
CTokenizedString path (GetSearchPath(), Separator().data());
CString subpath = path.next();
while (!subpath.isNull()) {
#if defined(linux)
os << " " << subpath << std::endl;
#else
os << " " << subpath << endl;
#endif
subpath = path.next();
}
#if defined(linux)
os << std::endl;
#else
os << endl;
#endif
}
@@ -394,13 +409,25 @@ void SearchPath::PrettyPrint
*
****************************************************************/
#if defined(linux)
std::ostream & operator<<
(
std::ostream & os,
const SearchPath & sp
)
#else
ostream & operator<<
(
ostream & os,
const SearchPath & sp
)
#endif
{
#if defined(linux)
os << sp.GetEnvVar() << "SEARCHPATH:" << std::endl;
#else
os << sp.GetEnvVar() << "SEARCHPATH:" << endl;
#endif
sp.PrettyPrint(os);
return os;
}