umbrello: umbrello/codegenerators/simplecodegenerator.h Source File

umbrello 2.37.0 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
32public:
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
46protected:
47 QString className_;
48 QString fileName_;
49
50 QString findFileName(UMLPackage* concept, const QString &ext);
51 QString overwritableName(UMLPackage* concept, 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
78public 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:314
SimpleCodeGenerator::hasAbstractOps
bool hasAbstractOps(UMLClassifier *c)
Definition: simplecodegenerator.cpp:266
SimpleCodeGenerator::className_
QString className_
Definition: simplecodegenerator.h:47
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:64
SimpleCodeGenerator::m_fileMap
QMap< UMLPackage *, QString > m_fileMap
Definition: simplecodegenerator.h:61
SimpleCodeGenerator::writeCodeToFile
void writeCodeToFile()
Definition: simplecodegenerator.cpp:279
SimpleCodeGenerator::overwritableName
QString overwritableName(UMLPackage *concept, const QString &name, const QString &ext)
Definition: simplecodegenerator.cpp:163
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:72
SimpleCodeGenerator::syncCodeToDocument
virtual void syncCodeToDocument()
Definition: simplecodegenerator.cpp:303
SimpleCodeGenerator::writeClass
virtual void writeClass(UMLClassifier *c)=0
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Definition: simplecodegenerator.cpp:87
SimpleCodeGenerator::hasDefaultValueAttr
bool hasDefaultValueAttr(UMLClassifier *c)
Definition: simplecodegenerator.cpp:251
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:35
UMLPackage
Non-graphical information for a Package.
Definition: package.h:28
codegenerator.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:14