umbrello/umbrello
dwriter.cpp
Go to the documentation of this file.
67 UMLAssociationList associations = c->getSpecificAssocs(Uml::AssociationType::Association); // BAD! only way to get "general" associations.
200 UMLAssociationList associations = c->getSpecificAssocs(Uml::AssociationType::Association); // BAD! only way to get "general" associations.
206 bool hasAssociations = aggregations.count() + associations.count() + compositions.count() + uniAssociations.count() > 0;
379 void DWriter::writeAttributeDecl(Uml::Visibility::Enum visibility, UMLAttributeList &atlist, QTextStream &d)
424 void DWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &d)
471 void DWriter::writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &d)
488 void DWriter::writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &d)
502 // First: we insert documentaion for association IF it has either role AND some documentation (!)
510 writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::RoleType::B), a->getMultiplicity(Uml::RoleType::B), a->getRoleDoc(Uml::RoleType::B), a->visibility(Uml::RoleType::B), d);
517 writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::RoleType::A), a->getMultiplicity(Uml::RoleType::A), a->getRoleDoc(Uml::RoleType::A), a->visibility(Uml::RoleType::A), d);
561 void DWriter::writeAssociationMethods (UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &d)
595 void DWriter::writeAssociationRoleMethod (QString fieldClassName, QString roleName, QString multi,
612 void DWriter::writeVectorAttributeAccessorMethods (QString fieldClassName, QString fieldVarName,
635 writeDocumentation(QLatin1String("Removes a ") + fieldNameUP + QLatin1String(" from the list of ") +
663 QString fieldVarName, QString fieldName, QString description, Uml::Visibility::Enum /*visibility*/,
672 writeDocumentation(QLatin1String("Sets the value of ") + fieldName + QLatin1Char('.'), description,
673 QLatin1String("@param new") + fieldNameUC + QLatin1String(" The new value of ") + fieldName + QLatin1Char('.'),
683 writeDocumentation(QLatin1String("Returns the value of ") + fieldName + QLatin1Char('.'), description,
794 void DWriter::getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath)
799 getSuperImplementedOperations(concept, yetImplementedOpList, toBeImplementedOpList, (concept->isInterface() && noClassInPath));
815 void DWriter::getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opList)
970 return string + (string.right(1) == QLatin1String("s") ? QLatin1String("es") : QLatin1String("s"));
const char * className() const
UMLAssociationList getAggregations()
Shorthand for getSpecificAssocs(Uml::at_Aggregation)
Definition: umlcanvasobject.cpp:423
UMLObject * getObject(Uml::RoleType::Enum role) const
Returns the UMLObject assigned to the given role.
Definition: association.cpp:497
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
QString & append(QChar ch)
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
Definition: classifier.h:47
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Return the subset of m_List that matches the given type.
Definition: umlcanvasobject.cpp:61
QString getInitialValue() const
Returns The initial value of the UMLAttribute.
Definition: attribute.cpp:99
Definition: basictypes.h:215
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:431
bool openFile(QFile &file, const QString &name)
Opens a file named "name" for writing in the outputDirectory.
Definition: codegenerator.cpp:601
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
QString findFileName(UMLPackage *concept, const QString &ext)
Determine the file name.
Definition: simplecodegenerator.cpp:89
QString & prepend(QChar ch)
virtual QString getTypeName() const
Overrides method from UMLClassifierListItem.
Definition: template.cpp:72
Definition: basictypes.h:216
QString fileName() const
int size() const
Definition: basictypes.h:182
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
This class holds information used by template classes, called paramaterised class in UML and a generi...
Definition: template.h:26
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:497
QString & remove(int position, int n)
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
Definition: basictypes.h:58
This class contains the non-graphic representation of an association.
Definition: association.h:32
Definition: basictypes.h:252
int count(const T &value) const
void append(const T &value)
QString capitalizeFirstLetter(const QString &string)
Return the input string with the first letter capitalized.
Definition: codegen_utils.cpp:421
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:117
bool isEmpty() const
void codeGenerated(UMLClassifier *concept, bool generated)
bool isEmpty() const
Uml::Changeability::Enum changeability(Uml::RoleType::Enum role) const
Returns the changeability.
Definition: association.cpp:541
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
UMLAssociationList getCompositions()
Shorthand for getSpecificAssocs(Uml::at_Composition)
Definition: umlcanvasobject.cpp:433
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
virtual UMLAssociationList getUniAssociationToBeImplemented()
Return the list of unidirectional association that should show up in the code.
Definition: classifier.cpp:1377
QString toString(Enum item, bool mnemonic)
Convert Visibility item into QString representation.
Definition: basictypes.cpp:99
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:821
QString right(int n) const
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:700
virtual void writeClass(UMLClassifier *c)
Call this method to generate d code for a UMLClassifier.
Definition: dwriter.cpp:100
QString toLower() const
Definition: basictypes.h:183
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Definition: basictypes.h:57
virtual void close()
UMLClassifierList findSuperClassConcepts(ClassifierType type=ALL)
Returns a list of concepts which this concept inherits from.
Definition: classifier.cpp:624
QString & replace(int position, int n, QChar after)
bool isStatic() const
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition: umlobject.cpp:331
UMLAttributeList getAttributeList() const
Returns the attributes for the specified scope.
Definition: classifier.cpp:449
Definition: classifier.h:47
int count() const
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:601
QString getSourceCode() const
Returns the source code for this operation.
Definition: operation.cpp:440
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Return a list of operations for the Classifier.
Definition: classifier.cpp:968
QString left(int n) const
Uml::Visibility::Enum visibility(Uml::RoleType::Enum role) const
Returns the Visibility of the given role.
Definition: association.cpp:550
QString getRoleDoc(Uml::RoleType::Enum role) const
Returns the documentation assigned to the given role.
Definition: association.cpp:577
QString getRoleName(Uml::RoleType::Enum role) const
Returns the name assigned to the role A.
Definition: association.cpp:568
static QString formatDoc(const QString &text, const QString &linePrefix=QLatin1String(" *"), int lineWidth=80)
Format documentation for output in source files.
Definition: codegenerator.cpp:790
static QString cleanName(const QString &name)
Replaces spaces with underscores and capitalises as defined in m_modname.
Definition: codegenerator.cpp:627
Uml::ID::Type getObjectId(Uml::RoleType::Enum role) const
Returns the ID of the UMLObject assigned to the given role.
Definition: association.cpp:509
QString getMultiplicity(Uml::RoleType::Enum role) const
Returns the multiplicity assigned to the given role.
Definition: association.cpp:559
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
Definition: basictypes.h:59
Definition: umlobject.h:55
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.