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_macrotemplate.h"
22 MathMacroTable::table_type MathMacroTable::macro_table;
25 void MathMacroTable::dump()
28 lyxerr << "\n------------------------------------------" << endl;
29 table_type::const_iterator it;
30 for (it = macro_table.begin(); it != macro_table.end(); ++it)
32 << " [" << it->second->asMacroTemplate()->nargs() << "] : "
33 << it->second->cell(0) << endl;
34 lyxerr << "------------------------------------------" << endl;
39 MathAtom & MathMacroTable::provide(string const & name)
41 table_type::iterator pos = macro_table.find(name);
42 if (pos == macro_table.end()) {
43 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
44 << name << "' available." << endl;
50 void MathMacroTable::create(MathAtom const & at)
52 macro_table[at->asMacroTemplate()->name()] = at;
56 bool MathMacroTable::has(string const & name)
58 return macro_table.find(name) != macro_table.end();