MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / addFormula2map

Method addFormula2map

src/res/parser/formula_parser.cpp:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void TeXFormulaSettingParser::addFormula2map(
88 const XMLElement* r,
89 _out_ map<int, string>& math,
90 _out_ map<int, string>& txt) throw(ex_res_parse) {
91 while (r != nullptr) {
92 int ch = getUtf(r, "char");
93 const char* formula = r->Attribute("formula");
94 const char* text = r->Attribute("text");
95 // check
96 if (formula == nullptr) {
97 throw ex_xml_parse(RESOURCE_NAME, r->Name(), "formula", "no mapping!");
98 }
99 math[ch] = formula;
100 if (text != nullptr) txt[ch] = text;
101 r = r->NextSiblingElement("Map");
102 }
103}
104
105void TeXFormulaSettingParser::parseSymbol2Formula(
106 _out_ map<int, string>& mappings, _out_ map<int, string>& txt) throw(ex_res_parse) {

Callers

nothing calls this directly

Calls 4

ex_xml_parseClass · 0.85
AttributeMethod · 0.80
NameMethod · 0.80
NextSiblingElementMethod · 0.80

Tested by

no test coverage detected