]> git.lyx.org Git - lyx.git/blobdiff - src/texstream.h
Merge branch 'master' of git.lyx.org:lyx
[lyx.git] / src / texstream.h
index 282d210163189bb5e0a93bf816e2ca2b652bebf3..c81bbf9a84891ad2832d5cae85f63c26936a234c 100644 (file)
@@ -19,7 +19,46 @@ namespace lyx {
 
 /** Wrapper class for odocstream.
     This class is used to automatically count the lines of the exported latex
-    code and also to ensure that no blank lines may be inadvertently output.
+    code.
+  */
+
+class otexrowstream {
+public:
+       ///
+       otexrowstream(odocstream & os, TexRow & texrow)
+               : os_(os), texrow_(texrow) {}
+       ///
+       odocstream & os() { return os_; }
+       ///
+       TexRow & texrow() { return texrow_; }
+       ///
+       void put(char_type const & c);
+       ///
+       void append(docstring const &, TexRow const &);
+private:
+       ///
+       odocstream & os_;
+       ///
+       TexRow & texrow_;
+};
+
+///
+otexrowstream & operator<<(otexrowstream &, odocstream_manip);
+///
+otexrowstream & operator<<(otexrowstream &, docstring const &);
+///
+otexrowstream & operator<<(otexrowstream &, std::string const &);
+///
+otexrowstream & operator<<(otexrowstream &, char const *);
+///
+otexrowstream & operator<<(otexrowstream &, char);
+///
+template <typename Type>
+otexrowstream & operator<<(otexrowstream & ots, Type value);
+
+
+/** Subclass for otexrowstream.
+    This class is used to ensure that no blank lines may be inadvertently output.
     To this end, 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,
@@ -28,17 +67,13 @@ namespace lyx {
     a paragraph break was just output.
   */
 
-class otexstream {
+class otexstream : public otexrowstream {
 public:
        ///
        otexstream(odocstream & os, TexRow & texrow)
-               : os_(os), texrow_(texrow), canbreakline_(false),
+               : otexrowstream(os, texrow), canbreakline_(false),
                  protectspace_(false), parbreak_(true), lastchar_(0) {}
        ///
-       odocstream & os() { return os_; }
-       ///
-       TexRow & texrow() { return texrow_; }
-       ///
        void put(char_type const & c);
        ///
        void canBreakLine(bool breakline) { canbreakline_ = breakline; }
@@ -60,10 +95,6 @@ public:
        ///
        bool afterParbreak() const { return parbreak_; }
 private:
-       ///
-       odocstream & os_;
-       ///
-       TexRow & texrow_;
        ///
        bool canbreakline_;
        ///