2 * \file math_macrotable.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "math_macrotable.h"
14 #include "math_macro.h"
15 #include "math_macrotemplate.h"
16 #include "math_parser.h"
17 #include "math_mathmlstream.h"
19 #include "math_support.h" // math_font_available
26 MathMacroTable::table_type MathMacroTable::macro_table;
29 void MathMacroTable::dump()
32 lyxerr << "\n------------------------------------------" << endl;
33 table_type::const_iterator it;
34 for (it = macro_table.begin(); it != macro_table.end(); ++it)
36 << " [" << it->second->asMacroTemplate()->nargs() << "] : "
37 << it->second->cell(0) << endl;
38 lyxerr << "------------------------------------------" << endl;
43 MathAtom & MathMacroTable::provide(string const & name)
45 table_type::iterator pos = macro_table.find(name);
46 if (pos == macro_table.end()) {
47 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
48 << name << "' available." << endl;
54 void MathMacroTable::create(MathAtom const & at)
56 macro_table[at->asMacroTemplate()->name()] = at;
60 bool MathMacroTable::has(string const & name)
62 return macro_table.find(name) != macro_table.end();