delphimvcframework/sources/MVCFramework.Serializer.Intf.pas

34 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2017-02-07 14:08:36 +01:00
unit MVCFramework.Serializer.Intf;
interface
uses
Data.DB, MVCFramework.DuckTyping;
2017-02-07 14:08:36 +01:00
const
DMVC_CLASSNAME = '$dmvc_classname';
2017-02-07 14:08:36 +01:00
type
TMVCSerializationType = (Properties, Fields);
2017-02-09 11:24:18 +01:00
IMVCSerUnSerListener = interface
['{5976F9DA-1B89-4F8C-B333-C3612071DEE0}']
procedure BeforeSerialize(const AObject: TObject);
procedure AfterDeserialize(const AObject: TObject);
end;
2017-02-07 14:08:36 +01:00
IMVCSerUnSer = interface
['{1ECA942A-E3C4-45DD-9D23-C00363B5E334}']
function SerializeObject(AObject: TObject; AIgnoredProperties: array of string): String;
function SerializeObjectStrict(AObject: TObject): String;
2017-02-07 14:08:36 +01:00
function SerializeDataSet(ADataSet: TDataSet; AIgnoredFields: array of string): String;
function SerializeCollection(AList: TObject; AIgnoredProperties: array of string): String;
function SerializeCollectionStrict(AList: TObject): String;
2017-02-07 14:08:36 +01:00
procedure DeserializeObject(ASerializedObject: String; AObject: TObject);
procedure DeserializeCollection(ASerializedObjectList: string; AList: IMVCList; AClazz: TClass);
2017-02-07 14:08:36 +01:00
end;
implementation
end.