umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

csharpwriter.h
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) 2007-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef CSHARPWRITER_H
12 #define CSHARPWRITER_H
13
14 #include "classifierlistitem.h"
15 #include "simplecodegenerator.h"
16 #include "umlassociationlist.h"
17 #include "umlattributelist.h"
18 #include "umloperationlist.h"
19
25 class CSharpWriter : public SimpleCodeGenerator
26 {
27 Q_OBJECT
28 public:
29 CSharpWriter();
30 virtual ~CSharpWriter();
31
32 virtual void writeClass(UMLClassifier *c);
33
34 virtual Uml::ProgrammingLanguage::Enum language() const;
35
36 virtual QStringList reservedKeywords() const;
37
38 QStringList defaultDatatypes();
39
40 private:
41
45 QString m_container_indent;
46
50 UMLPackageList m_seenIncludes;
51
55 int m_unnamedRoles;
56
57 void writeRealizationsRecursive(UMLClassifier *currentClass,
58 UMLAssociationList *realizations,
59 QTextStream &cs);
60
61 void writeOperations(UMLClassifier *c, QTextStream &cs);
62 void writeOperations(UMLOperationList opList,
63 QTextStream &cs,
64 bool interface = false,
65 bool isOverride = false,
66 bool generateErrorStub = false);
67
68 void writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs);
69
70 void writeAttributes(UMLClassifier *c, QTextStream &cs);
71 void writeAttributes(UMLAttributeList &atList, QTextStream &cs);
72
73 void writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, QTextStream &cs);
74
75 void writeAttribute(const QString& doc,
76 Uml::Visibility::Enum visibility,
77 bool isStatic,
78 const QString& typeName,
79 const QString& name,
80 const QString& initialValue,
81 bool asProperty,
82 QTextStream &cs);
83
84 QString makeLocalTypeName(UMLClassifierListItem *cl);
85
86 };
87
88 #endif
umlattributelist.h
CSharpWriter::writeAttributes
void writeAttributes(UMLClassifier *c, QTextStream &cs)
Definition: csharpwriter.cpp:583
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1309
CSharpWriter::~CSharpWriter
virtual ~CSharpWriter()
Definition: csharpwriter.cpp:111
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Definition: classifier.cpp:939
UMLAttributeListIt
QListIterator< UMLAttribute * > UMLAttributeListIt
Definition: umlattributelist.h:20
SimpleCodeGenerator::m_indentation
QString m_indentation
Definition: simplecodegenerator.h:76
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:271
UMLClassifier::isInterface
bool isInterface() const
Definition: classifier.cpp:118
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:349
UMLAttributeList
Definition: umlattributelist.h:27
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
umloperationlist.h
CodeGenerator::getHeadingFile
virtual QString getHeadingFile(const QString &file)
Definition: codegenerator.cpp:407
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
includes
Definition: includes.h:3
CSharpWriter::m_unnamedRoles
int m_unnamedRoles
Definition: csharpwriter.h:55
CSharpWriter::m_container_indent
QString m_container_indent
Definition: csharpwriter.h:45
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Definition: codegenerator.cpp:549
UMLAssociationListIt
QListIterator< UMLAssociation * > UMLAssociationListIt
Definition: umlassociationlist.h:21
operation.h
UMLClassifierListItem::getType
UMLClassifier * getType() const
Definition: classifierlistitem.cpp:102
UMLAttribute::getInitialValue
QString getInitialValue() const
Definition: attribute.cpp:99
CSharpWriter::writeOverridesRecursive
void writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs)
Definition: csharpwriter.cpp:394
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Definition: classifierlistitem.cpp:112
Uml::RoleType::A
@ A
Definition: basictypes.h:239
Uml::ModelType::Logical
@ Logical
Definition: basictypes.h:42
UMLDoc::rootFolder
UMLFolder * rootFolder(Uml::ModelType::Enum mt)
Definition: umldoc.cpp:3205
CodeGenerator::findObjectsRelated
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Definition: codegenerator.cpp:622
CSharpWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: csharpwriter.cpp:780
CSharpWriter::writeAssociatedAttributes
void writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, QTextStream &cs)
Definition: csharpwriter.cpp:658
association.h
UMLObject::umlPackage
UMLPackage * umlPackage() const
Definition: umlobject.cpp:646
UMLObject::isStatic
bool isStatic() const
Definition: umlobject.cpp:366
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
CSharpWriter::CSharpWriter
CSharpWriter()
Definition: csharpwriter.cpp:104
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLObject::isAbstract
bool isAbstract() const
Definition: umlobject.cpp:348
CSharpWriter::makeLocalTypeName
QString makeLocalTypeName(UMLClassifierListItem *cl)
Definition: csharpwriter.cpp:757
CodeGenerator::forceDoc
bool forceDoc() const
Definition: codegenerator.cpp:765
CodeGenerator::formatSourceCode
static QString formatSourceCode(const QString &code, const QString &indentation)
Definition: codegenerator.cpp:743
Uml::Visibility::Public
@ Public
Definition: basictypes.h:60
UMLClassifier::hasAbstractOps
bool hasAbstractOps()
Definition: classifier.cpp:909
CSharpWriter::m_seenIncludes
UMLPackageList m_seenIncludes
Definition: csharpwriter.h:50
classifierlistitem.h
UMLOperation::isLifeOperation
bool isLifeOperation()
Definition: operation.cpp:414
CodeGenerator::showGeneratedFile
void showGeneratedFile(const QString &filename)
Definition: moc_codegenerator.cpp:161
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
attribute.h
a
QString a
Definition: petalnode.cpp:18
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:78
Uml::Visibility::toString
QString toString(Enum item, bool mnemonic)
Definition: basictypes.cpp:107
UMLObject::fullyQualifiedName
virtual QString fullyQualifiedName(const QString &separator=QString(), bool includeRoot=false) const
Definition: umlobject.cpp:227
folder.h
csharpwriter.h
CodeGenerator::formatDoc
static QString formatDoc(const QString &text, const QString &linePrefix=QLatin1String(" *"), int lineWidth=80)
Definition: codegenerator.cpp:712
uDebug
#define uDebug()
Definition: debug_utils.h:122
SimpleCodeGenerator
Definition: simplecodegenerator.h:34
Uml::RoleType::B
@ B
Definition: basictypes.h:240
CSharpWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: csharpwriter.cpp:146
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:435
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
visibility
Definition: visibility.py:1
UMLDoc
Definition: umldoc.h:75
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Definition: classifier.cpp:436
UMLFolder
Non-graphical management of objects and diagrams of a Folder.
Definition: folder.h:35
UMLPackageList
QList< UMLPackage * > UMLPackageList
Definition: umlpackagelist.h:17
CSharpWriter::writeOperations
void writeOperations(UMLClassifier *c, QTextStream &cs)
Definition: csharpwriter.cpp:325
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:412
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
CodeGenerator::codeGenerated
void codeGenerated(UMLClassifier *concept, bool generated)
Definition: moc_codegenerator.cpp:154
reserved_words
static const char * reserved_words[]
Definition: csharpwriter.cpp:25
classifier.h
CSharpWriter::writeAttribute
void writeAttribute(const QString &doc, Uml::Visibility::Enum visibility, bool isStatic, const QString &typeName, const QString &name, const QString &initialValue, bool asProperty, QTextStream &cs)
Definition: csharpwriter.cpp:700
uError
#define uError()
Definition: debug_utils.h:123
UMLOperation
Definition: operation.h:25
uml.h
CSharpWriter::defaultDatatypes
QStringList defaultDatatypes()
Definition: csharpwriter.cpp:118
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
umlassociationlist.h
UMLAssociation
Sets up association information.
Definition: association.h:33
UMLCanvasObject::getRealizations
virtual UMLAssociationList getRealizations()
Definition: umlcanvasobject.cpp:402
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:422
CSharpWriter::writeRealizationsRecursive
void writeRealizationsRecursive(UMLClassifier *currentClass, UMLAssociationList *realizations, QTextStream &cs)
Definition: csharpwriter.cpp:431
CSharpWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: csharpwriter.cpp:772
simplecodegenerator.h
Uml::Visibility::Private
@ Private
Definition: basictypes.h:61
CodeGenerator::forceSections
bool forceSections() const
Definition: codegenerator.cpp:775
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:62
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
Uml::ProgrammingLanguage::CSharp
@ CSharp
Definition: basictypes.h:275
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Definition: simplecodegenerator.cpp:91
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1064
umldoc.h
CodeGenerator::openFile
bool openFile(QFile &file, const QString &name)
Definition: codegenerator.cpp:523
CSharpWriter
Definition: csharpwriter.h:26
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: operation.cpp:507
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33