-
Notifications
You must be signed in to change notification settings - Fork 186
/
Quick.Serializer.Intf.pas
43 lines (37 loc) · 1.36 KB
/
Quick.Serializer.Intf.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
unit Quick.Serializer.Intf;
interface
uses
SysUtils,
{$IFNDEF FPC}
rtti;
{$ELSE}
Rtti,
rttiutils;
{$ENDIF}
type
TSerializerOptions = class
private
fUseEnumNames : Boolean;
fUseJsonCaseSense : Boolean;
fUseBase64Stream : Boolean;
fUseNullStringsAsEmpty : Boolean;
fUseGUIDWithBrackets: Boolean;
fUseGUIDLowercase: Boolean;
public
property UseEnumNames : Boolean read fUseEnumNames write fUseEnumNames;
property UseJsonCaseSense : Boolean read fUseJsonCaseSense write fUseJsonCaseSense;
property UseBase64Stream : Boolean read fUseBase64Stream write fUseBase64Stream;
property UseNullStringsAsEmpty : Boolean read fUseNullStringsAsEmpty write fUseNullStringsAsEmpty;
property UseGUIDWithBrackets : Boolean read fUseGUIDWithBrackets write fUseGUIDWithBrackets;
property UseGUIDLowercase : Boolean read fUseGUIDLowercase write fUseGUIDLowercase;
end;
ISerializer = interface
['{CA26F7AE-F1FE-41BE-9C23-723A687F60D1}']
function JsonToObject(aType: TClass; const aJson: string): TObject; overload;
function JsonToObject(aObject: TObject; const aJson: string): TObject; overload;
function ObjectToJson(aObject : TObject; aIndent : Boolean = False): string;
function ValueToJson(const aValue : TValue; aIndent : Boolean = False) : string;
function Options : TSerializerOptions;
end;
implementation
end.