src/hmisc/macros/introspection

  Source   Edit

Procs

func enumNamesTable(En: typedesc; withDirectName: bool = true;
                    withDroppedPrefix: bool = true): seq[
    tuple[names: seq[string], value: En:type]]
  Source   Edit
func enumNamesTable[En: enum](arg: En; withDirectName: bool = true;
                              withDroppedPrefix: bool = true): seq[
    tuple[names: seq[string], value: En]]
Return list of all enum names.
  • NOTE :: for best performance assign results to const as this function computes stringified value for each enum.
  Source   Edit
func namedSubnode[T: enum](kind: T; idx: int; map: static[
    seq[tuple[key: T, subnames: seq[string]]]]; fallback: string = "<<fail>>"): string
  Source   Edit

Macros

macro directEnumName(arg: typed): untyped
#DOC   Source   Edit