Rtti for Variant Records

Posted by Coco on Stack Overflow See other posts from Stack Overflow or by Coco
Published on 2010-05-03T09:25:41Z Indexed on 2010/05/04 7:08 UTC
Read the original article Hit count: 279

I try to write a kind of object/record serializer with Delphi 2010 and wonder if there is a way to detect, if a record is a variant record. E.g. the TRect record as defined in Types.pas:

TRect = record
case Integer of
  0: (Left, Top, Right, Bottom: Longint);
  1: (TopLeft, BottomRight: TPoint);
end; 

As my serializer should work recursively on my data structures, it will descent on the TPoint records and generate redundant information in my serialized file. Is there a way to avoid this, by getting detailed information on the record?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about delphi-2010