[Uml-devel] KDE/kdesdk/umbrello/umbrello (silent)
Andi Fischer
andi.fischer at hispeed.ch
Sun Dec 23 09:48:29 UTC 2007
SVN commit 752003 by fischer:
SVN_SILENT only format changes
M +4 -5 codegenerator.cpp
M +8 -5 codegenerators/codegen_utils.cpp
M +4 -4 codegenerators/codegen_utils.h
M +8 -45 codegenerators/cppsourcecodedocument.cpp
M +24 -18 codegenerators/cppsourcecodedocument.h
M +9 -19 codegenerators/cppsourcecodeoperation.cpp
M +16 -10 codegenerators/cppsourcecodeoperation.h
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerator.cpp #752002:752003
@@ -21,9 +21,9 @@
#include <cstdlib> //to get the user name
// qt includes
-#include <qdatetime.h>
-#include <qregexp.h>
-#include <qdir.h>
+#include <QtCore/QDateTime>
+#include <QtCore/QRegExp>
+#include <QtCore/QDir>
#include <QtCore/QTextStream>
// kde includes
@@ -631,8 +631,7 @@
int index;
while ((index = input.lastIndexOf(" ", lineWidth)) >= 0) {
output += linePrefix + input.left(index) + endLine; // add line
- input.remove(0, index + 1); //and remove processed string, including
- // white space
+ input.remove(0, index + 1); // remove processed string, including white space
}
if (!input.isEmpty())
output += linePrefix + input + endLine;
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegen_utils.cpp #752002:752003
@@ -17,7 +17,8 @@
namespace Codegen_Utils {
-QStringList cppDatatypes() {
+QStringList cppDatatypes()
+{
QStringList l;
l.append("int");
l.append("char");
@@ -33,8 +34,8 @@
return l;
}
-const QStringList reservedCppKeywords() {
-
+const QStringList reservedCppKeywords()
+{
static QStringList keywords;
if (keywords.isEmpty()) {
@@ -395,7 +396,8 @@
return keywords;
}
-void createCppStereotypes() {
+void createCppStereotypes()
+{
UMLDoc *umldoc = UMLApp::app()->getDocument();
umldoc->findOrCreateStereotype("constructor");
// declares an operation as friend
@@ -404,7 +406,8 @@
umldoc->findOrCreateStereotype("virtual");
}
-QString capitalizeFirstLetter(const QString &string) {
+QString capitalizeFirstLetter(const QString &string)
+{
QChar firstChar = string.at(0);
return firstChar.toUpper() + string.mid(1);
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegen_utils.h #752002:752003
@@ -12,22 +12,22 @@
#ifndef CODEGEN_UTILS_H
#define CODEGEN_UTILS_H
-#include <qstringlist.h>
+#include <QtCore/QStringList>
namespace Codegen_Utils {
/**
- * Return list of C++ datatypes
+ * Return list of C++ datatypes.
*/
QStringList cppDatatypes();
/**
- * Get list of C++ reserved keywords
+ * Get list of C++ reserved keywords.
*/
const QStringList reservedCppKeywords();
/**
- * Add C++ stereotypes
+ * Add C++ stereotypes.
*/
void createCppStereotypes();
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp #752002:752003
@@ -38,33 +38,9 @@
#include "cppsourcecodeclassfielddeclarationblock.h"
#include "../uml.h"
-// Constructors/Destructors
-//
-
CPPSourceCodeDocument::CPPSourceCodeDocument ( UMLClassifier * concept )
- : ClassifierCodeDocument (concept) {
- init ( );
-}
-
-CPPSourceCodeDocument::~CPPSourceCodeDocument ( ) { }
-
-//
-// Methods
-//
-
-// Accessor methods
-//
-
-// Other methods
-//
-
-QString CPPSourceCodeDocument::getCPPClassName (const QString &name) {
- return CodeGenerator::cleanName(name);
-}
-
-// Initialize this cpp classifier code document
-void CPPSourceCodeDocument::init ( ) {
-
+ : ClassifierCodeDocument (concept)
+{
setFileExtension(".cpp");
m_methodsBlock = 0;
@@ -77,12 +53,12 @@
*/
}
-/**
- * @param op
- */
-// in the vannilla version, we just tack all operations on the end
-// of the document
-bool CPPSourceCodeDocument::addCodeOperation (CodeOperation * op ) {
+CPPSourceCodeDocument::~CPPSourceCodeDocument()
+{
+}
+
+bool CPPSourceCodeDocument::addCodeOperation (CodeOperation * op )
+{
bool retval = false;
if (op->getParentOperation()->isLifeOperation()) {
if (m_constructorBlock)
@@ -98,29 +74,18 @@
return retval;
}
-
void CPPSourceCodeDocument::resetTextBlocks()
{
-
// all special pointers need to be zero'd out.
m_methodsBlock = 0;
m_constructorBlock = 0;
// now do the traditional release of child text blocks
ClassifierCodeDocument::resetTextBlocks();
-
}
-// This method will cause the class to rebuild its text representation.
-// based on the parent classifier object.
-// For any situation in which this is called, we are either building the code
-// document up, or replacing/regenerating the existing auto-generated parts. As
-// such, we will want to insert everything we reasonably will want
-// during creation. We can set various parts of the document (esp. the
-// comments) to appear or not, as needed.
void CPPSourceCodeDocument::updateContent( )
{
-
// Gather info on the various fields and parent objects of this class...
//UMLClassifier * c = getParentClassifier();
CodeGenPolicyExt *pe = UMLApp::app()->getPolicyExt();
@@ -145,7 +110,6 @@
CodeClassFieldList compositionClassFields = getSpecificClassFields ( CodeClassField::Composition );
// START GENERATING CODE/TEXT BLOCKS and COMMENTS FOR THE DOCUMENT
- //
// INCLUDE CODEBLOCK
QString includeStatement;
@@ -169,7 +133,6 @@
m_methodsBlock->addCodeClassFieldMethods(compositionClassFields);
// constructors and other operations are handled by the "addCodeOperation" method above.
-
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppsourcecodedocument.h #752002:752003
@@ -17,56 +17,62 @@
#ifndef CPPSOURCECODEDOCUMENT_H
#define CPPSOURCECODEDOCUMENT_H
-#include <qstring.h>
+#include <QtCore/QString>
#include "../classifiercodedocument.h"
#include "../hierarchicalcodeblock.h"
/**
- * class CPPSourceCodeDocument
- * A CPP UMLClassifier Source Code Document.
- */
+ * A CPP UMLClassifier Source Code Document.
+ */
class CPPSourceCodeDocument : public ClassifierCodeDocument
{
Q_OBJECT
public:
- // Constructors/Destructors
- //
-
/**
* Constructor
*/
- CPPSourceCodeDocument (UMLClassifier * classifier);
+ CPPSourceCodeDocument(UMLClassifier * classifier);
/**
* Empty Destructor
*/
- virtual ~CPPSourceCodeDocument ( );
+ virtual ~CPPSourceCodeDocument();
- /** add a code operation to this cpp classifier code document.
- * @return bool which is true IF the code operation was added successfully
+ /**
+ * Add a code operation to this cpp classifier code document.
+ * In the vannilla version, we just tack all operations on the end
+ * of the document.
+ * @param op the code operation
+ * @return bool which is true IF the code operation was added successfully
*/
- bool addCodeOperation (CodeOperation * op );
+ bool addCodeOperation(CodeOperation * op);
+ /**
+ * This method will cause the class to rebuild its text representation.
+ * based on the parent classifier object.
+ * For any situation in which this is called, we are either building the code
+ * document up, or replacing/regenerating the existing auto-generated parts. As
+ * such, we will want to insert everything we reasonably will want
+ * during creation. We can set various parts of the document (esp. the
+ * comments) to appear or not, as needed.
+ */
void updateContent();
protected:
- // reset/clear our inventory of textblocks in this document
+ /**
+ * Reset/clear our inventory of textblocks in this document.
+ */
void resetTextBlocks();
- // a little utility method to save us some work
- QString getCPPClassName (const QString &name);
-
private:
HierarchicalCodeBlock * m_constructorBlock;
HierarchicalCodeBlock * m_methodsBlock;
- void init ( );
-
};
#endif // CPPSOURCECODEDOCUMENT_H
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppsourcecodeoperation.cpp #752002:752003
@@ -5,7 +5,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2004-2006 *
+ * copyright (C) 2004-2007 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
@@ -22,10 +22,7 @@
#include "cppcodedocumentation.h"
#include "../uml.h"
-// Constructors/Destructors
-//
-
-CPPSourceCodeOperation::CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment )
+CPPSourceCodeOperation::CPPSourceCodeOperation(CPPSourceCodeDocument * doc, UMLOperation *parent, const QString & body, const QString & comment )
: CodeOperation (doc, parent, body, comment)
{
// lets not go with the default comment and instead use
@@ -37,30 +34,23 @@
setEndMethodText("}");
}
-CPPSourceCodeOperation::~CPPSourceCodeOperation ( ) { }
+CPPSourceCodeOperation::~CPPSourceCodeOperation()
+{
+}
-// Other methods
-//
-
-// we basically just want to know whether or not to print out
-// the body of the operation.
-// In C++ if the operations are inline, then we DON'T print out
-// the body text.
void CPPSourceCodeOperation::updateContent( )
{
CodeGenPolicyExt *pe = UMLApp::app()->getPolicyExt();
CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe);
bool isInlineMethod = policy->getOperationsAreInline();
- if(!isInlineMethod)
- setText(""); // change whatever it is to "";
-
+ if (!isInlineMethod) {
+ setText(""); // change whatever it is to ""
+ }
}
-// we basically want to update the doc and start text of this method
void CPPSourceCodeOperation::updateMethodDeclaration()
{
-
CPPSourceCodeDocument * doc = dynamic_cast<CPPSourceCodeDocument*>(getParentDocument());
CodeGenPolicyExt *pe = UMLApp::app()->getPolicyExt();
CPPCodeGenerationPolicy * policy = dynamic_cast<CPPCodeGenerationPolicy*>(pe);
@@ -115,7 +105,7 @@
// Only write this out if its a child of an interface OR is abstract.
// and its not inline
- if(isInterface || o->getAbstract() || isInlineMethod)
+ if (isInterface || o->getAbstract() || isInlineMethod)
{
setWriteOutText(false);
} else {
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppsourcecodeoperation.h #752002:752003
@@ -5,7 +5,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2004-2006 *
+ * copyright (C) 2004-2007 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
@@ -14,11 +14,10 @@
* Date : Mon Sep 1 2003
*/
-
#ifndef CPPSOURCECODEOPERATION_H
#define CPPSOURCECODEOPERATION_H
-#include <qstring.h>
+#include <QtCore/QString>
#include "../codeoperation.h"
class CPPSourceCodeDocument;
@@ -28,22 +27,29 @@
Q_OBJECT
public:
- // Constructors/Destructors
- //
-
/**
- * Empty Constructor
+ * Constructor.
*/
- CPPSourceCodeOperation ( CPPSourceCodeDocument * doc, UMLOperation * op, const QString & body = "", const QString & comment = "");
+ CPPSourceCodeOperation(CPPSourceCodeDocument * doc, UMLOperation * op, const QString & body = "", const QString & comment = "");
/**
* Empty Destructor
*/
- virtual ~CPPSourceCodeOperation ( );
+ virtual ~CPPSourceCodeOperation();
+ /**
+ * Update the doc and start text of this method.
+ */
virtual void updateMethodDeclaration();
- virtual void updateContent( );
+ /**
+ * Just want to know whether or not to print out
+ * the body of the operation.
+ * In C++ if the operations are inline, then we DON'T print out
+ * the body text.
+ */
+ virtual void updateContent();
+
};
#endif // CPPSOURCECODEOPERATION_H
More information about the umbrello-devel
mailing list