diff options
Diffstat (limited to 'umbrello/umbrello/codegenerators/idlwriter.cpp')
-rw-r--r-- | umbrello/umbrello/codegenerators/idlwriter.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/umbrello/umbrello/codegenerators/idlwriter.cpp b/umbrello/umbrello/codegenerators/idlwriter.cpp index a893acc3..dc367f50 100644 --- a/umbrello/umbrello/codegenerators/idlwriter.cpp +++ b/umbrello/umbrello/codegenerators/idlwriter.cpp @@ -13,9 +13,9 @@ #include <kdebug.h> #include <kmessagebox.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> #include "../umldoc.h" #include "../classifier.h" @@ -34,7 +34,7 @@ IDLWriter::IDLWriter() : SimpleCodeGenerator(false) { IDLWriter::~IDLWriter() {} bool IDLWriter::isOOClass(UMLClassifier *c) { - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant" || stype == "CORBAEnum" || stype == "CORBAStruct" || stype == "CORBAUnion" || stype == "CORBASequence" || stype == "CORBAArray" || @@ -59,7 +59,7 @@ Uml::Programming_Language IDLWriter::getLanguage() { } void IDLWriter::computeAssocTypeAndRole -(UMLAssociation *a, UMLClassifier *c, QString& typeName, QString& roleName) +(UMLAssociation *a, UMLClassifier *c, TQString& typeName, TQString& roleName) { // Determine which is the "remote" end of the association: bool IAmRoleA = true; @@ -70,9 +70,9 @@ void IDLWriter::computeAssocTypeAndRole at == Uml::at_UniAssociation) { // Assuming unidirectional association, and we are // at the "wrong" side. - // Returning roleName = QString::null tells caller to + // Returning roleName = TQString::null tells caller to // skip this association at this side. - roleName = QString(); + roleName = TQString(); return; } IAmRoleA = false; @@ -80,7 +80,7 @@ void IDLWriter::computeAssocTypeAndRole } // Construct the type name: typeName = cleanName(other->getName()); - QString multiplicity; + TQString multiplicity; if (IAmRoleA) multiplicity = a->getMulti(Uml::B); else @@ -107,16 +107,16 @@ void IDLWriter::writeClass(UMLClassifier *c) { } const bool isClass = !c->isInterface(); - QString classname = cleanName(c->getName()); + TQString classname = cleanName(c->getName()); //find an appropriate name for our file - QString fileName = findFileName(c, ".idl"); + TQString fileName = findFileName(c, ".idl"); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } - QFile file; + TQFile file; if (!openFile(file, fileName)) { emit codeGenerated(c, false); return; @@ -124,13 +124,13 @@ void IDLWriter::writeClass(UMLClassifier *c) { // Start generating the code. - QTextStream idl(&file); + TQTextStream idl(&file); //try to find a heading file(license, comments, etc) - QString str; + TQString str; str = getHeadingFile(".idl"); if (!str.isEmpty()) { - str.replace(QRegExp("%filename%"), fileName); - str.replace(QRegExp("%filepath%"), file.name()); + str.replace(TQRegExp("%filename%"), fileName); + str.replace(TQRegExp("%filepath%"), file.name()); idl << str << m_endl; } @@ -141,7 +141,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { for (UMLPackage *conc = includes.first(); conc; conc = includes.next()) { if (conc->getBaseType() == Uml::ot_Datatype) continue; - QString incName = findFileName(conc, ".idl"); + TQString incName = findFileName(conc, ".idl"); if (!incName.isEmpty()) idl << "#include \"" << incName << "\"" << m_endl; } @@ -171,7 +171,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { idl << getIndent() << "enum " << classname << " {" << m_endl; m_indentLevel++; for (UMLClassifierListItem *lit = litList.first(); lit; lit = litList.next()) { - QString enumLiteral = cleanName(lit->getName()); + TQString enumLiteral = cleanName(lit->getName()); idl << getIndent() << enumLiteral; if (++i < litList.count()) idl << ","; @@ -187,7 +187,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { return; } if (! isOOClass(c)) { - QString stype = c->getStereotype(); + TQString stype = c->getStereotype(); if (stype == "CORBAConstant") { kError() << "The stereotype " << stype << " cannot be applied to " << c->getName() << ", but only to attributes." << endl; @@ -206,7 +206,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { m_indentLevel++; uint i = 0; for (at = atl.first(); at; at = atl.next()) { - QString enumLiteral = cleanName(at->getName()); + TQString enumLiteral = cleanName(at->getName()); idl << getIndent() << enumLiteral; if (++i < atl.count()) idl << ","; @@ -220,7 +220,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { idl << getIndent() << "struct " << classname << " {" << m_endl; m_indentLevel++; for (at = atl.first(); at; at = atl.next()) { - QString name = cleanName(at->getName()); + TQString name = cleanName(at->getName()); idl << getIndent() << at->getTypeName() << " " << name << ";" << m_endl; // Initial value not possible in IDL. } @@ -228,7 +228,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { if (!compositions.isEmpty()) { idl << getIndent() << "// Compositions." << m_endl; for (UMLAssociation *a = compositions.first(); a; a = compositions.next()) { - QString memberType, memberName; + TQString memberType, memberName; computeAssocTypeAndRole(a, c, memberType, memberName); idl << getIndent() << memberType << " " << memberName << ";" << m_endl; } @@ -237,7 +237,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { if (!aggregations.isEmpty()) { idl << getIndent() << "// Aggregations." << m_endl; for (UMLAssociation *a = aggregations.first(); a; a = aggregations.next()) { - QString memberType, memberName; + TQString memberType, memberName; computeAssocTypeAndRole(a, c, memberType, memberName); idl << getIndent() << memberType << " " << memberName << ";" << m_endl; } @@ -294,7 +294,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { for (a = assocs.first(); a; a = assocs.next()) { if (! assocTypeIsMappableToAttribute(a->getAssocType())) continue; - QString multiplicity = a->getMulti(Uml::A); + TQString multiplicity = a->getMulti(Uml::A); if (multiplicity.isEmpty() || multiplicity == "1") continue; if (!didComment) { @@ -302,7 +302,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { didComment = true; } UMLClassifier* other = (UMLClassifier*)a->getObject(Uml::A); - QString bareName = cleanName(other->getName()); + TQString bareName = cleanName(other->getName()); idl << getIndent() << "typedef sequence<" << other->getFullyQualifiedName("::") << "> " << bareName << "Vector;" << m_endl << m_endl; } @@ -313,7 +313,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { if (forceSections() || atl.count()) { idl << getIndent() << "// Attributes:" << m_endl << m_endl; for (UMLAttribute *at = atl.first(); at; at = atl.next()) { - QString attName = cleanName(at->getName()); + TQString attName = cleanName(at->getName()); Uml::Visibility scope = at->getVisibility(); idl << getIndent(); if (isValuetype) { @@ -358,7 +358,7 @@ void IDLWriter::writeClass(UMLClassifier *c) { Uml::Association_Type at = a->getAssocType(); if (! assocTypeIsMappableToAttribute(at)) continue; - QString typeName, roleName; + TQString typeName, roleName; computeAssocTypeAndRole(a, c, typeName, roleName); if (roleName.isEmpty()) // presumably because we are at the "wrong" end continue; @@ -386,9 +386,9 @@ void IDLWriter::writeClass(UMLClassifier *c) { } -void IDLWriter::writeOperation(UMLOperation *op, QTextStream &idl, bool is_comment) { +void IDLWriter::writeOperation(UMLOperation *op, TQTextStream &idl, bool is_comment) { UMLAttributeList atl = op->getParmList(); - QString rettype = op->getTypeName(); + TQString rettype = op->getTypeName(); if (rettype.isEmpty()) rettype = "void"; @@ -420,8 +420,8 @@ void IDLWriter::writeOperation(UMLOperation *op, QTextStream &idl, bool is_comme idl << ");" << m_endl << m_endl; } -QStringList IDLWriter::defaultDatatypes() { - QStringList l; +TQStringList IDLWriter::defaultDatatypes() { + TQStringList l; l.append("boolean"); l.append("char"); l.append("octet"); @@ -436,9 +436,9 @@ QStringList IDLWriter::defaultDatatypes() { return l; } -const QStringList IDLWriter::reservedKeywords() const { +const TQStringList IDLWriter::reservedKeywords() const { - static QStringList keywords; + static TQStringList keywords; if (keywords.isEmpty()) { keywords << "any" |