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"
17 #include <boost/assert.hpp>
24 MathMacroTable::table_type MathMacroTable::macro_table;
27 void MathMacroTable::dump()
30 lyxerr << "\n------------------------------------------" << endl;
31 table_type::const_iterator it;
32 for (it = macro_table.begin(); it != macro_table.end(); ++it)
34 << " [" << it->second->asMacroTemplate()->nargs() << "] : "
35 << it->second->cell(0) << endl;
36 lyxerr << "------------------------------------------" << endl;
41 MathAtom & MathMacroTable::provide(string const & name)
43 table_type::iterator pos = macro_table.find(name);
44 if (pos == macro_table.end()) {
45 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
46 << name << "' available." << endl;
53 void MathMacroTable::create(MathAtom const & at)
55 //lyxerr << "MathMacroTable::create: '"
56 // << at->asMacroTemplate()->name() << "'" << endl;
57 macro_table[at->asMacroTemplate()->name()] = at;
61 bool MathMacroTable::has(string const & name)
63 return macro_table.find(name) != macro_table.end();