1 #ifndef MATH_MATHMLSTREAM_H
2 #define MATH_MATHMLSTREAM_H
5 // Please keep all four streams in one file until the interface has
9 #include "math_metricsinfo.h"
23 MTag(char const * const tag) : tag_(tag) {}
25 char const * const tag_;
30 ETag(char const * const tag) : tag_(tag) {}
32 char const * const tag_;
38 explicit MathMLStream(std::ostream & os);
42 std::ostream & os() { return os_; }
44 int line() const { return line_; }
46 int & tab() { return tab_; }
48 friend MathMLStream & operator<<(MathMLStream &, char const *);
61 MathMLStream & operator<<(MathMLStream &, MathInset const *);
63 MathMLStream & operator<<(MathMLStream &, MathArray const &);
65 MathMLStream & operator<<(MathMLStream &, char const *);
67 MathMLStream & operator<<(MathMLStream &, char);
69 MathMLStream & operator<<(MathMLStream &, MTag const &);
71 MathMLStream & operator<<(MathMLStream &, ETag const &);
82 explicit NormalStream(std::ostream & os) : os_(os) {}
84 std::ostream & os() { return os_; }
91 NormalStream & operator<<(NormalStream &, MathInset const *);
93 NormalStream & operator<<(NormalStream &, MathArray const &);
95 NormalStream & operator<<(NormalStream &, char const *);
97 NormalStream & operator<<(NormalStream &, char);
99 NormalStream & operator<<(NormalStream &, int);
112 explicit MapleStream(std::ostream & os) : os_(os) {}
114 std::ostream & os() { return os_; }
122 MapleStream & operator<<(MapleStream &, MathInset const *);
124 MapleStream & operator<<(MapleStream &, MathArray const &);
126 MapleStream & operator<<(MapleStream &, char const *);
128 MapleStream & operator<<(MapleStream &, char);
130 MapleStream & operator<<(MapleStream &, int);
138 class MathematicaStream {
141 explicit MathematicaStream(std::ostream & os) : os_(os) {}
143 std::ostream & os() { return os_; }
151 MathematicaStream & operator<<(MathematicaStream &, MathInset const *);
153 MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
155 MathematicaStream & operator<<(MathematicaStream &, char const *);
157 MathematicaStream & operator<<(MathematicaStream &, char);
159 MathematicaStream & operator<<(MathematicaStream &, int);
170 explicit OctaveStream(std::ostream & os) : os_(os) {}
172 std::ostream & os() { return os_; }
179 OctaveStream & operator<<(OctaveStream &, MathInset const *);
181 OctaveStream & operator<<(OctaveStream &, MathArray const &);
183 OctaveStream & operator<<(OctaveStream &, char const *);
185 OctaveStream & operator<<(OctaveStream &, char);
187 OctaveStream & operator<<(OctaveStream &, int);
198 WriteStream(std::ostream & os, bool fragile, bool latex);
200 explicit WriteStream(std::ostream & os_);
202 int line() const { return line_; }
204 bool fragile() const { return fragile_; }
206 bool latex() const { return latex_; }
208 std::ostream & os() { return os_; }
210 bool & firstitem() { return firstitem_; }
212 void addlines(unsigned int);
218 /// are we writing to .tex?
220 /// are we at the beginning of an MathArray?
227 WriteStream & operator<<(WriteStream &, MathInset const *);
229 WriteStream & operator<<(WriteStream &, MathArray const &);
231 WriteStream & operator<<(WriteStream &, char const *);
233 WriteStream & operator<<(WriteStream &, char);
235 WriteStream & operator<<(WriteStream &, int);
237 WriteStream & operator<<(WriteStream &, unsigned int);