MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _load

Method _load

editor/doc/doc_tools.cpp:1284–1550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282}
1283
1284Error DocTools::_load(Ref<XMLParser> parser) {
1285 Error err = OK;
1286
1287 while ((err = parser->read()) == OK) {
1288 if (parser->get_node_type() == XMLParser::NODE_ELEMENT && parser->get_node_name() == "?xml") {
1289 parser->skip_section();
1290 }
1291
1292 if (parser->get_node_type() != XMLParser::NODE_ELEMENT) {
1293 continue; //no idea what this may be, but skipping anyway
1294 }
1295
1296 ERR_FAIL_COND_V(parser->get_node_name() != "class", ERR_FILE_CORRUPT);
1297
1298 ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT);
1299 String name = parser->get_named_attribute_value("name");
1300 class_list[name] = DocData::ClassDoc();
1301 DocData::ClassDoc &c = class_list[name];
1302
1303 c.name = name;
1304 if (parser->has_attribute("inherits")) {
1305 c.inherits = parser->get_named_attribute_value("inherits");
1306 }
1307
1308 inheriting[c.inherits].insert(name);
1309
1310#ifndef DISABLE_DEPRECATED
1311 if (parser->has_attribute("is_deprecated")) {
1312 c.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
1313 }
1314 if (parser->has_attribute("is_experimental")) {
1315 c.is_experimental = parser->get_named_attribute_value("is_experimental").to_lower() == "true";
1316 }
1317#endif
1318 if (parser->has_attribute("deprecated")) {
1319 c.is_deprecated = true;
1320 c.deprecated_message = parser->get_named_attribute_value("deprecated");
1321 }
1322 if (parser->has_attribute("experimental")) {
1323 c.is_experimental = true;
1324 c.experimental_message = parser->get_named_attribute_value("experimental");
1325 }
1326
1327 if (parser->has_attribute("keywords")) {
1328 c.keywords = parser->get_named_attribute_value("keywords");
1329 }
1330
1331 while (parser->read() == OK) {
1332 if (parser->get_node_type() == XMLParser::NODE_ELEMENT) {
1333 String name2 = parser->get_node_name();
1334
1335 if (name2 == "brief_description") {
1336 parser->read();
1337 if (parser->get_node_type() == XMLParser::NODE_TEXT) {
1338 c.brief_description = parser->get_node_data();
1339 }
1340
1341 } else if (name2 == "description") {

Callers

nothing calls this directly

Calls 15

ClassDocClass · 0.85
_parse_methodsFunction · 0.85
skip_sectionMethod · 0.80
has_attributeMethod · 0.80
to_lowerMethod · 0.80
get_node_dataMethod · 0.80
strip_edgesMethod · 0.80
readMethod · 0.45
get_node_typeMethod · 0.45
get_node_nameMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected