]> git.lyx.org Git - lyx.git/blob - src/mathed/math_mathmlstream.h
fix writing of integers... duh...
[lyx.git] / src / mathed / math_mathmlstream.h
1 #ifndef MATH_MATHMLSTREAM_H
2 #define MATH_MATHMLSTREAM_H
3
4 #include <iosfwd>
5 #include "support/LOstream.h"
6
7 struct MathArray;
8 struct MathInset;
9 struct Buffer;
10
11 struct MTag {
12         ///
13         MTag(char const * const tag) : tag_(tag) {}
14         ///
15         char const * const tag_;
16 };
17
18 struct ETag {
19         ///
20         ETag(char const * const tag) : tag_(tag) {}
21         ///
22         char const * const tag_;
23 };
24
25 struct MathMLStream {
26         ///
27         explicit MathMLStream(std::ostream & os);
28         ///
29         MathMLStream & operator<<(MathInset const *);
30         ///
31         MathMLStream & operator<<(MathArray const &);
32         ///
33         MathMLStream & operator<<(char const *);
34         ///
35         MathMLStream & operator<<(char);
36         ///
37         MathMLStream & operator<<(MTag const &);
38         ///
39         MathMLStream & operator<<(ETag const &);
40         ///
41         void cr();
42
43         ///
44         std::ostream & os_;
45         ///
46         int tab_;
47         ///
48         int line_;
49         ///
50         char lastchar_;
51 };
52
53
54 struct NormalStream {
55         ///
56         explicit NormalStream(std::ostream & os) : os_(os) {}
57         ///
58         std::ostream & os_;
59         ///
60         NormalStream & operator<<(MathInset const *);
61         ///
62         NormalStream & operator<<(MathArray const &);
63         ///
64         NormalStream & operator<<(char const *);
65         ///
66         NormalStream & operator<<(char);
67 };
68
69
70 struct MapleStream {
71         ///
72         explicit MapleStream(std::ostream & os) : os_(os) {}
73         ///
74         std::ostream & os_;
75         ///
76         MapleStream & operator<<(MathInset const *);
77         ///
78         MapleStream & operator<<(MathArray const &);
79         ///
80         MapleStream & operator<<(char const *);
81         ///
82         MapleStream & operator<<(char);
83         ///
84         MapleStream & operator<<(int);
85 };
86
87
88 struct OctaveStream {
89         ///
90         explicit OctaveStream(std::ostream & os) : os_(os) {}
91         ///
92         std::ostream & os_;
93         ///
94         OctaveStream & operator<<(MathInset const *);
95         ///
96         OctaveStream & operator<<(MathArray const &);
97         ///
98         OctaveStream & operator<<(char const *);
99         ///
100         OctaveStream & operator<<(char);
101 };
102
103
104 struct WriteStream {
105         ///
106         WriteStream(Buffer const * buffer_, std::ostream & os_, bool fragile_);
107         ///
108         explicit WriteStream(std::ostream & os_);
109
110         ///
111         WriteStream & operator<<(MathInset const *);
112         ///
113         WriteStream & operator<<(MathArray const &);
114         ///
115         WriteStream & operator<<(char const *);
116         ///
117         WriteStream & operator<<(char);
118         ///
119         WriteStream & operator<<(int);
120         ///
121         WriteStream & operator<<(unsigned int);
122
123         ///
124         Buffer const * buffer;
125         ///
126         std::ostream & os;
127         ///
128         bool fragile;
129         /// are we at the beginning of an MathArray?
130         bool firstitem;
131         ///
132         int line_;
133 };
134
135
136 #endif