]> git.lyx.org Git - lyx.git/blobdiff - src/support/sstream.h
Create a grfx::Loader class and so move large chunks of code out of
[lyx.git] / src / support / sstream.h
index 5a4d5d68fc444987f12becca97d4f4bdd8f8254e..0d7620e1e02c152d0c85856a37cb6b4e62a2019c 100644 (file)
@@ -39,11 +39,8 @@ the executable file might be covered by the GNU General Public License. */
 #include <iostream>
 #include <streambuf.h>
 
-#ifdef CXX_WORKING_NAMESPACES
 namespace std
 {
-#endif
-       
   class stringbuf : public streambuf
   {
   public:
@@ -56,7 +53,7 @@ namespace std
       streambuf(which), buf(), mode(static_cast<ios::open_mode>(which)),
       rpos(0), bufsize(1)
     { }
-       
+
     explicit stringbuf(const string &s, int which=ios::in|ios::out) :
       streambuf(which), buf(s), mode(static_cast<ios::open_mode>(which)),
       bufsize(1)
@@ -71,7 +68,7 @@ namespace std
        }
       rpos = (mode & ios::ate ? s.size() : 0);
     }
-       
+
     string str() const
     {
       const_cast<stringbuf*>(this)->sync();  // Sigh, really ugly hack
@@ -117,7 +114,7 @@ namespace std
       clear();
       static_cast<stringbuf*>(_strbuf)->str(s);
     }
-       
+
     stringbuf* rdbuf()
     {
       return &__my_sb;
@@ -128,50 +125,48 @@ namespace std
     {
       init (&__my_sb);
     }
-       
+
     stringstreambase(const string& s, int which) :
       __my_sb(s, which)
     {
       init (&__my_sb);
     }
   };
-    
+
   class istringstream : public stringstreambase, public istream {
   public:
     istringstream(int which=ios::in) :
       stringstreambase(which)
     { }
-       
+
     istringstream(const string& s, int which=ios::in) :
       stringstreambase(s, which)
     { }
   };
-    
+
   class ostringstream : public stringstreambase, public ostream {
   public:
     ostringstream(int which=ios::out) :
       stringstreambase(which)
     { }
-       
+
     ostringstream(const string& s, int which=ios::out) :
       stringstreambase(s, which)
     { }
   };
-    
+
   class stringstream : public stringstreambase, public iostream {
   public:
     stringstream(int which=ios::in|ios::out) :
       stringstreambase(which)
     { }
-    
+
     stringstream(const string &s, int which=ios::in|ios::out) :
       stringstreambase(s, which)
     { }
   };
 
-#ifdef CXX_WORKING_NAMESPACES
-}
-#endif
+} // namespace std
 
 inline int stringbuf::sync()
 {
@@ -205,7 +200,7 @@ inline int stringbuf::overflow(int ch)
   if(ch != EOF)
     {
       string::size_type oldSize = buf.size();
-      
+
       buf.replace(rpos, string::npos, 1, ch);
       if(buf.size() - oldSize != 1)
        return EOF;
@@ -225,7 +220,7 @@ inline int stringbuf::underflow()
     {
       return EOF;
     }
-  
+
   string::size_type n = egptr() - eback();
   string::size_type s;