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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

simplecodegenerator.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
5 SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef SIMPLECODEGENERATOR_H
9#define SIMPLECODEGENERATOR_H
10
11#include "basictypes.h"
12#include "codegenerator.h"
13
14#include <QMap>
15#include <QString>
16#include <QStringList>
17
18
29 class SimpleCodeGenerator : public CodeGenerator
30{
31 Q_OBJECT
32 public:
33
34 explicit SimpleCodeGenerator(bool createDirHierarchyForPackages = true);
35 virtual ~SimpleCodeGenerator();
36
37 void writeCodeToFile(UMLClassifierList & concepts);
38 void writeCodeToFile();
39
44 virtual void writeClass(UMLClassifier *c) = 0;
45
46 protected:
47 QString className_;
48 QString fileName_;
49
50 QString findFileName(UMLPackage* classifier, const QString &ext);
51 QString overwritableName(UMLPackage* classifier, const QString &name, const QString &ext);
52 bool hasDefaultValueAttr(UMLClassifier *c);
53 bool hasAbstractOps(UMLClassifier *c);
54
55 QString indent();
56
61 QMap<UMLPackage*, QString> m_fileMap;
62
69 bool m_createDirHierarchyForPackages;
70
71 // old attributes writers will look for
72 QString m_indentation;
73 int m_indentLevel;
74 QString m_endl;
75
76 virtual void initFromParentDocument();
77
78 public Q_SLOTS:
79 virtual void syncCodeToDocument();
80
81};
82
83#endif // SIMPLECODEGENERATOR_H
basictypes.h
CodeGenerator
Definition: codegenerator.h:54
SimpleCodeGenerator
Definition: simplecodegenerator.h:30
SimpleCodeGenerator::m_indentLevel
int m_indentLevel
Definition: simplecodegenerator.h:73
SimpleCodeGenerator::m_createDirHierarchyForPackages
bool m_createDirHierarchyForPackages
Definition: simplecodegenerator.h:69
SimpleCodeGenerator::initFromParentDocument
virtual void initFromParentDocument()
Definition: simplecodegenerator.cpp:299
SimpleCodeGenerator::hasAbstractOps
bool hasAbstractOps(UMLClassifier *c)
Definition: simplecodegenerator.cpp:251
SimpleCodeGenerator::overwritableName
QString overwritableName(UMLPackage *classifier, const QString &name, const QString &ext)
Definition: simplecodegenerator.cpp:160
SimpleCodeGenerator::className_
QString className_
Definition: simplecodegenerator.h:47
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *classifier, const QString &ext)
Definition: simplecodegenerator.cpp:84
SimpleCodeGenerator::fileName_
QString fileName_
Definition: simplecodegenerator.h:48
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:74
SimpleCodeGenerator::m_indentation
QString m_indentation
Definition: simplecodegenerator.h:72
SimpleCodeGenerator::~SimpleCodeGenerator
virtual ~SimpleCodeGenerator()
Definition: simplecodegenerator.cpp:61
SimpleCodeGenerator::m_fileMap
QMap< UMLPackage *, QString > m_fileMap
Definition: simplecodegenerator.h:61
SimpleCodeGenerator::writeCodeToFile
void writeCodeToFile()
Definition: simplecodegenerator.cpp:264
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:69
SimpleCodeGenerator::syncCodeToDocument
virtual void syncCodeToDocument()
Definition: simplecodegenerator.cpp:288
SimpleCodeGenerator::writeClass
virtual void writeClass(UMLClassifier *c)=0
SimpleCodeGenerator::hasDefaultValueAttr
bool hasDefaultValueAttr(UMLClassifier *c)
Definition: simplecodegenerator.cpp:236
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: umlclassifier.h:35
UMLPackage
Non-graphical information for a Package.
Definition: umlpackage.h:28
codegenerator.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:14