Getting RTTI for Rooted Types (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example illustrates the usage of the TRttiContext.GetTypes method.

Code

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils, Rtti;

var
  LContext: TRttiContext;
  LType: TRttiType;

begin
  LContext := TRttiContext.Create;

  try
    for LType in LContext.GetTypes do
    begin
      Writeln(LType.Name);
    end;
  finally
    LContext.Free;
  end;

end.

Console Output (Incomplete)

IValueData
TValueData
TValue
TRttiObject
TRttiNamedObject
TRttiType
...

Uses