]> git.lyx.org Git - lyx.git/blobdiff - src/support/docstream.cpp
Fix build with GNU libstdc++ C++11 ABI
[lyx.git] / src / support / docstream.cpp
index 56a78e832500fb15bcad9508e7ecfc5750dfa211..34008cb8518058e88264eb8d85bf5bf9da767815 100644 (file)
@@ -11,6 +11,7 @@
 #include <config.h>
 
 #include "support/docstream.h"
+#include "support/lstrings.h"
 #include "support/unicode.h"
 
 #include <algorithm>
@@ -402,122 +403,8 @@ odocstream & operator<<(odocstream & os, char c)
 }
 #endif
 
-
-void otexstream::put(char_type const & c)
-{
-       if (protectspace_) {
-               if (!canbreakline_ && c == ' ')
-                       os_ << "{}";
-               protectspace_ = false;
-       }
-       os_.put(c);
-       if (c == '\n') {
-               texrow_.newline();
-               canbreakline_ = false;
-       } else
-               canbreakline_ = true;
-}
-
-
-BreakLine breakln;
-SafeBreakLine safebreakln;
-
-
-otexstream & operator<<(otexstream & ots, BreakLine)
-{
-       if (ots.canBreakLine()) {
-               ots.os().put('\n');
-               ots.canBreakLine(false);
-               ots.texrow().newline();
-       }
-       ots.protectSpace(false);
-       return ots;
-}
-
-
-otexstream & operator<<(otexstream & ots, SafeBreakLine)
-{
-       if (ots.canBreakLine()) {
-               ots.os() << "%\n";
-               ots.canBreakLine(false);
-               ots.texrow().newline();
-       }
-       ots.protectSpace(false);
-       return ots;
-}
-
-
-otexstream & operator<<(otexstream & ots, docstring const & s)
-{
-       size_t const len = s.length();
-
-       // Check whether there's something to output
-       if (len == 0)
-               return ots;
-
-       if (ots.protectSpace()) {
-               if (!ots.canBreakLine() && s[0] == ' ')
-                       ots.os() << "{}";
-               ots.protectSpace(false);
-       }
-       ots.os() << s;
-       ots.texrow().newlines(count(s.begin(), s.end(), '\n'));
-       ots.canBreakLine(s[len - 1] != '\n');
-       return ots;
-}
-
-
-otexstream & operator<<(otexstream & ots, char const * s)
-{
-       size_t const len = strlen(s);
-
-       // Check whether there's something to output
-       if (len == 0)
-               return ots;
-
-       if (ots.protectSpace()) {
-               if (!ots.canBreakLine() && s[0] == ' ')
-                       ots.os() << "{}";
-               ots.protectSpace(false);
-       }
-       ots.os() << s;
-       ots.texrow().newlines(count(s, s + len, '\n'));
-       ots.canBreakLine(s[len - 1] != '\n');
-       return ots;
-}
-
-
-otexstream & operator<<(otexstream & ots, char c)
-{
-       if (ots.protectSpace()) {
-               if (!ots.canBreakLine() && c == ' ')
-                       ots.os() << "{}";
-               ots.protectSpace(false);
-       }
-       ots.os() << c;
-       if (c == '\n')
-               ots.texrow().newline();
-       ots.canBreakLine(c != '\n');
-       return ots;
-}
-
-
-template <typename Type>
-otexstream & operator<<(otexstream & ots, Type value)
-{
-       ots.os() << value;
-       ots.canBreakLine(true);
-       ots.protectSpace(false);
-       return ots;
 }
 
-template otexstream & operator<< <SetEnc>(otexstream & os, SetEnc);
-template otexstream & operator<< <double>(otexstream &, double);
-template otexstream & operator<< <int>(otexstream &, int);
-template otexstream & operator<< <unsigned int>(otexstream &, unsigned int);
-template otexstream & operator<< <unsigned long>(otexstream &, unsigned long);
-
-}
 
 #if ! defined(USE_WCHAR_T) && defined(__GNUC__)
 // We get undefined references to these virtual methods. This looks like