MCPcopy Index your code
hub / github.com/KhronosGroup/Vulkan-Docs / mostOfficial

Function mostOfficial

scripts/scriptgenerator.py:9–26  ·  view source on GitHub ↗

Return the 'most official' of two related names, api and newapi. KHR is more official than EXT is more official than everything else. If there is ambiguity, return api. Accommodate APIs using lower-case vendor suffixes.

(api, newapi)

Source from the content-addressed store, hash-verified

7from generator import OutputGenerator, enquote, noneStr
8
9def mostOfficial(api, newapi):
10 """Return the 'most official' of two related names, api and newapi.
11 KHR is more official than EXT is more official than everything else.
12 If there is ambiguity, return api.
13 Accommodate APIs using lower-case vendor suffixes."""
14
15 apicat = api[-3:].upper()
16 newapicat = newapi[-3:].upper()
17
18 if apicat == 'KHR':
19 return api
20 if newapicat == 'KHR':
21 return newapi;
22 if apicat == 'EXT':
23 return api
24 if newapicat == 'EXT':
25 return newapi;
26 return api
27
28class ScriptOutputGenerator(OutputGenerator):
29 """ScriptOutputGenerator - subclass of OutputGenerator.

Callers 1

createInverseMapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected