The base class could provide load and save methods for the delphi default types. Raise EConfigLoadError.Create ('No load method for custom type ' + TypeName) įreeMem (List, Count * SizeOf (PPropInfo)) LoadMethod := Self.MethodAddress (MethodName) InputString := IniFile.ReadString ('Options', PropName, PropNotFound) TypeName := String (List ^.PropType^.Name) GetPropList (Self.ClassInfo, tkProperties, List) GetMem (List, Count * SizeOf (PPropInfo)) TypeName, PropName, InputString, MethodName : String Ĭount := GetPropList (Self.ClassInfo, tkProperties, nil) The Load methods look like this (Save method accordingly): procedure TConfiguration.Load (const FileName : String) Procedure Load (const FileName : String) Procedure Save (const FileName : String) TCustomLoadMethod = procedure (Self : TObject const Str : String) TCustomSaveMethod = function (Self : TObject P : Pointer) : String I have a base class TConfiguration = class
0 Comments
Leave a Reply. |