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;