3 #include "math_mathmlstream.h"
4 #include "math_inset.h"
5 #include "math_extern.h"
7 #include "support/lyxalgo.h"
13 MathMLStream::MathMLStream(ostream & os)
14 : os_(os), tab_(0), line_(0), lastchar_(0)
18 MathMLStream & operator<<(MathMLStream & ms, MathInset const * p)
23 lyxerr << "operator<<(MathMLStream, NULL) called\n";
28 MathMLStream & operator<<(MathMLStream & ms, MathArray const & ar)
35 MathMLStream & operator<<(MathMLStream & ms, char const * s)
42 MathMLStream & operator<<(MathMLStream & ms, char c)
49 MathMLStream & operator<<(MathMLStream & ms, MTag const & t)
53 ms.os() << '<' << t.tag_ << '>';
58 MathMLStream & operator<<(MathMLStream & ms, ETag const & t)
63 ms.os() << "</" << t.tag_ << '>';
68 void MathMLStream::cr()
71 for (int i = 0; i < tab(); ++i)
77 //////////////////////////////////////////////////////////////////////
80 MapleStream & operator<<(MapleStream & ms, MathInset const * p)
85 lyxerr << "operator<<(MapleStream, NULL) called\n";
90 MapleStream & operator<<(MapleStream & ms, MathArray const & ar)
97 MapleStream & operator<<(MapleStream & ms, char const * s)
104 MapleStream & operator<<(MapleStream & ms, char c)
111 MapleStream & operator<<(MapleStream & ms, int i)
118 //////////////////////////////////////////////////////////////////////
121 OctaveStream & operator<<(OctaveStream & ns, MathInset const * p)
126 lyxerr << "operator<<(OctaveStream, NULL) called\n";
131 OctaveStream & operator<<(OctaveStream & ns, MathArray const & ar)
138 OctaveStream & operator<<(OctaveStream & ns, char const * s)
145 OctaveStream & operator<<(OctaveStream & ns, char c)
152 //////////////////////////////////////////////////////////////////////
155 NormalStream & operator<<(NormalStream & ns, MathInset const * p)
160 lyxerr << "operator<<(NormalStream, NULL) called\n";
165 NormalStream & operator<<(NormalStream & ns, MathArray const & ar)
172 NormalStream & operator<<(NormalStream & ns, char const * s)
179 NormalStream & operator<<(NormalStream & ns, char c)
187 //////////////////////////////////////////////////////////////////////
190 WriteStream::WriteStream(ostream & os, bool fragile, bool latex)
191 : os_(os), fragile_(fragile), latex_(latex), firstitem_(false), line_(0)
195 WriteStream::WriteStream(ostream & os)
196 : os_(os), fragile_(false), latex_(false), firstitem_(false), line_(0)
200 void WriteStream::addlines(unsigned int n)
206 WriteStream & operator<<(WriteStream & ws, MathInset const * p)
211 lyxerr << "operator<<(WriteStream, NULL) called\n";
216 WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
223 WriteStream & operator<<(WriteStream & ws, char const * s)
226 ws.addlines(int(lyx::count(s, s+strlen(s), '\n')));
231 WriteStream & operator<<(WriteStream & ws, char c)
240 WriteStream & operator<<(WriteStream & ws, int i)
247 WriteStream & operator<<(WriteStream & ws, unsigned int i)