| 216 | } |
| 217 | |
| 218 | void parseCommand( tinyxml2::XMLElement const * element, std::vector<Command> & commands ) |
| 219 | { |
| 220 | int const line = element->GetLineNum(); |
| 221 | std::map<std::string, std::string> attributes = getAttributes( element ); |
| 222 | |
| 223 | if ( attributes.contains( "alias" ) ) |
| 224 | { |
| 225 | checkAttributes( "vk.xml", line, attributes, { { "alias", {} }, { "name", {} } }, {} ); |
| 226 | checkElements( "vk.xml", line, getChildElements( element ), {} ); |
| 227 | |
| 228 | std::string alias, name; |
| 229 | for ( auto const & attribute : attributes ) |
| 230 | { |
| 231 | if ( attribute.first == "alias" ) |
| 232 | { |
| 233 | checkNoList( attribute.second, line ); |
| 234 | alias = attribute.second; |
| 235 | } |
| 236 | else if ( attribute.first == "name" ) |
| 237 | { |
| 238 | checkNoList( attribute.second, line ); |
| 239 | name = attribute.second; |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | auto commandIt = findByName( commands, alias ); |
| 244 | checkForError( "vk.xml", commandIt != commands.end(), line, "command <" + name + "> is aliased to unknown command <" + alias + ">" ); |
| 245 | checkForError( "vk.xml", |
| 246 | std::find_if( std::next( commandIt ), commands.end(), [&alias]( Command const & c ) { return c.name == alias; } ) == commands.end(), |
| 247 | line, |
| 248 | "command <" + name + "> is aliased to multiply specfied command <" + alias + ">" ); |
| 249 | checkForError( |
| 250 | "vk.xml", commandIt->aliases.insert( { name, line } ).second, line, "command <" + name + "> is already listed as alias for command <" + alias + ">" ); |
| 251 | } |
| 252 | else |
| 253 | { |
| 254 | checkAttributes( "vk.xml", |
| 255 | line, |
| 256 | attributes, |
| 257 | {}, |
| 258 | { { "allownoqueues", { "true" } }, |
| 259 | { "api", { "vulkan", "vulkanbase", "vulkansc" } }, |
| 260 | { "cmdbufferlevel", { "primary", "secondary" } }, |
| 261 | { "comment", {} }, |
| 262 | { "conditionalrendering", { "false", "true" } }, |
| 263 | { "errorcodes", {} }, |
| 264 | { "export", { "vulkan", "vulkansc" } }, |
| 265 | { "queues", {} }, |
| 266 | { "renderpass", { "both", "inside", "outside" } }, |
| 267 | { "successcodes", {} }, |
| 268 | { "tasks", { "action", "indirection", "state", "synchronization" } }, |
| 269 | { "videocoding", { "both", "inside", "outside" } } } ); |
| 270 | |
| 271 | std::vector<tinyxml2::XMLElement const *> children = getChildElements( element ); |
| 272 | checkElements( "vk.xml", |
| 273 | line, |
| 274 | children, |
| 275 | { { "param", MultipleAllowed::Yes }, { "proto", MultipleAllowed::No } }, |
no test coverage detected