]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotable.C
Always use std::endl with lyxerr
[lyx.git] / src / mathed / math_macrotable.C
1 #include <config.h>
2
3 #include "math_macrotable.h"
4 #include "math_macro.h"
5 #include "math_macrotemplate.h"
6 #include "math_parser.h"
7 #include "math_mathmlstream.h"
8 #include "debug.h"
9 #include "math_support.h" // math_font_available
10
11 #include <iostream>
12
13 using std::endl;
14
15
16 MathMacroTable::table_type MathMacroTable::macro_table;
17
18
19 void MathMacroTable::dump()
20 {
21 /*
22         lyxerr << "\n------------------------------------------" << endl;
23         table_type::const_iterator it;
24         for (it = macro_table.begin(); it != macro_table.end(); ++it)
25                 lyxerr << it->first
26                         << " [" << it->second->asMacroTemplate()->nargs() << "] : "
27                         << it->second->cell(0) << endl;
28         lyxerr << "------------------------------------------" << endl;
29 */
30 }
31
32
33 MathAtom & MathMacroTable::provide(string const & name)
34 {
35         table_type::iterator pos = macro_table.find(name);
36         if (pos == macro_table.end()) {
37                 lyxerr << "MathMacroTable::provideTemplate: no template with name '"
38                        << name << "' available." << endl;
39         }
40         return pos->second;
41 }
42
43
44 void MathMacroTable::create(MathAtom const & at)
45 {
46         macro_table[at->asMacroTemplate()->name()] = at;
47 }
48
49
50 bool MathMacroTable::has(string const & name)
51 {
52         return macro_table.find(name) != macro_table.end();
53 }