TCodeTypeDeclaration Class
Represents a type declaration such as a class, record, interface, or enumeration.
Remarks
Use the IsClass, IsRecord, IsInterface, or IsEnum properties to set the kind of structure. Members (fields, methods, properties) are added via the convenience methods or directly through the Members list.
Syntax
Unit: Bcl.Code.MetaClasses
TCodeTypeDeclaration = class(TCodeTypeMember);
Methods
| Name | Description |
|---|---|
| AddField | Adds a field to this type declaration. |
| AddProperty | Adds a property to this type declaration. |
| AddOperator | Adds a class operator to this type declaration. |
| AddProcedure | Adds a procedure to this type declaration. |
| AddFunction | Adds a function to this type declaration. |
| AddConstructor | Adds a constructor to this type declaration. |
| AddDestructor | Adds a destructor named Destroy with override directive to this type. |
| DefaultCreate | Returns the default constructor, creating one if it does not exist. |
| DefaultDestroy | Returns the default destructor, creating one if it does not exist. |
| HasDefaultCreate | Returns True if a default constructor has been created. |
| FindMember | Searches for a member by name in this type. |
Properties
| Name | Description |
|---|---|
| BaseType | Gets or sets the base type (ancestor) reference for this type. |
| InterfaceTypes | Gets the list of interface types implemented by this type. |
| IsClass | Indicates whether this type is a class. |
| IsRecord | Indicates whether this type is a record. |
| IsInterface | Indicates whether this type is an interface. |
| IsEnum | Indicates whether this type is an enumeration. |
| InterfaceGuid | Gets or sets the GUID for interface types. |
| IsForward | Indicates whether this is a forward declaration. |
| Members | Gets the list of members (fields, methods, properties) in this type. |
| StructureKind | Gets the kind of structure this type represents. |