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() { return line_; }
44 int & tab() { return tab_; }
57 MathMLStream & operator<<(MathMLStream &, MathInset const *);
59 MathMLStream & operator<<(MathMLStream &, MathArray const &);
61 MathMLStream & operator<<(MathMLStream &, char const *);
63 MathMLStream & operator<<(MathMLStream &, char);
65 MathMLStream & operator<<(MathMLStream &, MTag const &);
67 MathMLStream & operator<<(MathMLStream &, ETag const &);
78 explicit NormalStream(std::ostream & os) : os_(os) {}
80 std::ostream & os() { return os_; }
87 NormalStream & operator<<(NormalStream &, MathInset const *);
89 NormalStream & operator<<(NormalStream &, MathArray const &);
91 NormalStream & operator<<(NormalStream &, char const *);
93 NormalStream & operator<<(NormalStream &, char);
106 explicit MapleStream(std::ostream & os) : os_(os) {}
108 std::ostream & os() { return os_; }
116 MapleStream & operator<<(MapleStream &, MathInset const *);
118 MapleStream & operator<<(MapleStream &, MathArray const &);
120 MapleStream & operator<<(MapleStream &, char const *);
122 MapleStream & operator<<(MapleStream &, char);
124 MapleStream & operator<<(MapleStream &, int);
135 explicit OctaveStream(std::ostream & os) : os_(os) {}
137 std::ostream & os() { return os_; }
144 OctaveStream & operator<<(OctaveStream &, MathInset const *);
146 OctaveStream & operator<<(OctaveStream &, MathArray const &);
148 OctaveStream & operator<<(OctaveStream &, char const *);
150 OctaveStream & operator<<(OctaveStream &, char);
161 WriteStream(std::ostream & os, bool fragile);
163 explicit WriteStream(std::ostream & os_);
164 /// yes... the references will be removed some day...
165 int & line() { return line_; }
167 bool fragile() const { return fragile_; }
169 std::ostream & os() { return os_; }
171 bool & firstitem() { return firstitem_; }
177 /// are we at the beginning of an MathArray?
184 WriteStream & operator<<(WriteStream &, MathInset const *);
186 WriteStream & operator<<(WriteStream &, MathArray const &);
188 WriteStream & operator<<(WriteStream &, char const *);
190 WriteStream & operator<<(WriteStream &, char);
192 WriteStream & operator<<(WriteStream &, int);
194 WriteStream & operator<<(WriteStream &, unsigned int);