summaryrefslogtreecommitdiffstats
path: root/scripts/xmi2qt.pl
diff options
context:
space:
mode:
authorSandro S. Andrade <sandroandrade@kde.org>2012-10-08 23:07:41 +0000
committerSandro S. Andrade <sandroandrade@kde.org>2012-10-09 01:08:50 +0200
commitc8d1ee38d594838a18b929ddcbcd5162c53112cb (patch)
treef81388177f34157d11b7982b57fbc052f8ce1834 /scripts/xmi2qt.pl
parent403546b46277ed9fd36f5033710442605a64f5b5 (diff)
Provide enhanced implementation of property subsetting
Change-Id: I46bb59aac7798eff540538f254e610664a28c5dd Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'scripts/xmi2qt.pl')
-rwxr-xr-xscripts/xmi2qt.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/xmi2qt.pl b/scripts/xmi2qt.pl
index ff37ed4c..340d9bed 100755
--- a/scripts/xmi2qt.pl
+++ b/scripts/xmi2qt.pl
@@ -12,7 +12,7 @@ use Getopt::Std;
my %options=();
getopt("oi",\%options);
-my $xml = new XML::Simple(keyattr => { 'class' => '+name' }, forcearray => ['namespace', 'class', 'enumeration', 'attribute', 'associationend', 'operation', 'accessor', 'parameter', 'forwarddecl', 'superclass']);
+my $xml = new XML::Simple(keyattr => { 'class' => '+name', 'attribute' => '+id', 'associationend' => '+id' }, forcearray => ['namespace', 'class', 'enumeration', 'attribute', 'associationend', 'operation', 'accessor', 'parameter', 'forwarddecl', 'superclass']);
my $tt = Template->new(INTERPOLATE => 1, INCLUDE_PATH => 'templates/');
my $xmi = $xml->XMLin($options{i});
@@ -36,6 +36,12 @@ foreach my $class (values %$classes) {
class => $class,
classes => $classes
}) ne 1) { print $tt->error(); }
+ open STDOUT, '>', $options{o}."/".$namespace->{path}."/".lc($class->{name})."_p.h";
+ if ($tt->process('class_p.h', {
+ namespace => $namespace->{path},
+ class => $class,
+ classes => $classes
+ }) ne 1) { print $tt->error(); }
open STDOUT, '>', $options{o}."/".$namespace->{path}."/".lc($class->{name}).".cpp";
if ($tt->process('class.cpp', {
namespace => $namespace->{path},