umbrello: PascalWriter Class Reference

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

Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
PascalWriter Class Reference

`#include <pascalwriter.h>`

Inheritance diagram for PascalWriter:

## Public Member Functions
| PascalWriter ()
virtual | ~PascalWriter ()
virtual void | writeClass (UMLClassifier *c)
virtual Uml::ProgrammingLanguage::Enum | language () const
QStringList | defaultDatatypes ()
virtual bool | isReservedKeyword (const QString &rPossiblyReservedKeyword)
virtual QStringList | reservedKeywords () const
Public Member Functions inherited from SimpleCodeGenerator
| SimpleCodeGenerator (bool createDirHierarchyForPackages=true)
virtual | ~SimpleCodeGenerator ()
void | writeCodeToFile (UMLClassifierList &concepts)
void | writeCodeToFile ()
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 | saveToXMI1 (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 | loadFromXMI1 (QDomElement &element)
CodeDocument * | findCodeDocumentByClassifier (UMLClassifier *classifier)
virtual void | createDefaultStereotypes ()

## Private Member Functions
void | writeOperation (UMLOperation *op, QTextStream &ada, bool is_comment=false)
void | computeAssocTypeAndRole (UMLAssociation *a, QString &typeName, QString &roleName)
bool | isOOClass (UMLClassifier *c)
QString | qualifiedName (UMLPackage *p, bool withType=false, bool byValue=false)

## Static Private Attributes
static const QString | defaultPackageSuffix = QLatin1String("_Holder")

## Additional Inherited Members
Public Types inherited from CodeGenerator
enum | GenerationState { Generated , Failed , Skipped }
Public Slots inherited from SimpleCodeGenerator
virtual void | syncCodeToDocument ()
Public Slots inherited from CodeGenerator
virtual void | syncCodeToDocument ()
Signals inherited from CodeGenerator
void | codeGenerated (UMLClassifier *concept, bool generated)
void | codeGenerated (UMLClassifier *concept, CodeGenerator::GenerationState result)
void | showGeneratedFile (const QString &filename)
Static Public Member Functions inherited from CodeGenerator
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)
Protected Member Functions inherited from SimpleCodeGenerator
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 ()
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 SimpleCodeGenerator
QString | className_
QString | fileName_
QMap< UMLPackage *, QString > | m_fileMap
bool | m_createDirHierarchyForPackages
QString | m_indentation
int | m_indentLevel
QString | m_endl
Protected Attributes inherited from CodeGenerator
QHash< QString, CodeDocument * > | m_codeDocumentDictionary
bool | m_applyToAllRemaining
UMLDoc * | m_document

## Detailed Description

Pascal class writer.

Author
  Oliver Kellogg Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org.

## Constructor & Destructor Documentation

## ◆ PascalWriter()

PascalWriter::PascalWriter | ( |  | ) |

Basic Constructor.

## ◆ ~PascalWriter()

PascalWriter::~PascalWriter | ( |  | ) |
| virtual

Empty Destructor.

## Member Function Documentation

## ◆ computeAssocTypeAndRole()

void PascalWriter::computeAssocTypeAndRole | ( | UMLAssociation * | a,
|  | QString & | typeName,
|  | QString & | roleName
| ) |  |
| private

## ◆ defaultDatatypes()

QStringList PascalWriter::defaultDatatypes | ( |  | ) |
| virtual

Returns the default datatypes in a list.

Returns
  the list of default datatypes

Reimplemented from CodeGenerator.

## ◆ isOOClass()

bool PascalWriter::isOOClass | ( | UMLClassifier * | c | ) |
| private

## ◆ isReservedKeyword()

bool PascalWriter::isReservedKeyword | ( | const QString & | rPossiblyReservedKeyword | ) |
| virtual

Check whether the given string is a reserved word for the language of this code generator.

Parameters

  rPossiblyReservedKeyword | the string to check

Reimplemented from CodeGenerator.

## ◆ language()

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

Returns "Pascal".

Returns
  the programming language identifier

Implements CodeGenerator.

## ◆ qualifiedName()

QString PascalWriter::qualifiedName | ( | UMLPackage * | p,
|  | bool | withType = `false`,
|  | bool | byValue = `false`
| ) |  |
| private

## ◆ reservedKeywords()

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

Get list of reserved keywords.

Returns
  the list of reserved keywords

Reimplemented from CodeGenerator.

## ◆ writeClass()

void PascalWriter::writeClass | ( | UMLClassifier * | c | ) |
| virtual

Call this method to generate Pascal code for a UMLClassifier.

Parameters

  c | the class to generate code for

Implements SimpleCodeGenerator.

## ◆ writeOperation()

void PascalWriter::writeOperation | ( | UMLOperation * | op,
|  | QTextStream & | pas,
|  | bool | is_comment = `false`
| ) |  |
| private

Write one operation.

Parameters

  op | the class for which we are generating code
  pas | the stream associated with the output file

## Member Data Documentation

## ◆ defaultPackageSuffix

const QString PascalWriter::defaultPackageSuffix = QLatin1String("_Holder")
| staticprivate

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

- umbrello/codegenerators/pascal/pascalwriter.h
- umbrello/codegenerators/pascal/pascalwriter.cpp