lyx_mirror/src/mathed/math_macrotable.C
Lars Gullik Bjønnes f1ff990de7 Always use std::endl with lyxerr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7481 a592a061-630c-0410-9148-cb99ea01b6c8
2003-08-02 11:30:30 +00:00

54 lines
1.2 KiB
C

#include <config.h>
#include "math_macrotable.h"
#include "math_macro.h"
#include "math_macrotemplate.h"
#include "math_parser.h"
#include "math_mathmlstream.h"
#include "debug.h"
#include "math_support.h" // math_font_available
#include <iostream>
using std::endl;
MathMacroTable::table_type MathMacroTable::macro_table;
void MathMacroTable::dump()
{
/*
lyxerr << "\n------------------------------------------" << endl;
table_type::const_iterator it;
for (it = macro_table.begin(); it != macro_table.end(); ++it)
lyxerr << it->first
<< " [" << it->second->asMacroTemplate()->nargs() << "] : "
<< it->second->cell(0) << endl;
lyxerr << "------------------------------------------" << endl;
*/
}
MathAtom & MathMacroTable::provide(string const & name)
{
table_type::iterator pos = macro_table.find(name);
if (pos == macro_table.end()) {
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
<< name << "' available." << endl;
}
return pos->second;
}
void MathMacroTable::create(MathAtom const & at)
{
macro_table[at->asMacroTemplate()->name()] = at;
}
bool MathMacroTable::has(string const & name)
{
return macro_table.find(name) != macro_table.end();
}