• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
  • perl
perlwriter.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2003 David Hugh-Jones <hughjonesd@yahoo.co.uk> *
8  * copyright (C) 2004-2013 *
9  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10  ***************************************************************************/
11 
12 #include "perlwriter.h"
13 
14 #include "association.h"
15 #include "attribute.h"
16 #include "classifier.h"
17 #include "operation.h"
18 #include "umldoc.h"
19 #include "uml.h"
20 
21 #include <QDateTime>
22 #include <QDir>
23 #include <QRegExp>
24 #include <QString>
25 #include <QTextStream>
26 
27 static const char *reserved_words[] = {
28  "abs",
29  "accept",
30  "alarm",
31  "and",
32  "atan2",
33  "BEGIN",
34  "bind",
35  "binmode",
36  "bless",
37  "byte",
38  "caller",
39  "carp",
40  "chdir",
41  "chmod",
42  "chomp",
43  "chop",
44  "chown",
45  "chr",
46  "chroot",
47  "close",
48  "closedir",
49  "cmp",
50  "confess",
51  "connect",
52  "continue",
53  "cos",
54  "croak",
55  "crypt",
56  "dbmclose",
57  "dbmopen",
58  "defined",
59  "delete",
60  "die",
61  "do",
62  "dump",
63  "each",
64  "else",
65  "elsif",
66  "END",
67  "endgrent",
68  "endhostent",
69  "endnetent",
70  "endprotoent",
71  "endpwent",
72  "endservent",
73  "eof",
74  "eq",
75  "eval",
76  "exec",
77  "exists",
78  "exit",
79  "exp",
80  "fcntl",
81  "fileno",
82  "flock",
83  "for",
84  "foreach",
85  "fork",
86  "format",
87  "formline",
88  "ge",
89  "getc",
90  "getgrent",
91  "getgrgid",
92  "getgrnam",
93  "gethostbyaddr",
94  "gethostbyname",
95  "gethostent",
96  "getlogin",
97  "getnetbyaddr",
98  "getnetbyname",
99  "getnetent",
100  "getpeername",
101  "getpgrp",
102  "getppid",
103  "getpriority",
104  "getprotobyname",
105  "getprotobynumber",
106  "getprotoent",
107  "getpwent",
108  "getpwnam",
109  "getpwuid",
110  "getservbyname",
111  "getservbyport",
112  "getservent",
113  "getsockname",
114  "getsockopt",
115  "glob",
116  "gmtime",
117  "goto",
118  "grep",
119  "gt",
120  "hex",
121  "if",
122  "import",
123  "index",
124  "int",
125  "integer",
126  "ioctl",
127  "join",
128  "keys",
129  "kill",
130  "last",
131  "lc",
132  "lcfirst",
133  "le",
134  "length",
135  "lib",
136  "link",
137  "listen",
138  "local",
139  "localtime",
140  "lock",
141  "log",
142  "lstat",
143  "lt",
144  "map",
145  "mkdir",
146  "msgctl",
147  "msgget",
148  "msgrcv",
149  "msgsnd",
150  "my",
151  "ne",
152  "new",
153  "next",
154  "no",
155  "not",
156  "oct",
157  "open",
158  "opendir",
159  "or",
160  "ord",
161  "our",
162  "pack",
163  "package",
164  "pipe",
165  "pop",
166  "pos",
167  "print",
168  "printf",
169  "prototype",
170  "push",
171  "quotemeta",
172  "rand",
173  "read",
174  "readdir",
175  "readline",
176  "readlink",
177  "readpipe",
178  "recv",
179  "redo",
180  "ref",
181  "rename",
182  "require",
183  "reset",
184  "return",
185  "reverse",
186  "rewinddir",
187  "rindex",
188  "rmdir",
189  "scalar",
190  "seek",
191  "seekdir",
192  "select",
193  "semctl",
194  "semget",
195  "semop",
196  "send",
197  "setgrent",
198  "sethostent",
199  "setnetent",
200  "setpgrp",
201  "setpriority",
202  "setprotoent",
203  "setpwent",
204  "setservent",
205  "setsockopt",
206  "shift",
207  "shmctl",
208  "shmget",
209  "shmread",
210  "shmwrite",
211  "shutdown",
212  "sigtrap",
213  "sin",
214  "sleep",
215  "socket",
216  "socketpair",
217  "sort",
218  "splice",
219  "split",
220  "sprintf",
221  "sqrt",
222  "srand",
223  "stat",
224  "strict",
225  "study",
226  "sub",
227  "subs",
228  "substr",
229  "switch",
230  "symlink",
231  "syscall",
232  "sysopen",
233  "sysread",
234  "sysseek",
235  "system",
236  "syswrite",
237  "tell",
238  "telldir",
239  "tie",
240  "tied",
241  "time",
242  "times",
243  "truncate",
244  "uc",
245  "ucfirst",
246  "umask",
247  "undef",
248  "unless",
249  "unlink",
250  "unpack",
251  "unshift",
252  "untie",
253  "until",
254  "use",
255  "utf8",
256  "utime",
257  "values",
258  "vars",
259  "vec",
260  "wait",
261  "waitpid",
262  "wantarray",
263  "warn",
264  "warnings",
265  "while",
266  "write",
267  "xor",
268  0
269 };
270 
271 PerlWriter::PerlWriter()
272 {
273 }
274 
275 PerlWriter::~PerlWriter()
276 {
277 }
278 
279 bool PerlWriter::GetUseStatements(UMLClassifier *c, QString &Ret,
280  QString &ThisPkgName)
281 {
282  if (!c){
283  return(false);
284  }
285 
286  UMLPackageList includes;
287  findObjectsRelated(c, includes);
288 
289  QString AV = QChar('@');
290  QString SV = QChar('$');
291  QString HV = QChar('%');
292  foreach (UMLPackage* conc, includes) {
293  if (conc->baseType() == UMLObject::ot_Datatype)
294  continue;
295  QString neatName = cleanName(conc->name());
296  if (neatName != AV && neatName != SV && neatName != HV) {
297  QString OtherPkgName = conc->package(".");
298  OtherPkgName.replace(QRegExp("\\."),"::");
299  QString OtherName = OtherPkgName + "::" + cleanName(conc->name());
300 
301  // Only print out the use statement if the other package isn't the
302  // same as the one we are working on. (This happens for the
303  // "Singleton" design pattern.)
304  if (OtherName != ThisPkgName){
305  Ret += "use ";
306  Ret += OtherName;
307  Ret += ';';
308  Ret += m_endl;
309  }
310  }
311  }
312  UMLClassifierList superclasses = c->getSuperClasses();
313  if (superclasses.count()) {
314  Ret += m_endl;
315  Ret += "use base qw(";
316  foreach (UMLClassifier *obj, superclasses) {
317  QString packageName = obj->package(".");
318  packageName.replace(QRegExp("\\."),"::");
319 
320  Ret += packageName + "::" + cleanName(obj->name()) + ' ';
321  }
322  Ret += ");" + m_endl;
323  }
324 
325  return(true);
326 }
327 
332 void PerlWriter::writeClass(UMLClassifier *c)
333 {
334  /* if (!c) {
335  uDebug()<<"Cannot write class of NULL concept!";
336  return;
337  }
338  */
339  QString classname = cleanName(c->name());// this is fine: cleanName is "::-clean"
340  QString packageName = c->package(".");
341  QString fileName;
342 
343  // Replace all white spaces with blanks
344  packageName.simplified();
345 
346  // Replace all blanks with underscore
347  packageName.replace(QRegExp(" "), "_");
348 
349  // Replace all dots (".") with double colon scope resolution operators
350  // ("::")
351  packageName.replace(QRegExp("\\."),"::");
352 
353  // Store complete package name
354  QString ThisPkgName = packageName + "::" + classname;
355 
356  fileName = findFileName(c, ".pm");
357  // the above lower-cases my nice class names. That is bad.
358  // correct solution: refactor,
359  // split massive findFileName up, reimplement
360  // parts here
361  // actual solution: shameful ".pm" hack in codegenerator
362 
363  CodeGenerationPolicy *pol = UMLApp::app()->commonPolicy();
364  QString curDir = pol->getOutputDirectory().absolutePath();
365  if (fileName.contains("::")) {
366  // create new directories for each level
367  QString newDir;
368  newDir = curDir;
369  QString fragment = fileName;
370  QDir* existing = new QDir (curDir);
371  QRegExp regEx("(.*)(::)");
372  regEx.setMinimal(true);
373  while (regEx.indexIn(fragment) > -1) {
374  newDir = regEx.cap(1);
375  fragment.remove(0, (regEx.pos(2) + 2)); // get round strange minimal matching bug
376  existing->setPath(curDir + '/' + newDir);
377  if (! existing->exists()) {
378  existing->setPath(curDir);
379  if (! existing->mkdir(newDir)) {
380  emit codeGenerated(c, false);
381  return;
382  }
383  }
384  curDir += '/' + newDir;
385  }
386  fileName = fragment + ".pm";
387  }
388  if (fileName.isEmpty()) {
389  emit codeGenerated(c, false);
390  return;
391  }
392  QString oldDir = pol->getOutputDirectory().absolutePath();
393  pol->setOutputDirectory(curDir);
394  QFile fileperl;
395  if (!openFile(fileperl, fileName)) {
396  emit codeGenerated(c, false);
397  return;
398  }
399  QTextStream perl(&fileperl);
400  pol->setOutputDirectory(oldDir);
401 
402  //======================================================================
403  // Start generating the code!!
404  //======================================================================
405 
406  // try to find a heading file (license, comments, etc)
407  QString str;
408  bool bPackageDeclared = false;
409  bool bUseStmsWritten = false;
410 
411  str = getHeadingFile(".pm"); // what this mean?
412  if (!str.isEmpty()) {
413  str.replace(QRegExp("%filename%"), fileName);
414  str.replace(QRegExp("%filepath%"), fileperl.fileName());
415  str.replace(QRegExp("%year%"), QDate::currentDate().toString("yyyy"));
416  str.replace(QRegExp("%date%"), QDate::currentDate().toString());
417  str.replace(QRegExp("%time%"), QTime::currentTime().toString());
418  str.replace(QRegExp("%package-name%"), ThisPkgName);
419  if(str.indexOf(QRegExp("%PACKAGE-DECLARE%"))){
420  str.replace(QRegExp("%PACKAGE-DECLARE%"),
421  "package " + ThisPkgName + ';'
422  + m_endl + m_endl
423  + "#UML_MODELER_BEGIN_PERSONAL_VARS_" + classname
424  + m_endl + m_endl
425  + "#UML_MODELER_END_PERSONAL_VARS_" + classname
426  + m_endl
427  );
428  bPackageDeclared = true;
429  }
430 
431  if (str.indexOf(QRegExp("%USE-STATEMENTS%"))){
432  QString UseStms;
433  if(GetUseStatements(c, UseStms, ThisPkgName)){
434  str.replace(QRegExp("%USE-STATEMENTS%"), UseStms);
435  bUseStmsWritten = true;
436  }
437  }
438 
439  perl << str << m_endl;
440  }
441 
442  // if the package wasn't declared above during keyword substitution,
443  // add it now. (At the end of the file.)
444  if (! bPackageDeclared){
445  perl << m_endl << m_endl << "package " <<ThisPkgName << ";" << m_endl
446  << m_endl;
447  //write includes
448  perl << m_endl << "#UML_MODELER_BEGIN_PERSONAL_VARS_" << classname
449  << m_endl ;
450  perl << m_endl << "#UML_MODELER_END_PERSONAL_VARS_" << classname
451  << m_endl << m_endl ;
452  }
453 
454  if (! bUseStmsWritten){
455  QString UseStms;
456  if (GetUseStatements(c, UseStms, ThisPkgName)){
457  perl<<UseStms<<m_endl;
458  }
459  }
460 
461  perl << m_endl;
462 
463  // Do we really need these for anything???
464  UMLAssociationList aggregations = c->getAggregations();
465  UMLAssociationList compositions = c->getCompositions();
466 
467  //Write class Documentation
468  if (forceDoc() || !c->doc().isEmpty()) {
469  perl << m_endl << "=head1";
470  perl << " " << classname.toUpper() << m_endl << m_endl;
471  perl << c->doc();
472  perl << m_endl << m_endl << "=cut" << m_endl << m_endl;
473  }
474 
475  //check if class is abstract and / or has abstract methods
476  if (c->isAbstract())
477  perl << "=head1 ABSTRACT CLASS" << m_endl << m_endl << "=cut" << m_endl;
478 
479  //attributes
480  if (! c->isInterface())
481  writeAttributes(c, perl); // keep for documentation's sake
482 
483  //operations
484  writeOperations(c, perl);
485 
486  perl << m_endl;
487 
488  //finish file
489  //perl << m_endl << m_endl << "=cut" << m_endl;
490  perl << m_endl << m_endl << "return 1;" << m_endl;
491 
492  //close files and notify we are done
493  fileperl.close();
494  emit codeGenerated(c, true);
495  emit showGeneratedFile(fileperl.fileName());
496 }
497 
502 Uml::ProgrammingLanguage::Enum PerlWriter::language() const
503 {
504  return Uml::ProgrammingLanguage::Perl;
505 }
506 
508 // Helper Methods
509 
515 void PerlWriter::writeOperations(UMLClassifier *c, QTextStream &perl)
516 {
517  //Lists to store operations sorted by scope
518  UMLOperationList oppub, opprot, oppriv;
519 
520  //sort operations by scope first and see if there are abstract methods
521  //keep this for documentation only!
522  UMLOperationList opl(c->getOpList());
523  foreach (UMLOperation *op, opl) {
524  switch(op->visibility()) {
525  case Uml::Visibility::Public:
526  oppub.append(op);
527  break;
528  case Uml::Visibility::Protected:
529  opprot.append(op);
530  break;
531  case Uml::Visibility::Private:
532  oppriv.append(op);
533  break;
534  default:
535  break;
536  }
537  }
538 
539  QString classname(cleanName(c->name()));
540 
541  //write operations to file
542  if (forceSections() || !oppub.isEmpty()) {
543  perl << m_endl << "=head1 PUBLIC METHODS" << m_endl << m_endl ;
544  writeOperations(classname, oppub, perl);
545  perl << m_endl << m_endl << "=cut" << m_endl << m_endl;
546  }
547 
548  if (forceSections() || !opprot.isEmpty()) {
549  perl << m_endl << "=head1 METHODS FOR SUBCLASSING" << m_endl << m_endl ;
550  //perl << "=pod " << m_endl << m_endl << "=head3 " ;
551  writeOperations(classname, opprot, perl);
552  perl << m_endl << m_endl << "=cut" << m_endl << m_endl;
553  }
554 
555  if (forceSections() || !oppriv.isEmpty()) {
556  perl << m_endl << "=head1 PRIVATE METHODS" << m_endl << m_endl ;
557  //perl << "=pod " << m_endl << m_endl << "=head3 " ;
558  writeOperations(classname, oppriv, perl);
559  perl << m_endl << m_endl << "=cut" << m_endl << m_endl;
560  }
561 
562  // moved here for perl
563  if (!c->isInterface() && hasDefaultValueAttr(c)) {
564  UMLAttributeList atl = c->getAttributeList();
565 
566  perl << m_endl;
567  perl << m_endl << "=head2 _init" << m_endl << m_endl << m_endl;
568  perl << "_init sets all " + classname + " attributes to their default values unless already set" << m_endl << m_endl << "=cut" << m_endl << m_endl;
569  perl << "sub _init {" << m_endl << m_indentation << "my $self = shift;" << m_endl<<m_endl;
570 
571  foreach (UMLAttribute *at, atl) {
572  if (!at->getInitialValue().isEmpty())
573  perl << m_indentation << "defined $self->{" << cleanName(at->name())<<"}"
574  << " or $self->{" << cleanName(at->name()) << "} = "
575  << at->getInitialValue() << ";" << m_endl;
576  }
577 
578  perl << " }" << m_endl;
579  }
580 
581  perl << m_endl << m_endl;
582 }
583 
590 void PerlWriter::writeOperations(const QString &classname, UMLOperationList &opList, QTextStream &perl)
591 {
592  Q_UNUSED(classname);
593  foreach (UMLOperation* op, opList) {
594  UMLAttributeList atl = op->getParmList();
595  //write method doc if we have doc || if at least one of the params has doc
596  bool writeDoc = forceDoc() || !op->doc().isEmpty();
597  foreach (UMLAttribute* at, atl)
598  writeDoc |= !at->doc().isEmpty();
599 
600  if (writeDoc) //write method documentation
601  {
602  perl << "=pod " << m_endl << m_endl << "=head3 " ;
603  perl << cleanName(op->name()) << m_endl << m_endl;
604 
605  perl << " Parameters :" << m_endl ;
606  //write parameter documentation
607  foreach (UMLAttribute* at, atl) {
608  if (forceDoc() || !at->doc().isEmpty()) {
609  perl << " "
610  << cleanName(at->name()) << " : "
611  << at->getTypeName() << " : "
612  << at->doc()
613  << m_endl;
614  }
615  }//end for : write parameter documentation
616 
617  perl << m_endl;
618  perl << " Return : " << m_endl;
619  perl << " " << op->getTypeName();
620  perl << m_endl << m_endl;
621  perl << " Description : " << m_endl;
622  perl << " " << op->doc();
623  perl << m_endl << m_endl << "=cut" << m_endl << m_endl;
624  }//end if : write method documentation
625 
626  perl << "sub " << cleanName(op->name()) << m_endl << "{" << m_endl;
627  perl << " my($self";
628 
629  bool bStartPrinted = false;
630  //write parameters
631  foreach (UMLAttribute* at, atl) {
632  if (!bStartPrinted) {
633  bStartPrinted = true;
634  perl << "," << m_endl;
635  }
636  perl << " $"<< cleanName(at->name()) << ", # "
637  << at->getTypeName() << " : " << at->doc() << m_endl;
638  }
639 
640  perl << " ) = @_;" << m_endl;
641 
642  perl << "#UML_MODELER_BEGIN_PERSONAL_CODE_" << cleanName(op->name()) << m_endl;
643  QString sourceCode = op->getSourceCode();
644  if (!sourceCode.isEmpty()) {
645  perl << formatSourceCode(sourceCode, m_indentation);
646  }
647  perl << "#UML_MODELER_END_PERSONAL_CODE_" << cleanName(op->name()) << m_endl;
648  perl << "}" << m_endl;
649  perl << m_endl << m_endl;
650  }//end for
651 }
652 
658 void PerlWriter::writeAttributes(UMLClassifier *c, QTextStream &perl)
659 {
660  UMLAttributeList atpub, atprot, atpriv, atdefval;
661 
662  //sort attributes by scope and see if they have a default value
663  UMLAttributeList atl = c->getAttributeList();
664 
665  foreach (UMLAttribute* at, atl) {
666  if (!at->getInitialValue().isEmpty())
667  atdefval.append(at);
668  switch(at->visibility()) {
669  case Uml::Visibility::Public:
670  atpub.append(at);
671  break;
672  case Uml::Visibility::Protected:
673  atprot.append(at);
674  break;
675  case Uml::Visibility::Private:
676  atpriv.append(at);
677  break;
678  default:
679  break;
680  }
681  }
682 
683  if (forceSections() || atpub.count()) {
684  writeAttributes(atpub, perl);
685  }
686  /* not needed as writeAttributes only writes documentation
687  if (forceSections() || atprot.count()) {
688  writeAttributes(atprot, perl);
689  }
690 
691  if (forceSections() || atpriv.count()) {
692  writeAttributes(atpriv, perl);
693  }
694  */
695 }
696 
702 void PerlWriter::writeAttributes(UMLAttributeList &atList, QTextStream &perl)
703 {
704  perl << m_endl << "=head1 PUBLIC ATTRIBUTES" << m_endl << m_endl;
705  perl << "=pod " << m_endl << m_endl ;
706  foreach (UMLAttribute *at, atList) {
707  if (forceDoc() || !at->doc().isEmpty())
708  {
709  perl << "=head3 " << cleanName(at->name()) << m_endl << m_endl ;
710  perl << " Description : " << at->doc() << m_endl << m_endl;
711  }
712  } // end for
713  perl << m_endl << m_endl << "=cut" << m_endl << m_endl;
714  return;
715 }
716 
721 QStringList PerlWriter::defaultDatatypes()
722 {
723  QStringList l;
724  l.append("$");
725  l.append("@");
726  l.append("%");
727  return l;
728 }
729 
734 QStringList PerlWriter::reservedKeywords() const
735 {
736  static QStringList keywords;
737 
738  if (keywords.isEmpty()) {
739  for (int i = 0; reserved_words[i]; ++i) {
740  keywords.append(reserved_words[i]);
741  }
742  }
743 
744  return keywords;
745 }
746 
747 #include "perlwriter.moc"
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Shorthand for getSpecificAssocs(Uml::at_Aggregation)
Definition: umlcanvasobject.cpp:421
PerlWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Returns "Perl".
Definition: perlwriter.cpp:502
UMLPackage
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
UMLClassifier
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
association.h
UMLAttribute::getInitialValue
QString getInitialValue() const
Returns The initial value of the UMLAttribute.
Definition: attribute.cpp:98
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:435
CodeGenerator::openFile
bool openFile(QFile &file, const QString &name)
Opens a file named "name" for writing in the outputDirectory.
Definition: codegenerator.cpp:586
CodeGenerationPolicy::setOutputDirectory
void setOutputDirectory(QDir new_var)
Set the value of m_outputDirectory location of where output files will go.
Definition: codegenerationpolicy.cpp:196
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Determine the file name.
Definition: simplecodegenerator.cpp:89
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:241
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
CodeGenerationPolicy
class CodeGenerationPolicy This class describes the code generation policy for this project...
Definition: codegenerationpolicy.h:29
UMLAttributeList
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
SimpleCodeGenerator::m_indentation
QString m_indentation
Definition: simplecodegenerator.h:74
SimpleCodeGenerator::hasDefaultValueAttr
bool hasDefaultValueAttr(UMLClassifier *c)
Check whether classifier has default values for attributes.
Definition: simplecodegenerator.cpp:241
PerlWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Get list of reserved keywords.
Definition: perlwriter.cpp:734
perlwriter.h
CodeGenerator::getHeadingFile
virtual QString getHeadingFile(const QString &file)
Gets the heading file (as a string) to be inserted at the beginning of the generated file...
Definition: codegenerator.cpp:482
classifier.h
reserved_words
static const char * reserved_words[]
Definition: perlwriter.cpp:27
Uml::Visibility::Private
Definition: basictypes.h:58
CodeGenerationPolicy::getOutputDirectory
QDir getOutputDirectory()
Get the value of m_outputDirectory location of where output files will go.
Definition: codegenerationpolicy.cpp:206
CodeGenerator::forceDoc
bool forceDoc() const
Definition: codegenerator.cpp:841
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:76
UMLClassifier::isInterface
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:112
attribute.h
PerlWriter::PerlWriter
PerlWriter()
Definition: perlwriter.cpp:271
CodeGenerator::codeGenerated
void codeGenerated(UMLClassifier *concept, bool generated)
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Shorthand for getSpecificAssocs(Uml::at_Composition)
Definition: umlcanvasobject.cpp:431
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
Uml::ProgrammingLanguage::Perl
Definition: basictypes.h:252
UMLPackageList
QList< UMLPackage * > UMLPackageList
Definition: umlpackagelist.h:17
CodeGenerator::formatSourceCode
static QString formatSourceCode(const QString &code, const QString &indentation)
Format source code for output in source files by adding the correct indentation to every line of code...
Definition: codegenerator.cpp:803
CodeGenerator::findObjectsRelated
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Finds all classes in the current document to which objects of class c are in some way related...
Definition: codegenerator.cpp:682
UMLApp::commonPolicy
CodeGenerationPolicy * commonPolicy() const
Returns the default code generation policy.
Definition: uml.cpp:2132
Uml::Visibility::Public
Definition: basictypes.h:57
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses()
Return a list of the superclasses of this concept.
Definition: umlcanvasobject.cpp:359
UMLObject::baseType
ObjectType baseType() const
Returns the type of the object.
Definition: umlobject.cpp:366
PerlWriter::defaultDatatypes
QStringList defaultDatatypes()
Get list of default datatypes.
Definition: perlwriter.cpp:721
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Returns the attributes for the specified scope.
Definition: classifier.cpp:441
operation.h
umldoc.h
Uml::ModelType::toString
QString toString(Enum item)
Convert ModelType item into QString representation.
Definition: basictypes.cpp:39
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
PerlWriter::~PerlWriter
virtual ~PerlWriter()
Definition: perlwriter.cpp:275
UMLObject::package
QString package(const QString &separator=QString(), bool includeRoot=false)
Return the package(s) in which this UMLObject is contained as a text.
Definition: umlobject.cpp:603
UMLOperation::getSourceCode
QString getSourceCode() const
Returns the source code for this operation.
Definition: operation.cpp:440
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Return a list of operations for the Classifier.
Definition: classifier.cpp:960
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
CodeGenerator::forceSections
bool forceSections() const
Definition: codegenerator.cpp:851
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Replaces spaces with underscores and capitalises as defined in m_modname.
Definition: codegenerator.cpp:609
CodeGenerator::showGeneratedFile
void showGeneratedFile(const QString &filename)
PerlWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Call this method to generate Perl code for a UMLClassifier.
Definition: perlwriter.cpp:332
UMLObject::isAbstract
bool isAbstract() const
Returns the abstract state of the object.
Definition: umlobject.cpp:312
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
Uml::Visibility::Protected
Definition: basictypes.h:59
UMLObject::ot_Datatype
Definition: umlobject.h:54
uml.h
QList
UMLObject::doc
QString doc() const
Returns the documentation for the object.
Definition: umlobject.cpp:404
UMLOperation::getParmList
UMLAttributeList getParmList() const
Returns a list of parameters.
Definition: operation.cpp:171
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal