#include "InsetMath.h"
#include "MathData.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
#include "debug.h"
#include "support/lstrings.h"
#include <boost/current_function.hpp>
-using std::string;
-using std::ostream;
+
+namespace lyx {
+
using std::endl;
void InsetMath::dump() const
{
lyxerr << "---------------------------------------------" << endl;
- WriteStream wi(lyxerr, false, true);
+ odocstringstream os;
+ WriteStream wi(os, false, true);
write(wi);
+ lyxerr << to_utf8(os.str());
lyxerr << "\n---------------------------------------------" << endl;
}
void InsetMath::write(WriteStream & os) const
{
- string const s = name();
- os << '\\' << s.c_str();
+ docstring const s = name();
+ os << "\\" << s;
// We need an extra ' ' unless this is a single-char-non-ASCII name
// or anything non-ASCII follows
if (s.size() != 1 || isalpha(s[0]))
void InsetMath::normalize(NormalStream & os) const
{
- os << '[' << name().c_str() << "] ";
+ os << '[' << name() << "] ";
}
}
-void InsetMath::mathmlize(MathMLStream & os) const
+void InsetMath::mathmlize(MathStream & os) const
{
- NormalStream ns(os.os());
- normalize(ns);
+ NormalStream ns(os.os());
+ normalize(ns);
}
}
-string InsetMath::name() const
+docstring InsetMath::name() const
{
- return "unknown";
+ return from_ascii("unknown");
}
-ostream & operator<<(ostream & os, MathAtom const & at)
+std::ostream & operator<<(std::ostream & os, MathAtom const & at)
+{
+ odocstringstream oss;
+ WriteStream wi(oss, false, false);
+ at->write(wi);
+ return os << to_utf8(oss.str());
+}
+
+
+odocstream & operator<<(odocstream & os, MathAtom const & at)
{
WriteStream wi(os, false, false);
at->write(wi);
return os;
}
+
+
+} // namespace lyx