2017-02-07 14:08:36 +01:00
|
|
|
unit MVCFramework.Serializer.Intf;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2017-02-07 16:06:07 +01:00
|
|
|
Data.DB, MVCFramework.DuckTyping;
|
2017-02-07 14:08:36 +01:00
|
|
|
|
2017-02-08 18:29:52 +01:00
|
|
|
const
|
|
|
|
DMVC_CLASSNAME = '$dmvc_classname';
|
|
|
|
|
2017-02-07 14:08:36 +01:00
|
|
|
type
|
2017-02-08 18:29:52 +01:00
|
|
|
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;
|
2017-02-08 18:29:52 +01:00
|
|
|
function SerializeObjectStrict(AObject: TObject): String;
|
2017-02-07 14:08:36 +01:00
|
|
|
function SerializeDataSet(ADataSet: TDataSet; AIgnoredFields: array of string): String;
|
2017-02-07 16:06:07 +01:00
|
|
|
function SerializeCollection(AList: TObject; AIgnoredProperties: array of string): String;
|
2017-02-08 18:29:52 +01:00
|
|
|
function SerializeCollectionStrict(AList: TObject): String;
|
2017-02-07 14:08:36 +01:00
|
|
|
procedure DeserializeObject(ASerializedObject: String; AObject: TObject);
|
2017-02-07 16:06:07 +01:00
|
|
|
procedure DeserializeCollection(ASerializedObjectList: string; AList: IMVCList; AClazz: TClass);
|
2017-02-07 14:08:36 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
end.
|