3 #include "math_mathmlstream.h"
4 #include "math_inset.h"
5 #include "math_extern.h"
7 #include "support/lyxalgo.h"
14 MathMLStream::MathMLStream(ostream & os)
15 : os_(os), tab_(0), line_(0), lastchar_(0)
19 MathMLStream & operator<<(MathMLStream & ms, MathInset const * p)
24 lyxerr << "operator<<(MathMLStream, NULL) called\n";
29 MathMLStream & operator<<(MathMLStream & ms, MathArray const & ar)
36 MathMLStream & operator<<(MathMLStream & ms, char const * s)
43 MathMLStream & operator<<(MathMLStream & ms, char c)
50 MathMLStream & operator<<(MathMLStream & ms, MTag const & t)
54 ms.os() << '<' << t.tag_ << '>';
59 MathMLStream & operator<<(MathMLStream & ms, ETag const & t)
64 ms.os() << "</" << t.tag_ << '>';
69 void MathMLStream::cr()
72 for (int i = 0; i < tab(); ++i)
78 //////////////////////////////////////////////////////////////////////
81 MapleStream & operator<<(MapleStream & ms, MathInset const * p)
86 lyxerr << "operator<<(MapleStream, NULL) called\n";
91 MapleStream & operator<<(MapleStream & ms, MathArray const & ar)
98 MapleStream & operator<<(MapleStream & ms, char const * s)
105 MapleStream & operator<<(MapleStream & ms, char c)
112 MapleStream & operator<<(MapleStream & ms, int i)
119 //////////////////////////////////////////////////////////////////////
122 OctaveStream & operator<<(OctaveStream & ns, MathInset const * p)
127 lyxerr << "operator<<(OctaveStream, NULL) called\n";
132 OctaveStream & operator<<(OctaveStream & ns, MathArray const & ar)
139 OctaveStream & operator<<(OctaveStream & ns, char const * s)
146 OctaveStream & operator<<(OctaveStream & ns, char c)
153 OctaveStream & operator<<(OctaveStream & ns, int i)
160 //////////////////////////////////////////////////////////////////////
163 NormalStream & operator<<(NormalStream & ns, MathInset const * p)
168 lyxerr << "operator<<(NormalStream, NULL) called\n";
173 NormalStream & operator<<(NormalStream & ns, MathArray const & ar)
180 NormalStream & operator<<(NormalStream & ns, char const * s)
187 NormalStream & operator<<(NormalStream & ns, char c)
195 //////////////////////////////////////////////////////////////////////
198 WriteStream::WriteStream(ostream & os, bool fragile, bool latex)
199 : os_(os), fragile_(fragile), latex_(latex), firstitem_(false), line_(0)
203 WriteStream::WriteStream(ostream & os)
204 : os_(os), fragile_(false), latex_(false), firstitem_(false), line_(0)
208 void WriteStream::addlines(unsigned int n)
214 WriteStream & operator<<(WriteStream & ws, MathInset const * p)
219 lyxerr << "operator<<(WriteStream, NULL) called\n";
224 WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
231 WriteStream & operator<<(WriteStream & ws, char const * s)
234 ws.addlines(int(lyx::count(s, s+strlen(s), '\n')));
239 WriteStream & operator<<(WriteStream & ws, char c)
248 WriteStream & operator<<(WriteStream & ws, int i)
255 WriteStream & operator<<(WriteStream & ws, unsigned int i)