]> git.lyx.org Git - lyx.git/blobdiff - src/support/docstream.h
Fix build with GNU libstdc++ C++11 ABI
[lyx.git] / src / support / docstream.h
index 40f8e004dbceaf624469b2a81cf25912c55c4fd4..a544082f27208d0a79c7d8b89f47775e507ea380 100644 (file)
@@ -41,9 +41,9 @@ typedef std::basic_istream<char_type> idocstream;
     \endcode, not \code
     os << c;
     \endcode . The latter will not output the character, but the code point
-    as number. This is because we can't overload operator<< (our character
-    type is not a real type but a typedef). Narrow characters of type char
-    can be output as usual.
+    as number if USE_WCHAR_T is not defined. This is because we can't overload
+    operator<< (our character type is not always a real type but sometimes a
+    typedef). Narrow characters of type char can be output as usual.
  */
 typedef std::basic_ostream<char_type> odocstream;
 
@@ -79,76 +79,9 @@ public:
 /// UCS4 input stringstream
 typedef std::basic_istringstream<char_type> idocstringstream;
 
-/// UCS4 output stringstream
-typedef std::basic_ostringstream<char_type> odocstringstream;
+/// UCS4 output manipulator
+typedef odocstream & (*odocstream_manip)(odocstream &);
 
-/** Wrapper class for odocstream.
-    This class helps ensuring that no blank lines may be inadvertently output.
-    Use the special variables "breakln" and "safebreakln" as if they were
-    iomanip's to ensure that the next output will start at the beginning of
-    a line. Using "breakln", a '\n' char will be output if needed, while
-    using "safebreakln", "%\n" will be output if needed.
-    Use countLines() to retrieve the number of \n output since previous call.
-  */
-
-class otexstream {
-public:
-       ///
-       explicit otexstream(odocstream & os)
-               : os_(os), lines_(0), canbreakline_(false), protectspace_(false)
-       {}
-       ///
-       odocstream & os() { return os_; }
-       ///
-       void put(char_type const & c);
-       ///
-       size_t countLines() { size_t l = lines_; lines_ = 0; return l; }
-       ///
-       void addLines(size_t n) { lines_ += n; }
-       ///
-       void canBreakLine(bool breakline) { canbreakline_ = breakline; }
-       ///
-       bool canBreakLine() const { return canbreakline_; }
-       ///
-       void protectSpace(bool protectspace) { protectspace_ = protectspace; }
-       ///
-       bool protectSpace() const { return protectspace_; }
-private:
-       ///
-       odocstream & os_;
-       ///
-       size_t lines_;
-       ///
-       bool canbreakline_;
-       ///
-       bool protectspace_;
-};
-
-/// Helper structs for breaking a line
-struct BreakLine {
-       char n;
-};
-
-struct SafeBreakLine {
-       char n;
-};
-
-extern BreakLine breakln;
-extern SafeBreakLine safebreakln;
-
-///
-otexstream & operator<<(otexstream &, BreakLine);
-///
-otexstream & operator<<(otexstream &, SafeBreakLine);
-///
-otexstream & operator<<(otexstream &, docstring const &);
-///
-otexstream & operator<<(otexstream &, char const *);
-///
-otexstream & operator<<(otexstream &, char);
-///
-template <typename Type>
-otexstream & operator<<(otexstream & ots, Type value);
 
 /// Helper struct for changing stream encoding
 struct SetEnc {