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"
21 MathMacroTable::table_type MathMacroTable::macro_table;
24 void MathMacroTable::dump()
27 lyxerr << "\n------------------------------------------" << endl;
28 table_type::const_iterator it;
29 for (it = macro_table.begin(); it != macro_table.end(); ++it)
31 << " [" << it->second->asMacroTemplate()->nargs() << "] : "
32 << it->second->cell(0) << endl;
33 lyxerr << "------------------------------------------" << endl;
38 MathAtom & MathMacroTable::provide(string const & name)
40 table_type::iterator pos = macro_table.find(name);
41 if (pos == macro_table.end()) {
42 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
43 << name << "' available." << endl;
49 void MathMacroTable::create(MathAtom const & at)
51 macro_table[at->asMacroTemplate()->name()] = at;
55 bool MathMacroTable::has(string const & name)
57 return macro_table.find(name) != macro_table.end();