| 1498 | } |
| 1499 | |
| 1500 | Error ResourceLoaderCompatText::get_classes_used(HashSet<StringName> *r_classes) { |
| 1501 | if (error) { |
| 1502 | return error; |
| 1503 | } |
| 1504 | |
| 1505 | ignore_resource_parsing = true; |
| 1506 | |
| 1507 | DummyReadData dummy_read; |
| 1508 | dummy_read.no_placeholders = true; |
| 1509 | VariantParser::ResourceParser rp_new; |
| 1510 | rp_new.ext_func = _parse_ext_resource_dummys; |
| 1511 | rp_new.sub_func = _parse_sub_resource_dummys; |
| 1512 | rp_new.userdata = &dummy_read; |
| 1513 | |
| 1514 | while (next_tag.name == "ext_resource") { |
| 1515 | error = VariantParserCompat::parse_tag(&stream, lines, error_text, next_tag, &rp_new); |
| 1516 | |
| 1517 | if (error) { |
| 1518 | _printerr(); |
| 1519 | return error; |
| 1520 | } |
| 1521 | } |
| 1522 | |
| 1523 | while (next_tag.name == "sub_resource" || next_tag.name == "resource") { |
| 1524 | if (next_tag.name == "sub_resource") { |
| 1525 | if (!next_tag.fields.has("type")) { |
| 1526 | error = ERR_FILE_CORRUPT; |
| 1527 | error_text = "Missing 'type' in external resource tag"; |
| 1528 | _printerr(); |
| 1529 | return error; |
| 1530 | } |
| 1531 | |
| 1532 | r_classes->insert(next_tag.fields["type"]); |
| 1533 | |
| 1534 | } else { |
| 1535 | r_classes->insert(next_tag.fields["res_type"]); |
| 1536 | } |
| 1537 | |
| 1538 | while (true) { |
| 1539 | String assign; |
| 1540 | Variant value; |
| 1541 | |
| 1542 | error = VariantParserCompat::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, &rp_new); |
| 1543 | |
| 1544 | if (error) { |
| 1545 | if (error == ERR_FILE_EOF) { |
| 1546 | return OK; |
| 1547 | } |
| 1548 | |
| 1549 | _printerr(); |
| 1550 | return error; |
| 1551 | } |
| 1552 | |
| 1553 | if (!assign.is_empty()) { |
| 1554 | continue; |
| 1555 | } else if (!next_tag.name.is_empty()) { |
| 1556 | error = OK; |
| 1557 | break; |
nothing calls this directly
no test coverage detected