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 |
|---|---|
| AddConstructor | Adds a constructor to this type declaration. |
| AddDestructor | Adds a destructor named Destroy with override directive to this type. |
| AddField | Adds a field to this type declaration. |
| AddFunction | Adds a function to this type declaration. |
| AddOperator | Adds a class operator to this type declaration. |
| AddProcedure | Adds a procedure to this type declaration. |
| AddProperty | Adds a property to this type declaration. |
| DefaultCreate | Returns the default constructor, creating one if it does not exist. |
| DefaultDestroy | Returns the default destructor, creating one if it does not exist. |
| FindMember | Searches for a member by name in this type. |
| HasDefaultCreate | Returns True if a default constructor has been created. |
Properties
| Name | Description |
|---|---|
| BaseType | Gets or sets the base type (ancestor) reference for this type. |
| InterfaceGuid | Gets or sets the GUID for interface types. |
| InterfaceTypes | Gets the list of interface types implemented by this type. |
| IsClass | Indicates whether this type is a class. |
| IsEnum | Indicates whether this type is an enumeration. |
| IsForward | Indicates whether this is a forward declaration. |
| IsInterface | Indicates whether this type is an interface. |
| IsRecord | Indicates whether this type is a record. |
| Members | Gets the list of members (fields, methods, properties) in this type. |
| StructureKind | Gets the kind of structure this type represents. |