REMOVING WARNINGS

This commit is contained in:
Daniele Teti 2017-02-07 16:32:47 +01:00
parent 26c0eb5eb8
commit 9ef9ede924
3 changed files with 9 additions and 4 deletions

View File

@ -46,6 +46,7 @@ type
TJSONValueHelper = class helper for TJSONValue TJSONValueHelper = class helper for TJSONValue
public public
function ToJSON: String; function ToJSON: String;
function Count: Integer;
end; end;
{$ENDIF} {$ENDIF}
@ -56,6 +57,11 @@ implementation
{$IFNDEF TOJSON} {$IFNDEF TOJSON}
function TJSONValueHelper.Count: Integer;
begin
Result := Size;
end;
function TJSONValueHelper.ToJSON: String; function TJSONValueHelper.ToJSON: String;
begin begin
Result := Self.ToString; Result := Self.ToString;

View File

@ -230,7 +230,7 @@ begin
begin begin
cref := attr.Value; cref := attr.Value;
list := WrapAsList(o); list := WrapAsList(o);
for I := 0 to Arr.Size - 1 do for I := 0 to Arr.Count - 1 do
begin begin
list.Add(Mapper.JSONObjectToObject(cref, list.Add(Mapper.JSONObjectToObject(cref,
Arr.Get(I) as TJSONObject)); Arr.Get(I) as TJSONObject));
@ -241,7 +241,7 @@ begin
ListMethod := CTX.GetType(o.ClassInfo).GetMethod('Add'); ListMethod := CTX.GetType(o.ClassInfo).GetMethod('Add');
if (ListMethod <> nil) then if (ListMethod <> nil) then
begin begin
for I := 0 to Arr.Size - 1 do for I := 0 to Arr.Count - 1 do
begin begin
ListItem := TValue.Empty; ListItem := TValue.Empty;
@ -595,7 +595,7 @@ begin
if (lJValue = nil) or (not(lJValue is TJSONArray)) then if (lJValue = nil) or (not(lJValue is TJSONArray)) then
raise EMVCDeserializationException.Create('Serialized data is not a valid JSON Array'); raise EMVCDeserializationException.Create('Serialized data is not a valid JSON Array');
lJArr := TJSONArray(lJValue); lJArr := TJSONArray(lJValue);
for I := 0 to lJArr.Size - 1 do for I := 0 to lJArr.Count - 1 do
begin begin
AList.Add(JSONObjectToObject(AClazz, lJArr.Get(I) as TJSONObject)); AList.Add(JSONObjectToObject(AClazz, lJArr.Get(I) as TJSONObject));
end; end;

View File

@ -80,7 +80,6 @@ end;
procedure TTestJSONSerializer.TestSerUnSerObjectList; procedure TTestJSONSerializer.TestSerUnSerObjectList;
var var
Obj: TMyObject;
ObjList, Obj2List: TObjectList<TMyObject>; ObjList, Obj2List: TObjectList<TMyObject>;
lJSON: String; lJSON: String;
I: Integer; I: Integer;