Namespace ostream and endl into std::
authorPeter Howkins <flibble@users.sourceforge.net>
Tue, 13 Mar 2012 17:54:48 +0000 (17:54 +0000)
committerPeter Howkins <flibble@users.sourceforge.net>
Tue, 13 Mar 2012 17:54:48 +0000 (17:54 +0000)
Use <iostream> without the .h

cde/programs/dtsearchpath/dtsp/ManSearchPath.C
cde/programs/dtsearchpath/dtsp/Options.C
cde/programs/dtsearchpath/dtsp/SearchPath.C
cde/programs/dtsearchpath/dtsp/SearchPath.h

index aa8933122f9b079905690db7eeab05b29068b8e8..b03891da6d3a3d4f7a7475ffcb1252a1f094a908 100644 (file)
@@ -118,13 +118,25 @@ void ManSearchPath::Print()
     }
 }
 
+#if defined(linux)
+std::ostream & operator<< 
+       (
+       std::ostream & os, 
+       const ManSearchPath & sp
+       )
+#else
 ostream & operator<< 
        (
        ostream & os, 
        const ManSearchPath & sp
        )
+#endif
 {
+#if defined(linux)
+    os << sp.GetEnvVar() << std::endl;
+#else
     os << sp.GetEnvVar() << endl;
+#endif
     sp.PrettyPrint(os);
     return os;
 }
index 6a35d4f643e839ed20fdea76007e2280840e0b41..08004356c7e0f5d03f768170bcf7ad76876b5216 100644 (file)
 
 #include "Options.h"
 #include <stdlib.h>
+#if defined(linux)
+#include <iostream>
+#else
 #include <iostream.h>
+#endif
 #include <stdio.h>
 #include <pwd.h>
 
index 3145e852d42ee5ac267561a86b0362d2c6954107..f0dd4a0e6b5ff1a77cd57891349e9c9545cb6ef1 100644 (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;
 }
index e6d2e797d627e8e442524303879514e9169602a5..0902590fd29fd1f722ff6190b375571c9852da8b 100644 (file)
@@ -50,9 +50,16 @@ class SearchPath {
   virtual void ExportPath();
   virtual void Print();
   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;
 
   friend ostream & operator<< (ostream &, const SearchPath &);
+#endif
 
   const char *  GetEnvVar() const    { return environment_var; }
   CString       GetSearchPath() const { return final_search_path; }
@@ -178,7 +185,11 @@ class ManSearchPath : public SearchPath {
   virtual void    ExportPath ();
   virtual void    Print();
 
+#if defined(linux)
+  friend std::ostream & operator<< (std::ostream &, const ManSearchPath &);
+#else
   friend ostream & operator<< (ostream &, const ManSearchPath &);
+#endif
 
  protected:
   virtual void    MakePath (const CString &);