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

Method getUtf

src/res/parser/formula_parser.cpp:56–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56int TeXFormulaSettingParser::getUtf(const XMLElement* e, const char* attr) throw(ex_res_parse) {
57 const char* val = e->Attribute(attr);
58 if (val == nullptr || strlen(val) == 0) {
59 throw ex_xml_parse(RESOURCE_NAME, e->Name(), attr, "no mapping!");
60 }
61 wstring wstr;
62 utf82wide(val, wstr);
63 if (wstr.empty() || wstr.length() != 1) {
64 throw ex_xml_parse(RESOURCE_NAME, e->Name(), attr, "unknown code point!");
65 }
66 return wstr[0];
67}
68
69void TeXFormulaSettingParser::add2map(
70 const XMLElement* r,

Callers

nothing calls this directly

Calls 4

ex_xml_parseClass · 0.85
utf82wideFunction · 0.85
AttributeMethod · 0.80
NameMethod · 0.80

Tested by

no test coverage detected