umbrello/umbrello
rubycodeoperation.cpp
Go to the documentation of this file.
25 RubyCodeOperation::RubyCodeOperation (RubyClassifierCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment)
54 QString returnType = o->isConstructorOperation() ? QString() : (fixedReturn + QString(QLatin1String(" ")));
86 paramStr += QString(QLatin1String(" = ")) + RubyCodeGenerator::cppToRubyType(parm->getInitialValue());
98 startText = QLatin1String("def ") + RubyClassName + QLatin1Char('.') + methodName + QLatin1Char('(') + paramStr + QLatin1Char(')');
117 comment += (QLatin1Char(' ') + currentAtt->doc().replace(QRegExp(QLatin1String("[\\n\\r]+[\\t ]*")), endLine + QLatin1String(" ")));
134 QString(QLatin1String("@param _")) + re_params.cap(1).toLower() + re_params.cap(2) + QLatin1Char('_'));
146 comment += (endLine + QLatin1String("@param _") + RubyCodeGenerator::cppToRubyName(currentAtt->name()) + QLatin1Char('_'));
150 comment += (QLatin1Char(' ') + currentAtt->doc().replace(QRegExp(QLatin1String("[\\n\\r]+[\\t ]*")), endLine + QLatin1String(" ")));
QString getRubyClassName(const QString &name)
Definition: rubyclassifiercodedocument.cpp:87
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
RubyCodeOperation(RubyClassifierCodeDocument *doc, UMLOperation *op, const QString &body=QString(), const QString &comment=QString())
Empty Constructor.
Definition: rubycodeoperation.cpp:25
QString cap(int nth) const
void setEndMethodText(const QString &value)
Set the ending text that finishes this method after the body is printed.
Definition: codemethodblock.cpp:66
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
void setStartMethodText(const QString &value)
Set the starting text that begins this method before the body is printed.
Definition: codemethodblock.cpp:58
void updateMethodDeclaration()
This is the method called from within syncToparent().
Definition: rubycodeoperation.cpp:41
virtual int lastEditableLine()
Definition: rubycodeoperation.cpp:200
class ClassifierCodeDocument A CodeDocument which represents a UMLClassifier (e.g.
Definition: classifiercodedocument.h:32
QString getInitialValue() const
Returns The initial value of the UMLAttribute.
Definition: attribute.cpp:99
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:431
static QString cppToRubyName(const QString &cppName)
Convert C++ names such as 'm_foobar' or pFoobar to just 'foobar' for ruby.
Definition: rubycodegenerator.cpp:134
void setText(const QString &text)
Set the value of m_text The actual text of this code block.
Definition: textblock.cpp:80
the content was generated by code generation itself
Definition: codeblock.h:28
class RubyCodeDocumentation A Ruby code comment.
Definition: rubycodedocumentation.h:29
void setOverallIndentationLevel(int level)
A utility method that causes the comment and body of the code block to have the same indentation leve...
Definition: codeblockwithcomments.cpp:163
bool contains(const QString &str, Qt::CaseSensitivity cs) const
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
ContentType contentType() const
Get the value of m_contentType specifies whether the content (text) of this object was generated by t...
Definition: codeblock.cpp:54
UMLClassifier * getParentClassifier()
Get the value of m_parentclassifier.
Definition: classifiercodedocument.cpp:271
QString & remove(int position, int n)
static QString getNewLineEndingChars()
Get the new line chars which ends the line.
Definition: textblock.cpp:172
int matchedLength() const
int indexIn(const QString &str, int offset, CaretMode caretMode) const
int count(const T &value) const
void append(const T &value)
QString & insert(int position, QChar ch)
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:117
Definition: codeoperation.h:23
class RubyClassifierCodeDocument A Ruby UMLClassifier Code Document.
Definition: rubyclassifiercodedocument.h:36
bool isEmpty() const
bool parentIsInterface()
Return if the parent classifier is an interface.
Definition: classifiercodedocument.cpp:413
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
void setWriteOutText(bool write)
Set the value of m_writeOutText Whether or not to include the text of this TextBlock into a file...
Definition: textblock.cpp:131
QString toLower() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Definition: basictypes.h:57
UMLOperation * getParentOperation()
Add a Parameter object to the m_parameterVector List.
Definition: codeoperation.cpp:64
QString & replace(int position, int n, QChar after)
QString mid(int position, int n) const
int length() const
bool isConstructorOperation()
Returns whether this operation is a constructor.
Definition: operation.cpp:353
bool exactMatch(const QString &str) const
void setComment(CodeComment *object)
Set the Comment object.
Definition: codeblockwithcomments.cpp:38
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
static QString cppToRubyType(const QString &cppType)
Convert a C++ type such as 'int' or 'QWidget' to ruby types Integer and Qt::Widget.
Definition: rubycodegenerator.cpp:110
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.