3 #include "math_mathmlstream.h"
4 #include "math_inset.h"
5 #include "math_extern.h"
7 #include "support/lstrings.h"
12 MathMLStream::MathMLStream(std::ostream & os)
13 : os_(os), tab_(0), line_(0), lastchar_(0)
17 MathMLStream & operator<<(MathMLStream & ms, MathInset const * p)
22 lyxerr << "operator<<(MathMLStream, NULL) called\n";
27 MathMLStream & operator<<(MathMLStream & ms, MathArray const & ar)
34 MathMLStream & operator<<(MathMLStream & ms, char const * s)
41 MathMLStream & operator<<(MathMLStream & ms, char c)
48 MathMLStream & operator<<(MathMLStream & ms, MTag const & t)
52 ms.os() << '<' << t.tag_ << '>';
57 MathMLStream & operator<<(MathMLStream & ms, ETag const & t)
62 ms.os() << "</" << t.tag_ << '>';
67 void MathMLStream::cr()
70 for (int i = 0; i < tab(); ++i)
76 //////////////////////////////////////////////////////////////////////
79 MapleStream & operator<<(MapleStream & ms, MathInset const * p)
84 lyxerr << "operator<<(MapleStream, NULL) called\n";
89 MapleStream & operator<<(MapleStream & ms, MathArray const & ar)
96 MapleStream & operator<<(MapleStream & ms, char const * s)
103 MapleStream & operator<<(MapleStream & ms, char c)
110 MapleStream & operator<<(MapleStream & ms, int i)
117 //////////////////////////////////////////////////////////////////////
120 OctaveStream & operator<<(OctaveStream & ns, MathInset const * p)
125 lyxerr << "operator<<(OctaveStream, NULL) called\n";
130 OctaveStream & operator<<(OctaveStream & ns, MathArray const & ar)
137 OctaveStream & operator<<(OctaveStream & ns, char const * s)
144 OctaveStream & operator<<(OctaveStream & ns, char c)
151 //////////////////////////////////////////////////////////////////////
154 NormalStream & operator<<(NormalStream & ns, MathInset const * p)
159 lyxerr << "operator<<(NormalStream, NULL) called\n";
164 NormalStream & operator<<(NormalStream & ns, MathArray const & ar)
171 NormalStream & operator<<(NormalStream & ns, char const * s)
178 NormalStream & operator<<(NormalStream & ns, char c)
186 //////////////////////////////////////////////////////////////////////
189 WriteStream::WriteStream(std::ostream & os, bool fragile)
190 : os_(os), fragile_(fragile), firstitem_(false), line_(0)
194 WriteStream::WriteStream(std::ostream & os)
195 : os_(os), fragile_(false), firstitem_(false), line_(0)
199 void WriteStream::addlines(unsigned int n)
205 WriteStream & operator<<(WriteStream & ws, MathInset const * p)
210 lyxerr << "operator<<(WriteStream, NULL) called\n";
215 WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
222 WriteStream & operator<<(WriteStream & ws, char const * s)
225 ws.addlines(int(countChar(s, '\n')));
230 WriteStream & operator<<(WriteStream & ws, char c)
239 WriteStream & operator<<(WriteStream & ws, int i)
246 WriteStream & operator<<(WriteStream & ws, unsigned int i)