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

Method add2map

src/res/parser/formula_parser.cpp:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void TeXFormulaSettingParser::add2map(
70 const XMLElement* r,
71 _out_ map<int, string>& math,
72 _out_ map<int, string>& txt) throw(ex_res_parse) {
73 while (r != nullptr) {
74 int ch = getUtf(r, "char");
75 const char* symbol = r->Attribute("symbol");
76 const char* text = r->Attribute("text");
77 // check
78 if (symbol == nullptr) {
79 throw ex_xml_parse(RESOURCE_NAME, r->Name(), "symbol", "no mapping!");
80 }
81 math[ch] = symbol;
82 if (text != nullptr) txt[ch] = text;
83 r = r->NextSiblingElement("Map");
84 }
85}
86
87void TeXFormulaSettingParser::addFormula2map(
88 const XMLElement* r,

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