I think I will submit a patch to JCL/JVCL team to add the compatibility with all Generics containers. I haven't modify JCL/JVCL code, only add these to my program. Sender.WritePersistent(Sender.ConcatPaths(), TPersistent(TObjectList(List))) For this, I've created a generic method: procedure TMySerializer.WriteGenericsObjectListItem(Sender: TJvCustomAppStorage Ĭonst Path: string const List: TObject const Index: Integer const ItemName: string) Then, I just need to define how to serialize each item of the generic list. /rebates/&252fdelphi-serialize-class-to-xml. JvAppXMLFileStorage.WriteList('mylist',TObject(MyGenericList), MyGenericList.Count, WriteGenericsObjectListItem) So, I'd like to find an XML serializer for generic Delphi components, similar to the XmlSerializer used in the.NET FW. You have also JSON serialization at hand, including custom layout - see. The WriteGenericsObjectListItem method is detailed below. Serialization uses an optimized binary format, and is able to save and load any record or dynamic array as RawByteString. I've successfuly serialize my generic list with few lines of code by calling JvAppXMLFileStorage.WriteList.įirst, this is how I serialized the list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |