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);
97 NormalStream & operator<<(NormalStream &, int);
110 explicit MapleStream(std::ostream & os) : os_(os) {}
112 std::ostream & os() { return os_; }
120 MapleStream & operator<<(MapleStream &, MathInset const *);
122 MapleStream & operator<<(MapleStream &, MathArray const &);
124 MapleStream & operator<<(MapleStream &, char const *);
126 MapleStream & operator<<(MapleStream &, char);
128 MapleStream & operator<<(MapleStream &, int);
136 class MathematicaStream {
139 explicit MathematicaStream(std::ostream & os) : os_(os) {}
141 std::ostream & os() { return os_; }
149 MathematicaStream & operator<<(MathematicaStream &, MathInset const *);
151 MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
153 MathematicaStream & operator<<(MathematicaStream &, char const *);
155 MathematicaStream & operator<<(MathematicaStream &, char);
157 MathematicaStream & operator<<(MathematicaStream &, int);
168 explicit OctaveStream(std::ostream & os) : os_(os) {}
170 std::ostream & os() { return os_; }
177 OctaveStream & operator<<(OctaveStream &, MathInset const *);
179 OctaveStream & operator<<(OctaveStream &, MathArray const &);
181 OctaveStream & operator<<(OctaveStream &, char const *);
183 OctaveStream & operator<<(OctaveStream &, char);
185 OctaveStream & operator<<(OctaveStream &, int);
196 WriteStream(std::ostream & os, bool fragile, bool latex);
198 explicit WriteStream(std::ostream & os_);
200 int line() const { return line_; }
202 bool fragile() const { return fragile_; }
204 bool latex() const { return latex_; }
206 std::ostream & os() { return os_; }
208 bool & firstitem() { return firstitem_; }
210 void addlines(unsigned int);
216 /// are we writing to .tex?
218 /// are we at the beginning of an MathArray?
225 WriteStream & operator<<(WriteStream &, MathInset const *);
227 WriteStream & operator<<(WriteStream &, MathArray const &);
229 WriteStream & operator<<(WriteStream &, char const *);
231 WriteStream & operator<<(WriteStream &, char);
233 WriteStream & operator<<(WriteStream &, int);
235 WriteStream & operator<<(WriteStream &, unsigned int);