]> git.lyx.org Git - features.git/blob - src/mathed/math_macrotable.C
remove debug output from last commit
[features.git] / src / mathed / math_macrotable.C
1 /**
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.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_macrotable.h"
14 #include "math_macrotemplate.h"
15 #include "debug.h"
16
17 #include <boost/assert.hpp>
18
19
20 using std::string;
21 using std::endl;
22
23
24 MathMacroTable::table_type MathMacroTable::macro_table;
25
26
27 void MathMacroTable::dump()
28 {
29 /*
30         lyxerr << "\n------------------------------------------" << endl;
31         table_type::const_iterator it;
32         for (it = macro_table.begin(); it != macro_table.end(); ++it)
33                 lyxerr << it->first
34                         << " [" << it->second->asMacroTemplate()->nargs() << "] : "
35                         << it->second->cell(0) << endl;
36         lyxerr << "------------------------------------------" << endl;
37 */
38 }
39
40
41 MathAtom & MathMacroTable::provide(string const & name)
42 {
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;
47                 BOOST_ASSERT(false);
48         }
49         return pos->second;
50 }
51
52
53 void MathMacroTable::create(MathAtom const & at)
54 {
55         //lyxerr << "MathMacroTable::create: '"
56         //      << at->asMacroTemplate()->name() << "'" << endl;
57         macro_table[at->asMacroTemplate()->name()] = at;
58 }
59
60
61 bool MathMacroTable::has(string const & name)
62 {
63         return macro_table.find(name) != macro_table.end();
64 }