You've already forked lazarus-ccr
iphonelazext: added support for unknown (unregistered) pbx class.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4427 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -41,8 +41,6 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TPBXObject }
|
|
||||||
|
|
||||||
{ PBXObject }
|
{ PBXObject }
|
||||||
|
|
||||||
PBXObject = class(TObject)
|
PBXObject = class(TObject)
|
||||||
@ -58,7 +56,7 @@ type
|
|||||||
property __id: string read _id;
|
property __id: string read _id;
|
||||||
property _headerComment: string read _fheaderComment write _fheaderComment;
|
property _headerComment: string read _fheaderComment write _fheaderComment;
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
|
function GetIsaName: string; virtual;
|
||||||
end;
|
end;
|
||||||
PBXObjectClass = class of PBXObject;
|
PBXObjectClass = class of PBXObject;
|
||||||
|
|
||||||
@ -114,6 +112,18 @@ type
|
|||||||
|
|
||||||
TObjHashList = TFPHashObjectList;
|
TObjHashList = TFPHashObjectList;
|
||||||
|
|
||||||
|
{ TPBXUnkClass }
|
||||||
|
|
||||||
|
TPBXUnkClass = class(PBXObject)
|
||||||
|
private
|
||||||
|
fisa : string;
|
||||||
|
public
|
||||||
|
constructor CreateWithName(const AISA: string);
|
||||||
|
constructor Create; override;
|
||||||
|
function GetIsaName: string; override;
|
||||||
|
property _isa: string read fisa write fisa;
|
||||||
|
end;
|
||||||
|
|
||||||
TPBXContainer = class(TObject)
|
TPBXContainer = class(TObject)
|
||||||
protected
|
protected
|
||||||
procedure ReadObjects(p: TPBXParser; objs: TObjHashList);
|
procedure ReadObjects(p: TPBXParser; objs: TObjHashList);
|
||||||
@ -256,6 +266,24 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TPBXUnkClass }
|
||||||
|
|
||||||
|
constructor TPBXUnkClass.CreateWithName(const AISA: string);
|
||||||
|
begin
|
||||||
|
fisa:=AISA;
|
||||||
|
Create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TPBXUnkClass.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TPBXUnkClass.GetIsaName: string;
|
||||||
|
begin
|
||||||
|
Result:=fisa;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TPBXValue }
|
{ TPBXValue }
|
||||||
|
|
||||||
destructor TPBXValue.Destroy;
|
destructor TPBXValue.Destroy;
|
||||||
@ -332,6 +360,11 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function PBXObject.GetIsaName: string;
|
||||||
|
begin
|
||||||
|
Result:=ClassName;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TPBXContainer }
|
{ TPBXContainer }
|
||||||
|
|
||||||
procedure PBXReref(objs: TObjHashList; refs: TList);
|
procedure PBXReref(objs: TObjHashList; refs: TList);
|
||||||
@ -383,6 +416,8 @@ begin
|
|||||||
if (p.CurEntity = etValue) and (p.Name = 'isa') then begin
|
if (p.CurEntity = etValue) and (p.Name = 'isa') then begin
|
||||||
cls:=p.Value;
|
cls:=p.Value;
|
||||||
obj:=AllocObject(cls);
|
obj:=AllocObject(cls);
|
||||||
|
if not Assigned(obj) then
|
||||||
|
obj:=TPBXUnkClass.CreateWithName(cls);
|
||||||
if Assigned(obj) then begin
|
if Assigned(obj) then begin
|
||||||
obj._headerComment:=cmt;
|
obj._headerComment:=cmt;
|
||||||
obj._id:=id;
|
obj._id:=id;
|
||||||
@ -695,11 +730,11 @@ begin
|
|||||||
|
|
||||||
w.WriteName(pbx._id, pbx._headerComment);
|
w.WriteName(pbx._id, pbx._headerComment);
|
||||||
|
|
||||||
isMan:=(pbx.ClassName='PBXFileReference') or (pbx.ClassName='PBXBuildFile');
|
isMan:=(pbx.GetIsaName='PBXFileReference') or (pbx.GetIsaName='PBXBuildFile');
|
||||||
if isMan then w.ManualLineBreak:=true;
|
if isMan then w.ManualLineBreak:=true;
|
||||||
|
|
||||||
w.OpenBlock('{');
|
w.OpenBlock('{');
|
||||||
w.WriteNamedValue('isa', pbx.ClassName);
|
w.WriteNamedValue('isa', pbx.GetIsaName);
|
||||||
|
|
||||||
p:=nil;
|
p:=nil;
|
||||||
cnt:=GetPropList(pbx, p);
|
cnt:=GetPropList(pbx, p);
|
||||||
@ -780,7 +815,7 @@ begin
|
|||||||
if AssignRef then PBXAssignRef(lst);
|
if AssignRef then PBXAssignRef(lst);
|
||||||
|
|
||||||
for i:=0 to lst.Count-1 do begin
|
for i:=0 to lst.Count-1 do begin
|
||||||
st.AddObject( PBXObject(lst[i]).ClassName+' '+PBXObject(lst[i])._id, PBXObject(lst[i]));
|
st.AddObject( PBXObject(lst[i]).GetIsaName+' '+PBXObject(lst[i])._id, PBXObject(lst[i]));
|
||||||
end;
|
end;
|
||||||
st.Sort;
|
st.Sort;
|
||||||
|
|
||||||
@ -796,11 +831,11 @@ begin
|
|||||||
w.WriteName('objects'); w.OpenBlock('{');
|
w.WriteName('objects'); w.OpenBlock('{');
|
||||||
for i:=0 to st.Count-1 do begin
|
for i:=0 to st.Count-1 do begin
|
||||||
pbx:=PBXObject(st.Objects[i]);
|
pbx:=PBXObject(st.Objects[i]);
|
||||||
if sc<>pbx.ClassName then begin
|
if sc<>pbx.GetIsaName then begin
|
||||||
if sc<>'' then begin
|
if sc<>'' then begin
|
||||||
w.WriteLineComment('End '+sc+' section');
|
w.WriteLineComment('End '+sc+' section');
|
||||||
end;
|
end;
|
||||||
sc:=pbx.ClassName;
|
sc:=pbx.GetIsaName;
|
||||||
w.WriteLineBreak();
|
w.WriteLineBreak();
|
||||||
w.WriteLineComment('Begin '+sc+' section');
|
w.WriteLineComment('Begin '+sc+' section');
|
||||||
emp.Clear;
|
emp.Clear;
|
||||||
|
Reference in New Issue
Block a user