[Uml-devel] kdesdk/umbrello/umbrello/codegenerators

Brian Thomas thomas at mail630.gsfc.nasa.gov
Tue Apr 13 18:08:06 UTC 2004


CVS commit by thomas: 

for consistency, moved fixTypeName to cppcodegenerator, as it was moved in the java tree to javacodegenerator


  M +0 -13     cppcodeclassfield.cpp   1.6
  M +0 -1      cppcodeclassfield.h   1.4
  M +12 -0     cppcodegenerator.cpp   1.19
  M +2 -0      cppcodegenerator.h   1.11


--- kdesdk/umbrello/umbrello/codegenerators/cppcodeclassfield.cpp  #1.5:1.6
@@ -16,5 +16,4 @@
 
 #include <kdebug.h>
-#include <qregexp.h>
 
 #include "cppcodeclassfield.h"
@@ -53,16 +52,4 @@ CPPCodeClassField::~CPPCodeClassField ( 
 //  
 
-// IF the type is "string" we need to declare it as
-// the CPP Object "String" (there is no string primative in CPP).
-// Same thing again for "bool" to "boolean"
-QString CPPCodeClassField::fixTypeName(QString string)
-{
-// FIX!!
-        string.replace(QRegExp("^[Ll]ist$"),"QPtrList");
-        string.replace(QRegExp("^string$"),"QString");
-        string.replace(QRegExp("^bool$"),"bool");
-        return cleanName(string);
-}
-
 QString CPPCodeClassField::getFieldName() {
         if (parentIsAttribute()) 

--- kdesdk/umbrello/umbrello/codegenerators/cppcodeclassfield.h  #1.3:1.4
@@ -44,5 +44,4 @@ public:
         virtual ~CPPCodeClassField ( );
 
-        QString fixTypeName(QString string); 
         QString getFieldType();
         QString getFieldName();

--- kdesdk/umbrello/umbrello/codegenerators/cppcodegenerator.cpp  #1.18:1.19
@@ -17,4 +17,6 @@
 #include <kconfig.h>
 
+#include <qregexp.h>
+
 #include "cppcodegenerator.h"
 #include "cppcodedocumentation.h"
@@ -172,4 +174,14 @@ bool CPPCodeGenerator::getAutoGenerateAc
 //
 
+// CHange the following dataTypes to the ones the user really
+// wants in their code. Not yet complete.
+QString CPPCodeGenerator::fixTypeName(QString string)
+{
+// FIX!!
+        string.replace(QRegExp("^[Ll]ist$"),"QPtrList");
+        string.replace(QRegExp("^string$"),"QString");
+        return cleanName(string);
+}
+
 // special method needed so that we write out the header code documents
 bool CPPCodeGenerator::saveToXMI ( QDomDocument & doc, QDomElement & root ) {

--- kdesdk/umbrello/umbrello/codegenerators/cppcodegenerator.h  #1.10:1.11
@@ -79,4 +79,6 @@ public:
         bool getAutoGenerateAccessors( );
 
+        QString fixTypeName(QString string);
+
         /**
          * Add a header CodeDocument object from m_headercodedocumentVector List






More information about the umbrello-devel mailing list