Results 1 to 2 of 2

Thread: public property with rtti in delphi?

  1. #1

    public property with rtti in delphi?

    Delphi 2005 win32
    RTTI

    Can i detect if an public (not published) property exists?

    I use xml and rtti to add objects on runtime. Now one object can have a list of other objects only the list is a public property and not a published one.
    Besides making the list a published property what options do i have?

    My idea was that when i encounter an xml child tag with the name of an property of the object it would allow to add the children of that tag to items list. E.g.

    <TMyObject>
    <Items>
    <TChildObject>
    <TChildObject>
    </Items>
    </TMyObject>

    So once MyObject is created. The items is found as child. Not it looks if items is a property exists in MyObject. If it does it goes looking for children that are added by the assumed .Add( childitem). But as Items is not published it is not found :-(

    Thanks for your answers in advance.
    http://3das.noeska.com - create adventure games without programming

  2. #2

    public property with rtti in delphi?

    AFAIK, it is not possible to do this using RTTI unless the properties are published

    I think the only other option would be to make your own metadata? for your objects so you can register properties/methods with some internal list and you can then see what properties/methods the object has this way.

    cheers,
    Paul

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •