MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / parseNameAndTypeModified

Function parseNameAndTypeModified

generator/VkXMLParser.cpp:1081–1119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081std::tuple<std::string, Type, std::vector<std::string>, std::string> parseNameAndTypeModified( tinyxml2::XMLElement const * element )
1082{
1083 int const line = element->GetLineNum();
1084
1085 std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
1086 checkElements( "vk.xml",
1087 line,
1088 children,
1089 { { "name", MultipleAllowed::No } },
1090 { { "comment", MultipleAllowed::No }, { "enum", MultipleAllowed::No }, { "type", MultipleAllowed::No } } );
1091
1092 std::string name;
1093 Type type;
1094 std::vector<std::string> arraySizes;
1095 std::string bitCount;
1096 for ( auto child : children )
1097 {
1098 std::string const value = child->Value();
1099 if ( value == "enum" )
1100 {
1101 arraySizes.push_back( child->GetText() );
1102 checkForError( "vk.xml",
1103 child->PreviousSibling() && ( strcmp( child->PreviousSibling()->Value(), "[" ) == 0 ) && child->NextSibling() &&
1104 ( strcmp( child->NextSibling()->Value(), "]" ) == 0 ),
1105 line,
1106 std::string( "array specifiation is ill-formatted: <" ) + arraySizes.back() + ">" );
1107 }
1108 else if ( value == "name" )
1109 {
1110 name = parseText( child );
1111 std::tie( arraySizes, bitCount ) = readModifiers( "vk.xml", child->NextSibling() );
1112 }
1113 else if ( value == "type" )
1114 {
1115 type = parseType( child );
1116 }
1117 }
1118 return { name, type, arraySizes, bitCount };
1119}
1120
1121NameElement parseNameElement( tinyxml2::XMLElement const * element )
1122{

Callers 3

parseNameAndTypeFunction · 0.85
parseParamFunction · 0.85
parseUnionMemberFunction · 0.85

Calls 6

getChildElementsFunction · 0.85
checkElementsFunction · 0.85
checkForErrorFunction · 0.85
parseTextFunction · 0.85
readModifiersFunction · 0.85
parseTypeFunction · 0.85

Tested by

no test coverage detected