Re: [fpc-pascal] Streaming of Generics

2012-05-29 Thread Sven Barth
Am 29.05.2012 12:24, schrieb Kornel Kisielewicz: On Tue, May 29, 2012 at 10:40 AM, kyan wrote: Ideally, I'd only like to write the streaming mechanism for each set of types (normal, anisstring, dynamic array, objects, interfaced objects) once, and use it for every set of items. However, there's

Re: [fpc-pascal] Streaming of Generics

2012-05-29 Thread Kornel Kisielewicz
On Tue, May 29, 2012 at 10:40 AM, kyan wrote: >> Ideally, I'd only like to write the streaming mechanism for each set >> of types (normal, anisstring, dynamic array, objects, interfaced >> objects) once, and use it for every set of items. However, there's no >> reasonable way to detect the type an

Re: [fpc-pascal] Streaming of Generics

2012-05-29 Thread kyan
> Ideally, I'd only like to write the streaming mechanism for each set > of types (normal, anisstring, dynamic array, objects, interfaced > objects) once, and use it for every set of items. However, there's no > reasonable way to detect the type and do an execution for it. Ideally You can use the

Re: [fpc-pascal] Streaming of Generics

2012-05-28 Thread Jorge Aldo G. de F. Junior
Can you create a generic that is based on a class that can stream itself using rtti regardles of its structure ? Something like Type TFundamentalClass = Class(TObject) Public Function GetProperty(Propertyname : String): Variant; Procedure SetProperty(PropertyName : String; Value : Variant); Proce

[fpc-pascal] Streaming of Generics

2012-05-28 Thread Kornel Kisielewicz
Hello all, I want to find a way to write a streaming mechanic for Generic data structures. For simplicity let's assume that I want to write a class or function to stream TFPGList (I do not use them, but my set of generic classes is written in a similar manner). However, due to FPC's restricted gen