]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotable.C
Standardise the header blurb in mathed.
[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_macro.h"
15 #include "math_macrotemplate.h"
16 #include "math_parser.h"
17 #include "math_mathmlstream.h"
18 #include "debug.h"
19 #include "math_support.h" // math_font_available
20
21 #include <iostream>
22
23 using std::endl;
24
25
26 MathMacroTable::table_type MathMacroTable::macro_table;
27
28
29 void MathMacroTable::dump()
30 {
31 /*
32         lyxerr << "\n------------------------------------------" << endl;
33         table_type::const_iterator it;
34         for (it = macro_table.begin(); it != macro_table.end(); ++it)
35                 lyxerr << it->first
36                         << " [" << it->second->asMacroTemplate()->nargs() << "] : "
37                         << it->second->cell(0) << endl;
38         lyxerr << "------------------------------------------" << endl;
39 */
40 }
41
42
43 MathAtom & MathMacroTable::provide(string const & name)
44 {
45         table_type::iterator pos = macro_table.find(name);
46         if (pos == macro_table.end()) {
47                 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
48                        << name << "' available." << endl;
49         }
50         return pos->second;
51 }
52
53
54 void MathMacroTable::create(MathAtom const & at)
55 {
56         macro_table[at->asMacroTemplate()->name()] = at;
57 }
58
59
60 bool MathMacroTable::has(string const & name)
61 {
62         return macro_table.find(name) != macro_table.end();
63 }