umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <simplecodegenerator.h>
Public Slots | |
virtual void | syncCodeToDocument () |
![]() | |
virtual void | syncCodeToDocument () |
Public Member Functions | |
SimpleCodeGenerator (bool createDirHierarchyForPackages=true) | |
virtual | ~SimpleCodeGenerator () |
void | writeCodeToFile (UMLClassifierList &concepts) |
void | writeCodeToFile () |
virtual void | writeClass (UMLClassifier *c)=0 |
![]() | |
CodeGenerator () | |
virtual | ~CodeGenerator () |
bool | addCodeDocument (CodeDocument *add_object) |
bool | removeCodeDocument (CodeDocument *remove_object) |
CodeDocumentList * | getCodeDocumentList () |
QString | getUniqueID (CodeDocument *codeDoc) |
virtual void | saveToXMI (QXmlStreamWriter &writer) |
CodeDocument * | findCodeDocumentByID (const QString &id) |
void | setIncludeHeadings (bool i) |
bool | includeHeadings () const |
void | setHeadingFileDir (const QString &) |
QString | headingFileDir () const |
void | setForceDoc (bool f) |
bool | forceDoc () const |
void | setForceSections (bool f) |
bool | forceSections () const |
virtual QString | getHeadingFile (const QString &file) |
QString | findFileName (CodeDocument *codeDocument) |
virtual void | loadFromXMI (QDomElement &element) |
virtual Uml::ProgrammingLanguage::Enum | language () const =0 |
CodeDocument * | findCodeDocumentByClassifier (UMLClassifier *classifier) |
virtual QStringList | defaultDatatypes () const |
virtual bool | isReservedKeyword (const QString &keyword) |
virtual QStringList | reservedKeywords () const |
virtual void | createDefaultStereotypes () |
Protected Member Functions | |
QString | findFileName (UMLPackage *concept, const QString &ext) |
QString | overwritableName (UMLPackage *concept, const QString &name, const QString &ext) |
bool | hasDefaultValueAttr (UMLClassifier *c) |
bool | hasAbstractOps (UMLClassifier *c) |
QString | indent () |
virtual void | initFromParentDocument () |
![]() | |
QString | overwritableName (const QString &name, const QString &extension) |
bool | openFile (QFile &file, const QString &name) |
void | writeListedCodeDocsToFile (CodeDocumentList *docs) |
virtual void | finalizeRun () |
Protected Attributes | |
QString | className_ |
QString | fileName_ |
QMap< UMLPackage *, QString > | m_fileMap |
bool | m_createDirHierarchyForPackages |
QString | m_indentation |
int | m_indentLevel |
QString | m_endl |
![]() | |
QHash< QString, CodeDocument * > | m_codeDocumentDictionary |
bool | m_applyToAllRemaining |
UMLDoc * | m_document |
Additional Inherited Members | |
![]() | |
enum | GenerationState { Generated , Failed , Skipped } |
![]() | |
void | codeGenerated (UMLClassifier *concept, bool generated) |
void | codeGenerated (UMLClassifier *concept, CodeGenerator::GenerationState result) |
void | showGeneratedFile (const QString &filename) |
![]() | |
static QString | cleanName (const QString &name) |
static QString | formatDoc (const QString &text, const QString &linePrefix=QLatin1String(" *"), int lineWidth=80) |
static QString | formatSourceCode (const QString &code, const QString &indentation) |
static void | findObjectsRelated (UMLClassifier *c, UMLPackageList &cList) |
A simple code generator interface designed to work with the existing codewriters.
Code can be entered into a QTextEdit widget in the ClassPropertiesDialog. This code is then stored in the respective UMLOperation, written to the xmi file, and also used when generating the source files. The code fragments are stored into the xmi file in the section "codegeneration" with the tag "sourcecode".
|
explicit |
Constructor.
|
virtual |
Destructor.
|
protected |
Determine the file name.
concept | the package |
ext | the file extension |
|
protected |
Check whether classifier has abstract operations.
c | the classifier to check |
|
protected |
Check whether classifier has default values for attributes.
c | the classifier to check |
|
protected |
Returns the current indent string based on m_indentLevel and m_indentation.
|
protectedvirtual |
Override parent method.
Implements CodeGenerator.
|
protected |
Check if a file named "name" with extension "ext" already exists.
concept | the package |
name | the name of the file |
ext | the extension of the file |
|
virtualslot |
A little method to provide some compatibility between the newer codegenpolicy object and the older class fields.
|
pure virtual |
Call this method to generate code for a UMLClassifier
c | the class you want to generate code for. |
Implemented in AdaWriter, ASWriter, CppWriter, CSharpWriter, DWriter, IDLWriter, JavaWriter, JSWriter, PascalWriter, PerlWriter, Php5Writer, PhpWriter, PythonWriter, RubyWriter, SQLWriter, TclWriter, ValaWriter, and XMLSchemaWriter.
|
virtual |
Write all concepts in project to file.
Reimplemented from CodeGenerator.
|
virtual |
Write only selected concepts to file.
concepts | the selected concepts |
Reimplemented from CodeGenerator.
|
protected |
|
protected |
|
protected |
For some code generators, it does not make much sense to create a directory for each package because that would lead to a rather sparsely populated directory tree (maximum of just one source file per directory.)
|
protected |
|
protected |
Maps UMLObjects to filenames. Used for finding out which file each class was written to.
|
protected |
|
protected |