diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-06-05 00:54:01 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-06-07 14:49:00 +0200 |
commit | 49614d38c9b298488b2cba15bbee48db8d7ec316 (patch) | |
tree | 155a546fe7b84d071a314dba5786cc19575ca548 /dcop/dcopidlng/kalyptusCxxToDcopIDL.pm | |
parent | ef23612c5643909edcad8665fadd82583501a602 (diff) | |
download | tdelibs-49614d38c9b298488b2cba15bbee48db8d7ec316.tar.gz tdelibs-49614d38c9b298488b2cba15bbee48db8d7ec316.zip |
dcopidlng fixes:
+ includes may use quotation marks
+ argument types can contain multiple words
+ avoid use long, short, int or char type as the argument name
+ avoid use type as the argument name if the const qualifier is used
+ use long notation of int types
+ the arguments can be nameless
+ return types can have qualifiers
+ do not warn on inherit of the DCOPObject and TQObject classes
+ the documentation comment does not have to end on a separate line
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'dcop/dcopidlng/kalyptusCxxToDcopIDL.pm')
-rw-r--r-- | dcop/dcopidlng/kalyptusCxxToDcopIDL.pm | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm b/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm index 8a2988f06..0d06613e4 100644 --- a/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm +++ b/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm @@ -161,18 +161,33 @@ sub generateMethod($$) $argType =~ s/^\s*(.*?)\s*$/$1/; $argType =~ s/</</g; $argType =~ s/>/>/g; - $argType =~ s/\s//g; - - $args .= " <ARG><TYPE$typeAttrs>$argType</TYPE><NAME>$arg->{ArgName}</NAME></ARG>\n"; + $argType =~ s/(\W)\s+/$1/g; + $argType =~ s/\s+(\W)/$1/g; + $argType =~ s/\b(signed|unsigned|long|short)$/$1 int/; + + $args .= " "; + $args .= "<ARG><TYPE$typeAttrs>$argType</TYPE>"; + $args .= "<NAME>$arg->{ArgName}</NAME>" if $arg->{ArgName} !~ /^$/; + $args .= "</ARG>\n"; } my $qual = ""; $qual .= " qual=\"const\"" if $flags =~ "c"; + my $r_isConst = ($returnType =~ s/^\s*const\s*//); + my $r_isRef = ($returnType =~ s/&//); + + my $retTypeAttrs = ""; + $retTypeAttrs .= " qleft=\"const\"" if $r_isConst; + $retTypeAttrs .= " qright=\"&\"" if $r_isRef; + $returnType = "void" unless $returnType; + $returnType =~ s/^\s*(.*?)\s*$/$1/; $returnType =~ s/</</g; $returnType =~ s/>/>/g; - $returnType =~ s/^\s*const\s*//; + $returnType =~ s/(\W)\s+/$1/g; + $returnType =~ s/\s+(\W)/$1/g; + $returnType =~ s/\b(signed|unsigned|long|short)$/$1 int/; my $methodCode = ""; @@ -182,7 +197,7 @@ sub generateMethod($$) if (!$isConstructor) { $methodCode .= " <$tagType$tagAttr$qual>\n"; - $methodCode .= " <TYPE>$returnType</TYPE>\n"; + $methodCode .= " <TYPE$retTypeAttrs>$returnType</TYPE>\n"; $methodCode .= " <NAME>$name</NAME>\n"; $methodCode .= "$args"; $methodCode .= " </$tagType>\n"; |