(self, structname)
return name
Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO
Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO
Generate a structure type name like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO
def generate_structure_type_from_name(self, structname):
        """Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO"""

        structure_type_parts = []
        # Tokenize into "words"
        for elem in MAIN_RE.findall(structname):
            word = elem[0]
            if word == 'Vk':
                structure_type_parts.append('VK_STRUCTURE_TYPE')
            else:
                structure_type_parts.append(word.upper())
        name = '_'.join(structure_type_parts)

        # The simple-minded rules need modification for some structure names
        subpats = [
            [ r'_H_(26[45])_',              r'_H\1_' ],
            [ r'_VULKAN_([0-9])([0-9])_',   r'_VULKAN_\1_\2_' ],
            [ r'_DIRECT_FB_',               r'_DIRECTFB_' ],
        ]

        for subpat in subpats:
            name = re.sub(subpat[0], subpat[1], name)
        return name
def generate_structure_type_from_name ( self , structname ) : structure_type_parts = [ ] # Tokenize into "words" for elem in MAIN_RE . findall ( structname ) : word = elem [ 0 ] if word == 'Vk' : structure_type_parts . append ( 'VK_STRUCTURE_TYPE' ) else : structure_type_parts . append ( word . upper ( ) ) name = '_' . join ( structure_type_parts ) # The simple-minded rules need modification for some structure names subpats = [ [ r'_H_(26[45])_' , r'_H\1_' ] , [ r'_VULKAN_([0-9])([0-9])_' , r'_VULKAN_\1_\2_' ] , [ r'_DIRECT_FB_' , r'_DIRECTFB_' ] , ] for subpat in subpats : name = re . sub ( subpat [ 0 ] , subpat [ 1 ] , name ) return name