summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/codeimport/idlimport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/codeimport/idlimport.cpp')
-rw-r--r--umbrello/umbrello/codeimport/idlimport.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/umbrello/umbrello/codeimport/idlimport.cpp b/umbrello/umbrello/codeimport/idlimport.cpp
index 6d228baf..cd2db89d 100644
--- a/umbrello/umbrello/codeimport/idlimport.cpp
+++ b/umbrello/umbrello/codeimport/idlimport.cpp
@@ -14,9 +14,9 @@
#include <stdio.h>
// qt/kde includes
-// #include <qprocess.h> //should use this instead of popen()
-#include <qstringlist.h>
-#include <qregexp.h>
+// #include <tqprocess.h> //should use this instead of popen()
+#include <tqstringlist.h>
+#include <tqregexp.h>
#include <kdebug.h>
// app includes
#include "import_utils.h"
@@ -38,8 +38,8 @@ IDLImport::~IDLImport() {
}
/// Check for split type names (e.g. unsigned long long)
-QString IDLImport::joinTypename() {
- QString typeName = m_source[m_srcIndex];
+TQString IDLImport::joinTypename() {
+ TQString typeName = m_source[m_srcIndex];
if (m_source[m_srcIndex] == "unsigned")
typeName += ' ' + advance();
if (m_source[m_srcIndex] == "long" &&
@@ -48,18 +48,18 @@ QString IDLImport::joinTypename() {
return typeName;
}
-bool IDLImport::preprocess(QString& line) {
+bool IDLImport::preprocess(TQString& line) {
// Ignore C preprocessor generated lines.
if (line.startsWith("#"))
return true; // done
return NativeImportBase::preprocess(line);
}
-void IDLImport::fillSource(const QString& word) {
- QString lexeme;
+void IDLImport::fillSource(const TQString& word) {
+ TQString lexeme;
const uint len = word.length();
for (uint i = 0; i < len; i++) {
- QChar c = word[i];
+ TQChar c = word[i];
if (c.isLetterOrNumber() || c == '_') {
lexeme += c;
} else if (c == ':' && word[i + 1] == ':') {
@@ -74,28 +74,28 @@ void IDLImport::fillSource(const QString& word) {
} else {
if (!lexeme.isEmpty()) {
m_source.append(lexeme);
- lexeme = QString();
+ lexeme = TQString();
}
- m_source.append(QString(c));
+ m_source.append(TQString(c));
}
}
if (!lexeme.isEmpty())
m_source.append(lexeme);
}
-void IDLImport::parseFile(const QString& filename) {
+void IDLImport::parseFile(const TQString& filename) {
if (filename.contains('/')) {
- QString path = filename;
- path.remove( QRegExp("/[^/]+$") );
+ TQString path = filename;
+ path.remove( TQRegExp("/[^/]+$") );
kDebug() << "IDLImport::parseFile: adding path " << path << endl;
Import_Utils::addIncludePath(path);
}
- QStringList includePaths = Import_Utils::includePathList();
- //QProcess command("cpp", UMLAp::app());
- QString command("cpp -C"); // -C means "preserve comments"
- for (QStringList::Iterator pathIt = includePaths.begin();
+ TQStringList includePaths = Import_Utils::includePathList();
+ //TQProcess command("cpp", UMLAp::app());
+ TQString command("cpp -C"); // -C means "preserve comments"
+ for (TQStringList::Iterator pathIt = includePaths.begin();
pathIt != includePaths.end(); ++pathIt) {
- QString path = (*pathIt);
+ TQString path = (*pathIt);
//command.addArgument(" -I" + path);
command += " -I" + path;
}
@@ -106,21 +106,21 @@ void IDLImport::parseFile(const QString& filename) {
kError() << "IDLImport::parseFile: cannot popen(" << command << ")" << endl;
return;
}
- // Scan the input file into the QStringList m_source.
+ // Scan the input file into the TQStringList m_source.
m_source.clear();
char buf[256];
while (fgets(buf, sizeof(buf), fp) != NULL) {
int len = strlen(buf);
if (buf[len - 1] == '\n')
buf[--len] = '\0';
- NativeImportBase::scan( QString(buf) );
+ NativeImportBase::scan( TQString(buf) );
}
- // Parse the QStringList m_source.
+ // Parse the TQStringList m_source.
m_scopeIndex = 0;
m_scope[0] = NULL;
const uint srcLength = m_source.count();
for (m_srcIndex = 0; m_srcIndex < srcLength; m_srcIndex++) {
- const QString& keyword = m_source[m_srcIndex];
+ const TQString& keyword = m_source[m_srcIndex];
//kDebug() << '"' << keyword << '"' << endl;
if (keyword.startsWith(m_singleLineCommentIntro)) {
m_comment = keyword.mid(m_singleLineCommentIntro.length());
@@ -129,16 +129,16 @@ void IDLImport::parseFile(const QString& filename) {
if (! parseStmt())
skipStmt();
m_currentAccess = Uml::Visibility::Public;
- m_comment = QString();
+ m_comment = TQString();
}
pclose(fp);
}
bool IDLImport::parseStmt() {
- const QString& keyword = m_source[m_srcIndex];
+ const TQString& keyword = m_source[m_srcIndex];
const uint srcLength = m_source.count();
if (keyword == "module") {
- const QString& name = advance();
+ const TQString& name = advance();
UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Package,
name, m_scope[m_scopeIndex], m_comment);
m_scope[++m_scopeIndex] = static_cast<UMLPackage*>(ns);
@@ -150,19 +150,19 @@ bool IDLImport::parseStmt() {
return true;
}
if (keyword == "interface") {
- const QString& name = advance();
+ const TQString& name = advance();
UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class,
name, m_scope[m_scopeIndex], m_comment);
m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
m_klass->setStereotype("CORBAInterface");
m_klass->setAbstract(m_isAbstract);
m_isAbstract = false;
- m_comment = QString();
+ m_comment = TQString();
if (advance() == ";") // forward declaration
return true;
if (m_source[m_srcIndex] == ":") {
while (++m_srcIndex < srcLength && m_source[m_srcIndex] != "{") {
- const QString& baseName = m_source[m_srcIndex];
+ const TQString& baseName = m_source[m_srcIndex];
Import_Utils::createGeneralization(m_klass, baseName);
if (advance() != ",")
break;
@@ -176,7 +176,7 @@ bool IDLImport::parseStmt() {
return true;
}
if (keyword == "struct" || keyword == "exception") {
- const QString& name = advance();
+ const TQString& name = advance();
UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class,
name, m_scope[m_scopeIndex], m_comment);
m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
@@ -197,7 +197,7 @@ bool IDLImport::parseStmt() {
return true;
}
if (keyword == "enum") {
- const QString& name = advance();
+ const TQString& name = advance();
UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Enum,
name, m_scope[m_scopeIndex], m_comment);
UMLEnum *enumType = static_cast<UMLEnum*>(ns);
@@ -211,8 +211,8 @@ bool IDLImport::parseStmt() {
return true;
}
if (keyword == "typedef") {
- const QString& existingType = advance();
- const QString& newType = advance();
+ const TQString& existingType = advance();
+ const TQString& newType = advance();
Import_Utils::createUMLObject(Uml::ot_Class, newType, m_scope[m_scopeIndex],
m_comment, "CORBATypedef" /* stereotype */);
// @todo How do we convey the existingType ?
@@ -231,7 +231,7 @@ bool IDLImport::parseStmt() {
return true;
}
if (keyword == "valuetype") {
- const QString& name = advance();
+ const TQString& name = advance();
UMLObject *ns = Import_Utils::createUMLObject(Uml::ot_Class,
name, m_scope[m_scopeIndex], m_comment);
m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
@@ -243,7 +243,7 @@ bool IDLImport::parseStmt() {
if (advance() == "truncatable")
m_srcIndex++;
while (m_srcIndex < srcLength && m_source[m_srcIndex] != "{") {
- const QString& baseName = m_source[m_srcIndex];
+ const TQString& baseName = m_source[m_srcIndex];
Import_Utils::createGeneralization(m_klass, baseName);
if (advance() != ",")
break;
@@ -290,13 +290,13 @@ bool IDLImport::parseStmt() {
// (of a member of struct or valuetype, or return type
// of an operation.) Up next is the name of the attribute
// or operation.
- if (! keyword.contains( QRegExp("^\\w") )) {
+ if (! keyword.contains( TQRegExp("^\\w") )) {
kError() << "importIDL: ignoring " << keyword << endl;
return false;
}
- QString typeName = joinTypename();
- QString name = advance();
- if (name.contains( QRegExp("\\W") )) {
+ TQString typeName = joinTypename();
+ TQString name = advance();
+ if (name.contains( TQRegExp("\\W") )) {
kError() << "importIDL: expecting name in " << name << endl;
return false;
}
@@ -305,15 +305,15 @@ bool IDLImport::parseStmt() {
kError() << "importIDL: no class set for " << name << endl;
return false;
}
- QString nextToken = advance();
+ TQString nextToken = advance();
if (nextToken == "(") {
// operation
UMLOperation *op = Import_Utils::makeOperation(m_klass, name);
m_srcIndex++;
while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") {
- const QString &direction = m_source[m_srcIndex++];
- QString typeName = joinTypename();
- const QString &parName = advance();
+ const TQString &direction = m_source[m_srcIndex++];
+ TQString typeName = joinTypename();
+ const TQString &parName = advance();
UMLAttribute *att = Import_Utils::addMethodParameter(op, typeName, parName);
Uml::Parameter_Direction dir;
if (Model_Utils::stringToDirection(direction, dir))