| 10446 | } |
| 10447 | |
| 10448 | std::string VulkanHppGenerator::generateStructCastAssignments( std::pair<std::string, StructData> const & structData ) const |
| 10449 | { |
| 10450 | std::string castAssignments; |
| 10451 | if ( containsDeprecated( structData.second.members ) ) |
| 10452 | { |
| 10453 | for ( auto const & member : structData.second.members ) |
| 10454 | { |
| 10455 | if ( member.deprecated.empty() && ( member.type.name != "VkStructureType" ) ) |
| 10456 | { |
| 10457 | if ( member.type.name.starts_with( "Vk" ) ) |
| 10458 | { |
| 10459 | if ( member.type.isValue() ) |
| 10460 | { |
| 10461 | castAssignments += member.name + " = static_cast<" + stripPrefix( member.type.name, "Vk" ) + ">( rhs." + member.name + " );\n"; |
| 10462 | } |
| 10463 | else |
| 10464 | { |
| 10465 | castAssignments += member.name + " = reinterpret_cast<" + member.type.compose( "Vk" ) + ">( rhs." + member.name + " );\n"; |
| 10466 | } |
| 10467 | } |
| 10468 | else |
| 10469 | { |
| 10470 | castAssignments += member.name + " = rhs." + member.name + ";\n"; |
| 10471 | } |
| 10472 | } |
| 10473 | } |
| 10474 | } |
| 10475 | else |
| 10476 | { |
| 10477 | castAssignments = "*this = *reinterpret_cast<" + stripPrefix( structData.first, "Vk" ) + " const *>( &rhs );\n"; |
| 10478 | } |
| 10479 | assert( castAssignments.ends_with( "\n" ) ); |
| 10480 | castAssignments.pop_back(); |
| 10481 | return castAssignments; |
| 10482 | } |
| 10483 | |
| 10484 | std::string VulkanHppGenerator::generateStructCompareOperators( std::pair<std::string, StructData> const & structData ) const |
| 10485 | { |
nothing calls this directly
no test coverage detected