MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / writeEnumTable

Method writeEnumTable

scripts/docgenerator.py:350–366  ·  view source on GitHub ↗

Output a table of enumerants.

(self, basename, values)

Source from the content-addressed store, hash-verified

348 fp.close()
349
350 def writeEnumTable(self, basename, values):
351 """Output a table of enumerants."""
352 directory = Path(self.genOpts.directory) / 'enums'
353 self.makeDir(directory)
354
355 filename = str(directory / f'{basename}.comments{self.file_suffix}')
356 self.logMsg('diag', '# Generating include file:', filename)
357
358 with open(filename, 'w', encoding='utf-8') as fp:
359 write(self.conventions.warning_comment, file=fp)
360 write(_ENUM_TABLE_PREFIX, file=fp)
361
362 for data in values:
363 write(f"|ename:{data['name']}", file=fp)
364 write(f"|{data['comment']}", file=fp)
365
366 write(_TABLE_SUFFIX, file=fp)
367
368 def writeBox(self, filename, prefix, items):
369 """Write a generalized block/box for some values."""

Callers 1

genEnumTableMethod · 0.95

Calls 3

writeFunction · 0.90
makeDirMethod · 0.80
logMsgMethod · 0.80

Tested by

no test coverage detected