2001-11-08 12:06:56 +00:00
|
|
|
#ifndef MATH_MATHMLSTREAM_H
|
|
|
|
#define MATH_MATHMLSTREAM_H
|
2001-11-07 17:30:26 +00:00
|
|
|
|
|
|
|
#include <iosfwd>
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "support/LOstream.h"
|
2001-11-07 17:30:26 +00:00
|
|
|
|
2001-11-08 12:06:56 +00:00
|
|
|
struct MathArray;
|
|
|
|
struct MathInset;
|
|
|
|
struct Buffer;
|
2001-11-07 17:30:26 +00:00
|
|
|
|
2001-11-08 12:06:56 +00:00
|
|
|
struct MTag {
|
2001-11-07 17:30:26 +00:00
|
|
|
///
|
2001-11-08 12:06:56 +00:00
|
|
|
MTag(char const * const tag) : tag_(tag) {}
|
2001-11-07 17:30:26 +00:00
|
|
|
///
|
2001-11-08 12:06:56 +00:00
|
|
|
char const * const tag_;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ETag {
|
|
|
|
///
|
|
|
|
ETag(char const * const tag) : tag_(tag) {}
|
|
|
|
///
|
|
|
|
char const * const tag_;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MathMLStream {
|
|
|
|
///
|
|
|
|
explicit MathMLStream(std::ostream & os);
|
2001-11-07 17:30:26 +00:00
|
|
|
///
|
|
|
|
MathMLStream & operator<<(MathInset const *);
|
|
|
|
///
|
|
|
|
MathMLStream & operator<<(MathArray const &);
|
|
|
|
///
|
|
|
|
MathMLStream & operator<<(char const *);
|
|
|
|
///
|
|
|
|
MathMLStream & operator<<(char);
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
|
|
|
MathMLStream & operator<<(MTag const &);
|
|
|
|
///
|
|
|
|
MathMLStream & operator<<(ETag const &);
|
|
|
|
///
|
|
|
|
void cr();
|
|
|
|
|
|
|
|
///
|
|
|
|
std::ostream & os_;
|
|
|
|
///
|
|
|
|
int tab_;
|
|
|
|
///
|
|
|
|
int line_;
|
2001-11-09 18:02:20 +00:00
|
|
|
///
|
|
|
|
char lastchar_;
|
2001-11-08 12:06:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct NormalStream {
|
|
|
|
///
|
|
|
|
explicit NormalStream(std::ostream & os) : os_(os) {}
|
|
|
|
///
|
|
|
|
std::ostream & os_;
|
|
|
|
///
|
|
|
|
NormalStream & operator<<(MathInset const *);
|
|
|
|
///
|
|
|
|
NormalStream & operator<<(MathArray const &);
|
|
|
|
///
|
|
|
|
NormalStream & operator<<(char const *);
|
|
|
|
///
|
|
|
|
NormalStream & operator<<(char);
|
2001-11-07 17:30:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct MapleStream {
|
|
|
|
///
|
|
|
|
explicit MapleStream(std::ostream & os) : os_(os) {}
|
|
|
|
///
|
|
|
|
std::ostream & os_;
|
|
|
|
///
|
|
|
|
MapleStream & operator<<(MathInset const *);
|
|
|
|
///
|
|
|
|
MapleStream & operator<<(MathArray const &);
|
|
|
|
///
|
|
|
|
MapleStream & operator<<(char const *);
|
|
|
|
///
|
|
|
|
MapleStream & operator<<(char);
|
2001-11-09 08:35:57 +00:00
|
|
|
///
|
|
|
|
MapleStream & operator<<(int);
|
2001-11-07 17:30:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct OctaveStream {
|
|
|
|
///
|
|
|
|
explicit OctaveStream(std::ostream & os) : os_(os) {}
|
|
|
|
///
|
|
|
|
std::ostream & os_;
|
|
|
|
///
|
|
|
|
OctaveStream & operator<<(MathInset const *);
|
|
|
|
///
|
|
|
|
OctaveStream & operator<<(MathArray const &);
|
|
|
|
///
|
|
|
|
OctaveStream & operator<<(char const *);
|
|
|
|
///
|
|
|
|
OctaveStream & operator<<(char);
|
|
|
|
};
|
|
|
|
|
2001-11-08 12:06:56 +00:00
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
struct WriteStream {
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
WriteStream(Buffer const * buffer_, std::ostream & os_, bool fragile_);
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
explicit WriteStream(std::ostream & os_);
|
2001-11-08 12:06:56 +00:00
|
|
|
|
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
WriteStream & operator<<(MathInset const *);
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
WriteStream & operator<<(MathArray const &);
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
WriteStream & operator<<(char const *);
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
WriteStream & operator<<(char);
|
2001-11-08 12:06:56 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
Buffer const * buffer;
|
|
|
|
///
|
|
|
|
std::ostream & os;
|
|
|
|
///
|
|
|
|
bool fragile;
|
2001-11-13 14:45:08 +00:00
|
|
|
/// are we at the beginning of an MathArray?
|
|
|
|
bool firstitem;
|
2001-11-19 19:06:05 +00:00
|
|
|
///
|
|
|
|
int line_;
|
2001-11-08 12:06:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-11-07 17:30:26 +00:00
|
|
|
#endif
|