You are not logged in.
When I use mormot.core.rtti and retrieve the properties of a class, each of them is represented by a "TRttiCustomProp" record. Is there a way to access the original Delphi rtti context information?
Reason: I want to check attributes assigned to that specific property. Another way to retrieve them would be appreciated as well ;-)
Regards,
Daniel
Offline
You have access to the TypeInfo() pointer as in the Value^.Info: PRttiInfo field.
In fact, in mORMot units, the PRttiInfo type is just a wrapper around the raw TypeInfo() RTTI pointer.
Offline
You have access to the TypeInfo() pointer as in the Value^.Info: PRttiInfo field.
Tried it again, but this gives me the TypeInfo of the property value type.For: Sample writing
Ctxt.GetType(Entry.Value.Info)
for
[MyAttribute]
property XYZ: Integer read FXYZ write FXYZ
it would return the type info for "Integer", which doesn't help. If I would
Ctxt.GetType(Entry.Prop)
, I do get back the correct Delphi Rtti object (of class TRttiInstancePropertyClassic), however, something is off, as I do not get the list of attributes attached to that property.
Strange...
Daniel
Last edited by sakura (2024-04-13 14:21:25)
Offline
Have you checked using delphi own's rtti mechanisms , aka TRttiContext ?
Offline