* Fixed parsing differences between in/out/inout parameters

* Added option to add all forward declarations into a separate file

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2352 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
loesje_
2012-03-18 11:44:57 +00:00
parent 713d864ebe
commit c3ba51579a
3 changed files with 21 additions and 12 deletions

View File

@ -48,7 +48,7 @@ begin
result := TypeConvList.Values[AValue]
else if CTypesList.IndexOf(AValue) > -1 then
begin
result := 'c';
result := 'idl';
if unsigned then result := Result + 'u';
result := result+AValue;
end
@ -153,7 +153,9 @@ begin
if m > 0 then s := s + '; ';
if anIDLMemberParameter.ParamInOutType=piOut then
s := s + 'out ';
s := s + 'out '
else if anIDLMemberParameter.ParamInOutType=piInOut then
s := s + 'var ';
s := s + AParamName +': ' + CTypeToPascalType(anIDLMemberParameter.ParamType,anIDLMemberParameter.ParamTypeUnsigned,TypeConvList,CTypesList);
end;
s := s + ')';
@ -187,11 +189,7 @@ begin
s := s + ';';
if assigned(AForwardDeclList) and (anIDL.InterfaceType='') then
begin
if AForwardDeclList.Count=0 then
AForwardDeclList.Add('type');
AForwardDeclList.Add(s);
end
AForwardDeclList.Add(s)
else
PascalCode.Add(s);

View File

@ -40,7 +40,7 @@ uses
type
TMemberType=(mtFunc,mtAttribute,mtConst);
TParamInOutType=(piOut,piIn);
TParamInOutType=(piNormal,piOut,piIn,piInOut);
{ TIDLMemberParameter }
@ -298,10 +298,14 @@ var
if result then
begin
CurrentIDLMemberParam := TIDLMemberParameter.Create;
if IsParamIn then
CurrentIDLMemberParam.ParamInOutType:=piIn;
if IsParamOut then
CurrentIDLMemberParam.ParamInOutType:=piOut;
if IsParamIn and IsParamOut then
CurrentIDLMemberParam.ParamInOutType:=piInOut
else if IsParamIn then
CurrentIDLMemberParam.ParamInOutType:=piIn
else if IsParamOut then
CurrentIDLMemberParam.ParamInOutType:=piOut
else
CurrentIDLMemberParam.ParamInOutType:=piNormal;
IsParamIn:=false;
IsParamOut:=false;
CurrentIDLMember.Params.Add(CurrentIDLMemberParam);
@ -363,6 +367,8 @@ begin
IsReadonly:=false;
IsUnsigned:=false;
IsConst:=false;
IsParamIn:=false;
IsParamOut:=false;
UUIDAttribute:='';
pCurrent:=@IDLString[1];
while pCurrent^ <> #0 do

View File

@ -120,8 +120,13 @@ begin
output.SaveToFile(OutputFilename);
if assigned(forwardoutput) and (forwardoutput.Count<>0) then
begin
forwardoutput.Sorted:=false;
forwardoutput.Insert(0,'type');
forwardoutput.SaveToFile(GetOptionValue('f'));
end;
finally
output.Free;
forwardoutput.Free;