tvalue

Rtti data manipulation and consistency in Delphi 2010

两盒软妹~` 提交于 2019-12-22 10:55:16
问题 Has anyone an idea, how I can make TValue using a reference to the original data? In my serialization project, I use (as suggested in XML-Serialization) a generic serializer which stores TValues in an internal tree-structure (similar to the MemberMap in the example). This member-tree should also be used to create a dynamic setup form and manipulate the data. My idea was to define a property for the Data: TDataModel <T> = class {...} private FData : TValue; function GetData : T; procedure

Delphi 2010 RTTI : Use TValue to store data

戏子无情 提交于 2019-12-07 18:11:44
问题 I would like to be able to use TValue to store Data in a TList<>. Like in : type TXmlBuilder = class type TXmlAttribute = class Name: String; Value: TValue; // TValue comes from Rtti end; TXmlNode = class Name: String; Parent: TXmlNode; Value: TXmlNode; Attributes: TList<TXmlAttribute>; Nodes: TList<TXmlNode>; function AsString(Indent: Integer): String; end; ... public ... function N(const Name: String): TXmlBuilder; function V(const Value: String): TXmlBuilder; function A(const Name: String;

Delphi 2010 RTTI : Use TValue to store data

大憨熊 提交于 2019-12-06 05:18:12
I would like to be able to use TValue to store Data in a TList<>. Like in : type TXmlBuilder = class type TXmlAttribute = class Name: String; Value: TValue; // TValue comes from Rtti end; TXmlNode = class Name: String; Parent: TXmlNode; Value: TXmlNode; Attributes: TList<TXmlAttribute>; Nodes: TList<TXmlNode>; function AsString(Indent: Integer): String; end; ... public ... function N(const Name: String): TXmlBuilder; function V(const Value: String): TXmlBuilder; function A(const Name: String; Value: TValue): TXmlBuilder; overload; function A<T>(const Name: String; Value: T): TXmlBuilder;

Rtti data manipulation and consistency in Delphi 2010

这一生的挚爱 提交于 2019-12-06 03:33:22
Has anyone an idea, how I can make TValue using a reference to the original data? In my serialization project, I use (as suggested in XML-Serialization ) a generic serializer which stores TValues in an internal tree-structure (similar to the MemberMap in the example). This member-tree should also be used to create a dynamic setup form and manipulate the data. My idea was to define a property for the Data: TDataModel <T> = class {...} private FData : TValue; function GetData : T; procedure SetData (Value : T); public property Data : T read GetData write SetData; end; The implementation of the