Namespace ostream and endl into std::
Use <iostream> without the .h
This commit is contained in:
@@ -118,13 +118,25 @@ void ManSearchPath::Print()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(linux)
|
||||||
|
std::ostream & operator<<
|
||||||
|
(
|
||||||
|
std::ostream & os,
|
||||||
|
const ManSearchPath & sp
|
||||||
|
)
|
||||||
|
#else
|
||||||
ostream & operator<<
|
ostream & operator<<
|
||||||
(
|
(
|
||||||
ostream & os,
|
ostream & os,
|
||||||
const ManSearchPath & sp
|
const ManSearchPath & sp
|
||||||
)
|
)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if defined(linux)
|
||||||
|
os << sp.GetEnvVar() << std::endl;
|
||||||
|
#else
|
||||||
os << sp.GetEnvVar() << endl;
|
os << sp.GetEnvVar() << endl;
|
||||||
|
#endif
|
||||||
sp.PrettyPrint(os);
|
sp.PrettyPrint(os);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,11 @@
|
|||||||
|
|
||||||
#include "Options.h"
|
#include "Options.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#if defined(linux)
|
||||||
|
#include <iostream>
|
||||||
|
#else
|
||||||
#include <iostream.h>
|
#include <iostream.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
|
|||||||
@@ -372,18 +372,33 @@ void SearchPath::Print()
|
|||||||
*
|
*
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
|
#if defined(linux)
|
||||||
|
void SearchPath::PrettyPrint
|
||||||
|
(
|
||||||
|
std::ostream & os
|
||||||
|
) const
|
||||||
|
#else
|
||||||
void SearchPath::PrettyPrint
|
void SearchPath::PrettyPrint
|
||||||
(
|
(
|
||||||
ostream & os
|
ostream & os
|
||||||
) const
|
) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
CTokenizedString path (GetSearchPath(), Separator().data());
|
CTokenizedString path (GetSearchPath(), Separator().data());
|
||||||
CString subpath = path.next();
|
CString subpath = path.next();
|
||||||
while (!subpath.isNull()) {
|
while (!subpath.isNull()) {
|
||||||
|
#if defined(linux)
|
||||||
|
os << " " << subpath << std::endl;
|
||||||
|
#else
|
||||||
os << " " << subpath << endl;
|
os << " " << subpath << endl;
|
||||||
|
#endif
|
||||||
subpath = path.next();
|
subpath = path.next();
|
||||||
}
|
}
|
||||||
|
#if defined(linux)
|
||||||
|
os << std::endl;
|
||||||
|
#else
|
||||||
os << endl;
|
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 & operator<<
|
||||||
(
|
(
|
||||||
ostream & os,
|
ostream & os,
|
||||||
const SearchPath & sp
|
const SearchPath & sp
|
||||||
)
|
)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if defined(linux)
|
||||||
|
os << sp.GetEnvVar() << "SEARCHPATH:" << std::endl;
|
||||||
|
#else
|
||||||
os << sp.GetEnvVar() << "SEARCHPATH:" << endl;
|
os << sp.GetEnvVar() << "SEARCHPATH:" << endl;
|
||||||
|
#endif
|
||||||
sp.PrettyPrint(os);
|
sp.PrettyPrint(os);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,9 +50,16 @@ class SearchPath {
|
|||||||
virtual void ExportPath();
|
virtual void ExportPath();
|
||||||
virtual void Print();
|
virtual void Print();
|
||||||
virtual void AddPredefinedPath();
|
virtual void AddPredefinedPath();
|
||||||
|
|
||||||
|
#if defined(linux)
|
||||||
|
virtual void PrettyPrint (std::ostream &) const;
|
||||||
|
|
||||||
|
friend std::ostream & operator<< (std::ostream &, const SearchPath &);
|
||||||
|
#else
|
||||||
virtual void PrettyPrint (ostream &) const;
|
virtual void PrettyPrint (ostream &) const;
|
||||||
|
|
||||||
friend ostream & operator<< (ostream &, const SearchPath &);
|
friend ostream & operator<< (ostream &, const SearchPath &);
|
||||||
|
#endif
|
||||||
|
|
||||||
const char * GetEnvVar() const { return environment_var; }
|
const char * GetEnvVar() const { return environment_var; }
|
||||||
CString GetSearchPath() const { return final_search_path; }
|
CString GetSearchPath() const { return final_search_path; }
|
||||||
@@ -178,7 +185,11 @@ class ManSearchPath : public SearchPath {
|
|||||||
virtual void ExportPath ();
|
virtual void ExportPath ();
|
||||||
virtual void Print();
|
virtual void Print();
|
||||||
|
|
||||||
|
#if defined(linux)
|
||||||
|
friend std::ostream & operator<< (std::ostream &, const ManSearchPath &);
|
||||||
|
#else
|
||||||
friend ostream & operator<< (ostream &, const ManSearchPath &);
|
friend ostream & operator<< (ostream &, const ManSearchPath &);
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void MakePath (const CString &);
|
virtual void MakePath (const CString &);
|
||||||
|
|||||||
Reference in New Issue
Block a user