X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftexstream.h;h=c81bbf9a84891ad2832d5cae85f63c26936a234c;hb=f5f8c6fd3828285b67e43a9c16d4ac2ff2140944;hp=282d210163189bb5e0a93bf816e2ca2b652bebf3;hpb=8f2828197cb97d6909843b15455036490b074aa3;p=lyx.git diff --git a/src/texstream.h b/src/texstream.h index 282d210163..c81bbf9a84 100644 --- a/src/texstream.h +++ b/src/texstream.h @@ -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 +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_; ///