mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Merge pull request #584 from asuessenbach/sType
Add checks on member sType of structs:
This commit is contained in:
commit
f84dfab162
@ -6339,12 +6339,6 @@ void VulkanHppGenerator::readStructMember( tinyxml2::XMLElement const * element,
|
|||||||
members.push_back( MemberData( line ) );
|
members.push_back( MemberData( line ) );
|
||||||
MemberData & memberData = members.back();
|
MemberData & memberData = members.back();
|
||||||
|
|
||||||
auto valuesIt = attributes.find( "values" );
|
|
||||||
if ( valuesIt != attributes.end() )
|
|
||||||
{
|
|
||||||
memberData.values = valuesIt->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( auto child : children )
|
for ( auto child : children )
|
||||||
{
|
{
|
||||||
std::string value = child->Value();
|
std::string value = child->Value();
|
||||||
@ -6361,6 +6355,18 @@ void VulkanHppGenerator::readStructMember( tinyxml2::XMLElement const * element,
|
|||||||
readStructMemberType( child, memberData );
|
readStructMemberType( child, memberData );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto valuesIt = attributes.find( "values" );
|
||||||
|
if ( valuesIt != attributes.end() )
|
||||||
|
{
|
||||||
|
check( memberData.name == "sType",
|
||||||
|
line,
|
||||||
|
"Structure member named differently than <sType> with attribute <values> encountered: " );
|
||||||
|
check( m_sTypeValues.insert( valuesIt->second ).second,
|
||||||
|
line,
|
||||||
|
"<" + valuesIt->second + "> already encountered as values for the sType member of a struct" );
|
||||||
|
memberData.values = valuesIt->second;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanHppGenerator::readStructMemberEnum( tinyxml2::XMLElement const * element, MemberData & memberData )
|
void VulkanHppGenerator::readStructMemberEnum( tinyxml2::XMLElement const * element, MemberData & memberData )
|
||||||
|
@ -592,6 +592,7 @@ private:
|
|||||||
std::map<std::string, std::string> m_platforms;
|
std::map<std::string, std::string> m_platforms;
|
||||||
std::map<std::string, std::string> m_structureAliases;
|
std::map<std::string, std::string> m_structureAliases;
|
||||||
std::map<std::string, StructureData> m_structures;
|
std::map<std::string, StructureData> m_structures;
|
||||||
|
std::set<std::string> m_sTypeValues;
|
||||||
std::set<std::string> m_tags;
|
std::set<std::string> m_tags;
|
||||||
std::map<std::string, TypeCategory> m_types;
|
std::map<std::string, TypeCategory> m_types;
|
||||||
std::string m_typesafeCheck;
|
std::string m_typesafeCheck;
|
||||||
|
Loading…
Reference in New Issue
Block a user