Table of Contents

TCodeUnit Class

Represents a complete Delphi unit with its type declarations, uses clauses, and implementation.

Syntax

Unit: Bcl.Code.MetaClasses

TCodeUnit = class(TCodeObject);

Methods

Name Description
FindAlias Searches for a type alias by name.
FindAliasByReference Searches for a type alias by the name of the type it references.
FindType Searches for a type declaration by name.
UseUnit Adds a unit to the uses clause, avoiding duplicates.

Properties

Name Description
_Types Gets the list of type declarations in this unit.
Aliases Gets the list of type alias declarations in this unit.
Constants Gets the list of global constant declarations in this unit.
Directives Gets the list of directives applied to this unit.
Finalization​Statements Gets the statements in the finalization section.
Functions Gets the list of standalone function declarations in this unit.
ImplementationUnits Gets the list of units in the implementation uses clause.
Initialization​Statements Gets the statements in the initialization section.
InterfaceUnits Gets the list of units in the interface uses clause.
Name Gets or sets the unit name.
Variables Gets the list of global variable declarations in this unit.