]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotable.C
Compile fix gcc 2.95 + stlport
[lyx.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
18 using std::string;
19 using std::endl;
20
21
22 MathMacroTable::table_type MathMacroTable::macro_table;
23
24
25 void MathMacroTable::dump()
26 {
27 /*
28         lyxerr << "\n------------------------------------------" << endl;
29         table_type::const_iterator it;
30         for (it = macro_table.begin(); it != macro_table.end(); ++it)
31                 lyxerr << it->first
32                         << " [" << it->second->asMacroTemplate()->nargs() << "] : "
33                         << it->second->cell(0) << endl;
34         lyxerr << "------------------------------------------" << endl;
35 */
36 }
37
38
39 MathAtom & MathMacroTable::provide(string const & name)
40 {
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;
45         }
46         return pos->second;
47 }
48
49
50 void MathMacroTable::create(MathAtom const & at)
51 {
52         macro_table[at->asMacroTemplate()->name()] = at;
53 }
54
55
56 bool MathMacroTable::has(string const & name)
57 {
58         return macro_table.find(name) != macro_table.end();
59 }