| 1636 | } |
| 1637 | |
| 1638 | Remove parseRemove( tinyxml2::XMLElement const * element ) |
| 1639 | { |
| 1640 | int const line = element->GetLineNum(); |
| 1641 | std::map<std::string, std::string> attributes = getAttributes( element ); |
| 1642 | checkAttributes( "vk.xml", line, attributes, {}, { { "comment", {} }, { "reasonlink", {} } } ); |
| 1643 | std::vector<tinyxml2::XMLElement const *> children = getChildElements( element ); |
| 1644 | checkElements( "vk.xml", |
| 1645 | line, |
| 1646 | children, |
| 1647 | {}, |
| 1648 | { { "command", MultipleAllowed::Yes }, |
| 1649 | { "comment", MultipleAllowed::Yes }, |
| 1650 | { "enum", MultipleAllowed::Yes }, |
| 1651 | { "feature", MultipleAllowed::Yes }, |
| 1652 | { "type", MultipleAllowed::Yes } } ); |
| 1653 | |
| 1654 | Remove remove{ .xmlLine = line }; |
| 1655 | for ( auto const & attribute : attributes ) |
| 1656 | { |
| 1657 | if ( attribute.first == "comment" ) |
| 1658 | { |
| 1659 | remove.comment = attribute.second; |
| 1660 | } |
| 1661 | else if ( attribute.first == "reasonlink" ) |
| 1662 | { |
| 1663 | remove.reasonLink = attribute.second; |
| 1664 | } |
| 1665 | } |
| 1666 | |
| 1667 | for ( auto child : children ) |
| 1668 | { |
| 1669 | std::string value = child->Value(); |
| 1670 | if ( value == "command" ) |
| 1671 | { |
| 1672 | NameElement removeCommand = parseNameElement( child ); |
| 1673 | checkForError( "vk.xml", |
| 1674 | !containsByName( remove.commands, removeCommand.name ), |
| 1675 | removeCommand.xmlLine, |
| 1676 | "remove command <" + removeCommand.name + "> already listed for this remove block" ); |
| 1677 | remove.commands.push_back( std::move( removeCommand ) ); |
| 1678 | } |
| 1679 | else if ( value == "comment" ) |
| 1680 | { |
| 1681 | readComment( "vk.xml", child ); |
| 1682 | } |
| 1683 | else if ( value == "enum" ) |
| 1684 | { |
| 1685 | NameElement removeEnum = parseNameElement( child ); |
| 1686 | checkForError( "vk.xml", |
| 1687 | !containsByName( remove.enums, removeEnum.name ), |
| 1688 | removeEnum.xmlLine, |
| 1689 | "remove enum <" + removeEnum.name + "> already listed for this remove block" ); |
| 1690 | remove.enums.push_back( std::move( removeEnum ) ); |
| 1691 | } |
| 1692 | else if ( value == "feature" ) |
| 1693 | { |
| 1694 | FeatureElement removeFeature = parseFeatureElement( child ); |
| 1695 | checkForError( "vk.xml", |
no test coverage detected