umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <pythonwriter.h>
Public Member Functions | |
PythonWriter () | |
virtual | ~PythonWriter () |
virtual void | writeClass (UMLClassifier *c) |
virtual Uml::ProgrammingLanguage::Enum | language () const |
virtual QStringList | reservedKeywords () const |
QStringList | defaultDatatypes () const |
![]() | |
SimpleCodeGenerator (bool createDirHierarchyForPackages=true) | |
virtual | ~SimpleCodeGenerator () |
void | writeCodeToFile (UMLClassifierList &concepts) |
void | writeCodeToFile () |
![]() | |
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) |
CodeDocument * | findCodeDocumentByClassifier (UMLClassifier *classifier) |
virtual bool | isReservedKeyword (const QString &keyword) |
virtual void | createDefaultStereotypes () |
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. More... | |
Additional Inherited Members | |
![]() | |
enum | GenerationState { Generated , Failed , Skipped } |
![]() | |
virtual void | syncCodeToDocument () |
![]() | |
virtual void | syncCodeToDocument () |
![]() | |
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) |
![]() | |
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 () |
![]() | |
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 concept we are generating code for |
h | output stream for the header file |
|
private |
True as long as no "pass" has been written.