3 #include "math_mathmlstream.h"
4 #include "math_inset.h"
5 #include "math_extern.h"
11 MathMLStream::MathMLStream(std::ostream & os)
12 : os_(os), tab_(0), line_(0), lastchar_(0)
16 MathMLStream & operator<<(MathMLStream & ms, MathInset const * p)
21 lyxerr << "operator<<(MathMLStream, NULL) called\n";
26 MathMLStream & operator<<(MathMLStream & ms, MathArray const & ar)
33 MathMLStream & operator<<(MathMLStream & ms, char const * s)
40 MathMLStream & operator<<(MathMLStream & ms, char c)
47 MathMLStream & operator<<(MathMLStream & ms, MTag const & t)
51 ms.os() << '<' << t.tag_ << '>';
56 MathMLStream & operator<<(MathMLStream & ms, ETag const & t)
61 ms.os() << "</" << t.tag_ << '>';
66 void MathMLStream::cr()
69 for (int i = 0; i < tab(); ++i)
75 //////////////////////////////////////////////////////////////////////
78 MapleStream & operator<<(MapleStream & ms, MathInset const * p)
83 lyxerr << "operator<<(MapleStream, NULL) called\n";
88 MapleStream & operator<<(MapleStream & ms, MathArray const & ar)
95 MapleStream & operator<<(MapleStream & ms, char const * s)
102 MapleStream & operator<<(MapleStream & ms, char c)
109 MapleStream & operator<<(MapleStream & ms, int i)
116 //////////////////////////////////////////////////////////////////////
119 OctaveStream & operator<<(OctaveStream & ns, MathInset const * p)
124 lyxerr << "operator<<(OctaveStream, NULL) called\n";
129 OctaveStream & operator<<(OctaveStream & ns, MathArray const & ar)
136 OctaveStream & operator<<(OctaveStream & ns, char const * s)
143 OctaveStream & operator<<(OctaveStream & ns, char c)
150 //////////////////////////////////////////////////////////////////////
153 NormalStream & operator<<(NormalStream & ns, MathInset const * p)
158 lyxerr << "operator<<(NormalStream, NULL) called\n";
163 NormalStream & operator<<(NormalStream & ns, MathArray const & ar)
170 NormalStream & operator<<(NormalStream & ns, char const * s)
177 NormalStream & operator<<(NormalStream & ns, char c)
185 //////////////////////////////////////////////////////////////////////
188 WriteStream::WriteStream(std::ostream & os, bool fragile)
189 : os_(os), fragile_(fragile), line_(0)
193 WriteStream::WriteStream(std::ostream & os)
194 : os_(os), fragile_(false), line_(0)
198 WriteStream & operator<<(WriteStream & ws, MathInset const * p)
203 lyxerr << "operator<<(WriteStream, NULL) called\n";
208 WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
215 WriteStream & operator<<(WriteStream & ws, char const * s)
218 ws.line() += std::count(s, s + strlen(s), '\n');
223 WriteStream & operator<<(WriteStream & ws, char c)
232 WriteStream & operator<<(WriteStream & ws, int i)
239 WriteStream & operator<<(WriteStream & ws, unsigned int i)