umbrello: DCodeGenerator Class Reference

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

Public Member Functions | Static Public Member Functions | List of all members
DCodeGenerator Class Reference

`#include <dcodegenerator.h>`

Inheritance diagram for DCodeGenerator:

## Public Member Functions
| DCodeGenerator ()
virtual | ~DCodeGenerator ()
bool | getAutoGenerateAttribAccessors ()
bool | getAutoGenerateAssocAccessors ()
virtual CodeViewerDialog * | getCodeViewerDialog (QWidget *parent, CodeDocument *doc, Settings::CodeViewerState &state)
DCodeGenerationPolicy * | getDPolicy ()
CodeDocument * | newClassifierCodeDocument (UMLClassifier *classifier)
Uml::ProgrammingLanguage::Enum | language () const
virtual QStringList | defaultDatatypes () const
virtual QStringList | reservedKeywords () const
Public Member Functions inherited from AdvancedCodeGenerator
| AdvancedCodeGenerator ()
virtual | ~AdvancedCodeGenerator ()
Public Member Functions inherited from CodeGenerator
| 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)
virtual void | writeCodeToFile ()
virtual void | writeCodeToFile (UMLClassifierList &list)
void | setIncludeHeadings (bool i)
bool | includeHeadings () const
void | setHeadingFileDir (const QString &)
QString | headingFileDir () const
void | setForceDoc (bool f)
bool | forceDoc () const
void | setSectionCommentPolicy (CodeGenerationPolicy::WriteSectionCommentsPolicy 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 ()

## Static Public Member Functions
static QString | getListFieldClassName ()
static QString | capitalizeFirstLetter (const QString &item)
static QString | fixTypeName (const QString &item)
Static Public Member Functions inherited from CodeGenerator
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)

## Additional Inherited Members
Public Types inherited from CodeGenerator
enum | GenerationState { Generated , Failed , Skipped }
Public Slots inherited from AdvancedCodeGenerator
virtual void | checkAddUMLObject (UMLObject *obj)
virtual void | checkRemoveUMLObject (UMLObject *obj)
Public Slots inherited from CodeGenerator
virtual void | syncCodeToDocument ()
Signals inherited from CodeGenerator
void | codeGenerated (UMLClassifier *classifier, bool generated)
void | codeGenerated (UMLClassifier *classifier, CodeGenerator::GenerationState result)
void | showGeneratedFile (const QString &filename)
Protected Member Functions inherited from AdvancedCodeGenerator
virtual void | initFromParentDocument ()
void | connectSlots ()
Protected Member Functions inherited from CodeGenerator
QString | overwritableName (const QString &name, const QString &extension)
bool | openFile (QFile &file, const QString &name)
void | writeListedCodeDocsToFile (CodeDocumentList *docs)
virtual void | finalizeRun ()
Protected Attributes inherited from CodeGenerator
QHash< QString, CodeDocument * > | m_codeDocumentDictionary
bool | m_applyToAllRemaining
UMLDoc * | m_document

## Constructor & Destructor Documentation

## ◆ DCodeGenerator()

DCodeGenerator::DCodeGenerator | ( |  | ) |

Constructor.

## ◆ ~DCodeGenerator()

DCodeGenerator::~DCodeGenerator | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ capitalizeFirstLetter()

QString DCodeGenerator::capitalizeFirstLetter | ( | const QString & | item | ) |
| static

General purpose function we may reuse for all types of D code documents.

Parameters

  item | the item to change

Returns
  the changed item

## ◆ defaultDatatypes()

QStringList DCodeGenerator::defaultDatatypes | ( |  | ) | const
| virtual

Adds D's primitives as datatypes.

Returns
  the list of primitive datatypes

Reimplemented from CodeGenerator.

## ◆ fixTypeName()

QString DCodeGenerator::fixTypeName | ( | const QString & | item | ) |
| static

IF the type is "string" we need to declare it as the D Object "String" (there is no string primitive in D). Same thing again for "bool" to "boolean".

Parameters

  item | the item to change

Returns
  the changed item

## ◆ getAutoGenerateAssocAccessors()

bool DCodeGenerator::getAutoGenerateAssocAccessors | ( |  | ) |

A utility method to get the dCodeGenerationPolicy()->getAutoGenerateAssocAccessors() value.

Returns
  value of flag

## ◆ getAutoGenerateAttribAccessors()

bool DCodeGenerator::getAutoGenerateAttribAccessors | ( |  | ) |

A utility method to get the dCodeGenerationPolicy()->getAutoGenerateAttribAccessors() value.

Returns
  value of flag

## ◆ getCodeViewerDialog()

CodeViewerDialog * DCodeGenerator::getCodeViewerDialog | ( | QWidget * | parent,
|  | CodeDocument * | doc,
|  | Settings::CodeViewerState & | state )
| virtual

Get the editing dialog for this code document. In the D version, we make the ANT build file also available.

Reimplemented from AdvancedCodeGenerator.

## ◆ getDPolicy()

DCodeGenerationPolicy * DCodeGenerator::getDPolicy | ( |  | ) |

Utility function for getting the d code generation policy.

Returns
  generation policy object

## ◆ getListFieldClassName()

QString DCodeGenerator::getListFieldClassName | ( |  | ) |
| static

Get the list variable class name to use. For D, we have set this to "Vector".

Returns
  name of list field class

## ◆ language()

Uml::ProgrammingLanguage::Enum DCodeGenerator::language | ( |  | ) | const
| virtual

Return our language.

Returns
  language identifier

Implements CodeGenerator.

## ◆ newClassifierCodeDocument()

CodeDocument * DCodeGenerator::newClassifierCodeDocument | ( | UMLClassifier * | classifier | ) |
| virtual

Create a new classifier code document.

Parameters

  classifier | the UML classifier

Returns
  the created classifier code document object

Implements AdvancedCodeGenerator.

## ◆ reservedKeywords()

QStringList DCodeGenerator::reservedKeywords | ( |  | ) | const
| virtual

Get list of reserved keywords.

Returns
  the list of reserved keywords

Reimplemented from CodeGenerator.

The documentation for this class was generated from the following files:

- umbrello/codegenerators/d/dcodegenerator.h
- umbrello/codegenerators/d/dcodegenerator.cpp