From: Richard Heck Date: Thu, 31 Dec 2009 15:52:57 +0000 (+0000) Subject: Provide for the possibility of deferred material, per Andre's excellent X-Git-Tag: 2.0.0~4662 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=98e6886dc42c0128b5e2c6330a6fc9b87a9cfd2b;p=features.git Provide for the possibility of deferred material, per Andre's excellent suggestion. Now I wish I'd done XHTMLStream the same way.... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32691 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index c0325a97a8..9ce8f9051a 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -305,12 +305,31 @@ void MathStream::cr() } +void MathStream::defer(docstring const & s) +{ + deferred_ << s; +} + + +void MathStream::defer(string const & s) +{ + deferred_ << from_utf8(s); +} + + +docstring MathStream::deferred() const +{ + return deferred_.str(); +} + + MathStream & operator<<(MathStream & ms, docstring const & s) { ms.os() << s; return ms; } + ////////////////////////////////////////////////////////////////////// diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h index e93cef123d..51fbdd367e 100644 --- a/src/mathed/MathStream.h +++ b/src/mathed/MathStream.h @@ -256,6 +256,12 @@ public: int & tab() { return tab_; } /// friend MathStream & operator<<(MathStream &, char const *); + /// + void defer(docstring const &); + /// + void defer(std::string const &); + /// + docstring deferred() const; private: /// odocstream & os_; @@ -265,6 +271,8 @@ private: int line_; /// char lastchar_; + /// + odocstringstream deferred_; }; ///