Delphi-RAG-Lint

drag-lint help

Create helper class

Since: 0.94.0-alpha

Generates a Byte-family record helper for an enum type represented by a Structure-tree node.

Read this when you have an enum and want the usual conversion helpers without writing them by hand. Right-click the enum in the Structure form and choose Create helper class to generate a Byte-family record helper with ToByte, FromByte, ToInteger, FromInteger, ToString and FromString.

How to run it

Full flag list: create-enum-helper in the CLI reference.

Flags

FlagArgumentMeaningDefault
--qname<TEnum>
--apply
--json
--no-backup
--methods<csv>
--tostring
--dbPATH

Where to click

  • Right-click in the Structure form: Create helper class

Details

Generates a Byte-family record helper for an enum type represented by a Structure-tree node. Reach for it when you have an enum and want the usual ToByte/FromByte/ToInteger/FromInteger/ToString/FromString helper methods without writing them by hand.

Reaching it in the IDE

This is a RIGHT-CLICK action, not a main-menu item. Menu path: "Structure form (right-click a tree node)".

To reach it: open the Structure form first (drag-lint > Show Structure), then right-click an enum type's node in the tree and choose "Create helper class".

Running it from the CLI

The feature map lists the underlying verb as create-enum-helper. From the usage banner:

drag-lint create-enum-helper --qname <TEnum> [--apply|--json|--no-backup] [--methods <csv>] [--tostring rtti|case] [--db PATH]

--methods defaults to all six (tobyte,frombyte,tointeger,frominteger, tostring,fromstring). --tostring defaults to rtti (GetEnumName) or can be case (explicit case statement). Idempotent: if a helper for the enum already exists anywhere in the index, the action reports exists and makes no edit.

What it needs

Optional, per the feature map's Index column.

Example

Illustrative:

drag-lint create-enum-helper --qname Unit1.TColorKind --apply --db C:\Projects\MyApp\_D-RAG\MyApp.sqlite

This would generate a record helper with all six default methods for TColorKind.


All features | CLI reference | IDE menus