Skip to content
Permalink
Browse files

minor refactoring - mostly documentation refinement, no functional ch…

…ange
  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Sep 19, 2019
1 parent 2b38ca0 commit ceddb68741bb4e7a261dcd471571e4bbdad15c14
Showing with 14 additions and 24 deletions.
  1. +11 −22 SQLite3/mORMot.pas
  2. +1 −0 SynCommons.pas
  3. +1 −1 SynFPCLinux.pas
  4. +1 −1 SynopseCommit.inc
aParser^.Kind := result; // default serialization from RTTI
exit;
end;
aClassType := GetClassParent(aClassType); // vmtParent slot is reference on FPC
aClassType := GetClassParent(aClassType);
P := JSONCustomParsers.FindValue(aClassType);
if (P<>nil) and (P^.Kind in [oCustomReaderWriter,oCustomPropName]) then begin
aParser^ := P^; // copy from parent
end;

function PropIsIDTypeCastedField(Prop: PPropInfo; IsObj: TJSONObject;
Value: TObject): boolean; // see [22ce911c715]
begin
if (Value<>nil) and (Prop^.PropType^.ClassSQLFieldType=sftID) then
Value: TObject): boolean;
begin // see [22ce911c715]
case IsObj of
oSQLMany:
if IdemPropName(Prop^.Name,'source') or IdemPropName(Prop^.Name,'dest') then
result := true else
result := not TSQLRecord(Value).fFill.JoinedFields;
oSQLRecord:
result := not TSQLRecord(Value).fFill.JoinedFields;
else result := false;
end else
result := false; // assume true instance by default
else result := false; // real instance for regular classes
end;
end;

type
{$endif}
tkClass: begin
Obj := P^.GetObjProp(Value);
case IsObj of
oSQLRecord,oSQLMany: // TSQLRecord or inherited
if PropIsIDTypeCastedField(P,IsObj,Value) then begin
HR(P);
Add(PtrInt(Obj)); // not true instances, but ID
end else
if Obj<>nil then begin
HR(P);
WriteObject(Obj,Options);
end;
else // TPersistent or any class defined with $M+
if Obj<>nil then begin
HR(P);
WriteObject(Obj,Options);
end;
if PropIsIDTypeCastedField(P,IsObj,Value) then begin
HR(P);
Add(PtrInt(Obj)); // not true instances, but ID
end else if Obj<>nil then begin
HR(P); // TPersistent or any class defined with $M+
WriteObject(Obj,Options);
end;
end;
// tkString (shortstring) and tkInterface is not handled

var
/// the target Operating System used for compilation, as TOperatingSystem
// - a specific Linux distribution may be detected instead of plain osLinux
OS_KIND: TOperatingSystem = {$ifdef MSWINDOWS}osWindows{$else}{$ifdef DARWIN}osOSX{$else}
{$ifdef BSD}osBSD{$else}{$ifdef LINUX}osLinux{$else}osPOSIX
{$endif}{$endif}{$endif}{$endif};
@@ -135,7 +135,7 @@ function GetUnixMSUTC: Int64;
procedure GetNowUTCSystem(out result: TSystemTime);

var
/// will contain the current Linux kernel revision, as one integer
/// will contain the current Linux kernel revision, as one 24-bit integer
// - e.g. $030d02 for 3.13.2, or $020620 for 2.6.32
KernelRevision: cardinal;

@@ -1 +1 @@
'1.18.5361'
'1.18.5362'

0 comments on commit ceddb68

Please sign in to comment.
You can’t perform that action at this time.