1 #ifndef MATH_MATHMLSTREAM_H
2 #define MATH_MATHMLSTREAM_H
5 // Please keep all four streams in one file until the interface has
21 MTag(char const * const tag) : tag_(tag) {}
23 char const * const tag_;
28 ETag(char const * const tag) : tag_(tag) {}
30 char const * const tag_;
36 explicit MathMLStream(std::ostream & os);
40 std::ostream & os() { return os_; }
42 int line() const { return line_; }
44 int & tab() { return tab_; }
46 friend MathMLStream & operator<<(MathMLStream &, char const *);
59 MathMLStream & operator<<(MathMLStream &, MathInset const *);
61 MathMLStream & operator<<(MathMLStream &, MathArray const &);
63 MathMLStream & operator<<(MathMLStream &, char const *);
65 MathMLStream & operator<<(MathMLStream &, char);
67 MathMLStream & operator<<(MathMLStream &, MTag const &);
69 MathMLStream & operator<<(MathMLStream &, ETag const &);
80 explicit NormalStream(std::ostream & os) : os_(os) {}
82 std::ostream & os() { return os_; }
89 NormalStream & operator<<(NormalStream &, MathInset const *);
91 NormalStream & operator<<(NormalStream &, MathArray const &);
93 NormalStream & operator<<(NormalStream &, char const *);
95 NormalStream & operator<<(NormalStream &, char);
108 explicit MapleStream(std::ostream & os) : os_(os) {}
110 std::ostream & os() { return os_; }
118 MapleStream & operator<<(MapleStream &, MathInset const *);
120 MapleStream & operator<<(MapleStream &, MathArray const &);
122 MapleStream & operator<<(MapleStream &, char const *);
124 MapleStream & operator<<(MapleStream &, char);
126 MapleStream & operator<<(MapleStream &, int);
134 class MathematicaStream {
137 explicit MathematicaStream(std::ostream & os) : os_(os) {}
139 std::ostream & os() { return os_; }
147 MathematicaStream & operator<<(MathematicaStream &, MathInset const *);
149 MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
151 MathematicaStream & operator<<(MathematicaStream &, char const *);
153 MathematicaStream & operator<<(MathematicaStream &, char);
155 MathematicaStream & operator<<(MathematicaStream &, int);
166 explicit OctaveStream(std::ostream & os) : os_(os) {}
168 std::ostream & os() { return os_; }
175 OctaveStream & operator<<(OctaveStream &, MathInset const *);
177 OctaveStream & operator<<(OctaveStream &, MathArray const &);
179 OctaveStream & operator<<(OctaveStream &, char const *);
181 OctaveStream & operator<<(OctaveStream &, char);
183 OctaveStream & operator<<(OctaveStream &, int);
194 WriteStream(std::ostream & os, bool fragile, bool latex);
196 explicit WriteStream(std::ostream & os_);
198 int line() const { return line_; }
200 bool fragile() const { return fragile_; }
202 bool latex() const { return latex_; }
204 std::ostream & os() { return os_; }
206 bool & firstitem() { return firstitem_; }
208 void addlines(unsigned int);
214 /// are we writing to .tex?
216 /// are we at the beginning of an MathArray?
223 WriteStream & operator<<(WriteStream &, MathInset const *);
225 WriteStream & operator<<(WriteStream &, MathArray const &);
227 WriteStream & operator<<(WriteStream &, char const *);
229 WriteStream & operator<<(WriteStream &, char);
231 WriteStream & operator<<(WriteStream &, int);
233 WriteStream & operator<<(WriteStream &, unsigned int);