|
@@ -82,6 +82,7 @@ type
|
|
class function Create: TRTTIContext; static;
|
|
class function Create: TRTTIContext; static;
|
|
procedure Free;
|
|
procedure Free;
|
|
|
|
|
|
|
|
+ function FindType(const AQualifiedName: String): TRttiType;
|
|
function GetType(aTypeInfo: PTypeInfo): TRTTIType; overload;
|
|
function GetType(aTypeInfo: PTypeInfo): TRTTIType; overload;
|
|
function GetType(aClass: TClass): TRTTIType; overload;
|
|
function GetType(aClass: TClass): TRTTIType; overload;
|
|
end;
|
|
end;
|
|
@@ -387,6 +388,7 @@ implementation
|
|
|
|
|
|
var
|
|
var
|
|
GRttiContext: TRTTIContext;
|
|
GRttiContext: TRTTIContext;
|
|
|
|
+ pas: TJSObject; external name 'pas';
|
|
|
|
|
|
procedure CreateVirtualCorbaInterface(InterfaceTypeInfo: Pointer;
|
|
procedure CreateVirtualCorbaInterface(InterfaceTypeInfo: Pointer;
|
|
const MethodImplementation: TVirtualInterfaceInvokeEvent; out IntfVar); assembler;
|
|
const MethodImplementation: TVirtualInterfaceInvokeEvent; out IntfVar); assembler;
|
|
@@ -1083,6 +1085,32 @@ begin
|
|
Result:=GetType(TypeInfo(aClass));
|
|
Result:=GetType(TypeInfo(aClass));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TRTTIContext.FindType(const AQualifiedName: String): TRttiType;
|
|
|
|
+var
|
|
|
|
+ ModuleName, TypeName: String;
|
|
|
|
+
|
|
|
|
+ Module: TTypeInfoModule;
|
|
|
|
+
|
|
|
|
+ TypeFound: PTypeInfo;
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ Result := nil;
|
|
|
|
+
|
|
|
|
+ for ModuleName in TJSObject.Keys(pas) do
|
|
|
|
+ if AQualifiedName.StartsWith(ModuleName + '.') then
|
|
|
|
+ begin
|
|
|
|
+ Module := TTypeInfoModule(pas[ModuleName]);
|
|
|
|
+ TypeName := Copy(AQualifiedName, Length(ModuleName) + 2, Length(AQualifiedName));
|
|
|
|
+
|
|
|
|
+ if Module.RTTI.HasOwnProperty(TypeName) then
|
|
|
|
+ begin
|
|
|
|
+ TypeFound := PTypeInfo(Module.RTTI[TypeName]);
|
|
|
|
+
|
|
|
|
+ Exit(GetType(TypeFound));
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TRttiObject }
|
|
{ TRttiObject }
|
|
|
|
|
|
function TRttiObject.GetAttributes: TCustomAttributeArray;
|
|
function TRttiObject.GetAttributes: TCustomAttributeArray;
|