ifgen.enum package — docs

Skip to main content
`Ctrl`+`K`

# ifgen.enum package

## Subpackages

- ifgen.enum.python package
  - Module contents
    - `python_enum_header()`
    - `strip_t_suffix()`
    - `to_enum_name()`
    - `uses_auto()`

## Submodules

## ifgen.enum.common module

A module for common enum-generation utilities.

ifgen.enum.common.enum_from_string(task: GenerateTask, writer: IndentedFileWriter, use_map: bool) → None

  Implement an string to enumeration method without using the static map.

ifgen.enum.common.enum_to_string(task: GenerateTask, writer: IndentedFileWriter, use_map: bool) → None

  Implement an enumeration to string method without using the static map.

ifgen.enum.common.enum_to_string_function(task: GenerateTask, writer: IndentedFileWriter, use_map: bool, definition: bool = False) → None

  Generate a method for converting enum instances to strings.

ifgen.enum.common.string_to_enum_function(task: GenerateTask, writer: IndentedFileWriter, use_map: bool, definition: bool = False) → None

  Generate a method for converting string instances to enums.

## ifgen.enum.header module

A module for generating enumeration header files.

ifgen.enum.header.cpp_enum_neader(task: GenerateTask, writer: IndentedFileWriter) → None

  Create a C++ enumeration header.

ifgen.enum.header.enum_header(task: GenerateTask, writer: IndentedFileWriter) → None

  Create a header file for an enumeration.

ifgen.enum.header.enum_line(name: str, value: dict[str, int | str] | None) → str

  Build a string representing a line in an enumeration.

## ifgen.enum.map module

A module for generating static map data structures related to enumerations.

ifgen.enum.map.enum_from_string_map(task: GenerateTask, writer: IndentedFileWriter) → None

  Create a static map for string to enum conversion.

ifgen.enum.map.enum_to_string_map(task: GenerateTask, writer: IndentedFileWriter) → None

  Create a static map for enum to string conversion.

## ifgen.enum.source module

A module for generating enumeration source files.

ifgen.enum.source.create_enum_source(task: GenerateTask) → None

  Create a source file based on an enum definition.

ifgen.enum.source.enum_source(task: GenerateTask, writer: IndentedFileWriter) → None

  Create a source file for an enumeration.

## ifgen.enum.test module

A module implementing a unit-test output generator for enums.

ifgen.enum.test.create_enum_test(task: GenerateTask) → None

  Create a unit test for the enum string-conversion methods.

ifgen.enum.test.test_single(task: GenerateTask, writer: IndentedFileWriter, enum: str) → None

  Generate test code for a single enumeration instance.

ifgen.enum.test.unit_test_body(task: GenerateTask, writer: IndentedFileWriter) → None

  Implement a simple unit test for the enumeration.

## Module contents

A module implementing interfaces for enum-file generation.

ifgen.enum.create_enum(task: GenerateTask) → None

  Create a header file based on an enum definition.

ifgen.enum.create_enum_source(task: GenerateTask) → None

  Create a source file based on an enum definition.

ifgen.enum.create_enum_test(task: GenerateTask) → None

  Create a unit test for the enum string-conversion methods.