+#include <config.h>
+
#include "math_symbolinset.h"
#include "math_mathmlstream.h"
+#include "math_streamstr.h"
#include "math_support.h"
#include "math_parser.h"
#include "debug.h"
{}
+MathSymbolInset::MathSymbolInset(string const & name)
+ : sym_(in_word_set(name.c_str())), h_(0)
+{}
+
+
MathInset * MathSymbolInset::clone() const
{
void MathSymbolInset::normalize(NormalStream & os) const
{
- os << "[symbol " << name().c_str() << "]";
+ os << "[symbol " << name() << "]";
}
if (name() == "cdot")
os << '*';
else
- os << name().c_str();
+ os << name();
}
}
+bool MathSymbolInset::match(MathInset * p) const
+{
+ MathSymbolInset const * q = p->asSymbolInset();
+ return q && name() == q->name();
+}
+
+
void MathSymbolInset::mathmlize(MathMLStream & os) const
{
char const * type = MathMLtype(sym_->type);
os << '<' << type << "> ";
if (sym_->xmlname == "x") // unknown so far
- os << name().c_str();
+ os << name();
else
- os << sym_->xmlname.c_str();
+ os << sym_->xmlname;
os << " </" << type << '>';
}
if (name() == "cdot")
os << '*';
else
- os << name().c_str();
+ os << name();
}
void MathSymbolInset::write(WriteStream & os) const
{
- os << '\\' << name().c_str() << ' ';
+ os << '\\' << name() << ' ';
}