umbrello 25.04.1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <pythonwriter.h>
Private Member Functions | |
void | writeAttributes (UMLAttributeList atList, QTextStream &py) |
void | writeOperations (UMLClassifier *c, QTextStream &h) |
void | writeOperations (const QString &classname, UMLOperationList &opList, QTextStream &h, Uml::Visibility::Enum access) |
QString | findIncludeFromType (const QString &string) |
Static Private Member Functions | |
static bool | hasContainer (const QString &string) |
static QString | fixTypeName (const QString &string) |
Private Attributes | |
bool | m_bNeedPass |
True as long as no "pass" has been written. | |
Additional Inherited Members | |
![]() | |
enum | GenerationState { Generated , Failed , Skipped } |
![]() | |
virtual void | syncCodeToDocument () |
![]() | |
virtual void | syncCodeToDocument () |
![]() | |
void | codeGenerated (UMLClassifier *classifier, bool generated) |
void | codeGenerated (UMLClassifier *classifier, CodeGenerator::GenerationState result) |
void | showGeneratedFile (const QString &filename) |
![]() | |
static QString | cleanName (const QString &name) |
static QString | formatDoc (const QString &text, const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80) |
static QString | formatFullDocBlock (const QString &text, const QString &blockHeader=QStringLiteral("/* "), const QString &blockFooter=QStringLiteral(" */"), const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80) |
static QString | formatSourceCode (const QString &code, const QString &indentation) |
static void | findObjectsRelated (UMLClassifier *c, UMLPackageList &cList) |
![]() | |
QString | findFileName (UMLPackage *classifier, const QString &ext) |
QString | overwritableName (UMLPackage *classifier, 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 () |
![]() | |
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 |
Class PythonWriter is a python code generator for UMLClassifier objects Just call writeClass and feed it a UMLClassifier.
NOTE: There is a unit test available for this class. Please, use and adapt it when necessary.
PythonWriter::PythonWriter | ( | ) |
|
virtual |
|
virtual |
Reimplementation of method from class CodeGenerator
Reimplemented from CodeGenerator.
|
private |
|
staticprivate |
Fix types to be compatible with Python
string | type as defined in model |
|
staticprivate |
Check if type is a container
string | type that will be used |
|
virtual |
Return the programming language identifier.
Implements CodeGenerator.
|
virtual |
Get list of reserved keywords.
Reimplemented from CodeGenerator.
|
private |
Write all attributes for a given class.
atList | the attribute list we are generating code for |
py | output stream for the header file |
|
virtual |
Call this method to generate C++ code for a UMLClassifier.
c | the class you want to generate code for |
Implements SimpleCodeGenerator.
|
private |
Write a list of class operations.
classname | the name of the class |
opList | the list of operations |
h | output stream for the header file |
access | visibility identifier |
|
private |
Write all operations for a given class.
c | the classifier we are generating code for |
h | output stream for the header file |
|
private |
True as long as no "pass" has been written.