Delphi XE3,System.Rtti.pas
我需要访问两个私有类函数,但我读到过,如果我修改RTL单元的接口部分,则需要重新编译所有RTL。这可不是胆小者可以做的事情!
这两个私有类函数在System.Rtti.pas中:
class function GetName<T{: enum}>(AValue: T): string; reintroduce; static;
class function GetValue<T{: enum}>(const AName: string): T; static;
System.Rtti.pas
TRttiEnumerationType = class(TRttiOrdinalType)
private
function GetMaxValue: Longint; override;
function GetMinValue: Longint; override;
function GetUnderlyingType: TRttiType;
constructor Create(APackage: TRttiPackage; AParent: TRttiObject; var P: PByte); override;
{$HINTS OFF}
function GetNames: TArray<string>;
class function GetName<T{: enum}>(AValue: T): string; reintroduce; static;
class function GetValue<T{: enum}>(const AName: string): T; static;
{$HINTS ON}
public
property UnderlyingType: TRttiType read GetUnderlyingType;
end;