diff options
Diffstat (limited to 'umbrello/umbrello/codegenerators/cppwriter.cpp')
-rw-r--r-- | umbrello/umbrello/codegenerators/cppwriter.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/umbrello/umbrello/codegenerators/cppwriter.cpp b/umbrello/umbrello/codegenerators/cppwriter.cpp index 3f22a300..d58ceae4 100644 --- a/umbrello/umbrello/codegenerators/cppwriter.cpp +++ b/umbrello/umbrello/codegenerators/cppwriter.cpp @@ -113,7 +113,7 @@ void CppWriter::writeClass(UMLClassifier *c) need_impl = false; } if (need_impl) { - fileName.tqreplace( TQRegExp(".h$"), ".cpp"); + fileName.replace( TQRegExp(".h$"), ".cpp"); if( !openFile(filecpp, fileName)) { emit codeGenerated(c, false); return; @@ -141,13 +141,13 @@ void CppWriter::writeHeaderFile (UMLClassifier *c, TQFile &fileh) { // write header blurb TQString str = getHeadingFile(".h"); if(!str.isEmpty()) { - str.tqreplace(TQRegExp("%filename%"),m_classifierInfo->fileName + ".h"); - str.tqreplace(TQRegExp("%filepath%"),fileh.name()); + str.replace(TQRegExp("%filename%"),m_classifierInfo->fileName + ".h"); + str.replace(TQRegExp("%filepath%"),fileh.name()); h << str<< m_endl; } // Write the hash define stuff to prevent multiple parsing/inclusion of header - TQString hashDefine = m_classifierInfo->className.upper().simplifyWhiteSpace().tqreplace(TQRegExp(" "), "_"); + TQString hashDefine = m_classifierInfo->className.upper().simplifyWhiteSpace().replace(TQRegExp(" "), "_"); writeBlankLine(h); h << "#ifndef "<< hashDefine + "_H" << m_endl; h << "#define "<< hashDefine + "_H" << m_endl; @@ -206,8 +206,8 @@ void CppWriter::writeSourceFile (UMLClassifier *c, TQFile &filecpp ) { TQString str; str = getHeadingFile(".cpp"); if(!str.isEmpty()) { - str.tqreplace(TQRegExp("%filename%"),m_classifierInfo->fileName + ".cpp"); - str.tqreplace(TQRegExp("%filepath%"),filecpp.name()); + str.replace(TQRegExp("%filename%"),m_classifierInfo->fileName + ".cpp"); + str.replace(TQRegExp("%filepath%"),filecpp.name()); cpp << str << m_endl; } @@ -627,7 +627,7 @@ void CppWriter::writeAttributeMethods(UMLAttributeList *attribs, // from what I can tell, this IS the default behavior for // cleanName. I dunno why its not working -b.t. methodBaseName = methodBaseName.stripWhiteSpace(); - methodBaseName.tqreplace(0,1,methodBaseName.tqat(0).upper()); + methodBaseName.replace(0,1,methodBaseName.tqat(0).upper()); writeSingleAttributeAccessorMethods(at->getTypeName(), varName, methodBaseName, at->getDoc(), Uml::chg_Changeable, isHeaderMethod, @@ -641,7 +641,7 @@ void CppWriter::writeComment(const TQString &comment, const TQString &myIndent, // in the case we have several line comment.. // NOTE: this part of the method has the problem of adopting UNIX newline, // need to resolve for using with MAC/WinDoze eventually I assume - if (comment.tqcontains(TQRegExp("\n"))) { + if (comment.contains(TQRegExp("\n"))) { TQStringList lines = TQStringList::split( "\n", comment); for(uint i= 0; i < lines.count(); i++) @@ -736,14 +736,14 @@ void CppWriter::writeAssociationRoleDecl(TQString fieldClassName, TQString roleN // declare the association based on whether it is this a single variable // or a List (Vector). One day this will be done correctly with special // multiplicity object that we don't have to figure out what it means via regex. - if(multi.isEmpty() || multi.tqcontains(TQRegExp("^[01]$"))) + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { TQString fieldVarName = "m_" + roleName.lower(); // record this for later consideration of initialization IF the // multi value requires 1 of these objects - if(ObjectFieldVariables.tqfindIndex(fieldVarName) == -1 && - multi.tqcontains(TQRegExp("^1$")) + if(ObjectFieldVariables.findIndex(fieldVarName) == -1 && + multi.contains(TQRegExp("^1$")) ) { // ugh. UGLY. Storing variable name and its class in pairs. @@ -759,7 +759,7 @@ void CppWriter::writeAssociationRoleDecl(TQString fieldClassName, TQString roleN // record unique occurrences for later when we want to check // for initialization of this vector - if(VectorFieldVariables.tqfindIndex(fieldVarName) == -1) + if(VectorFieldVariables.findIndex(fieldVarName) == -1) VectorFieldVariables.append(fieldVarName); stream << indent << policyExt()->getVectorClassName() <<"<" << fieldClassName << "*"; @@ -823,7 +823,7 @@ void CppWriter::writeAssociationRoleMethod (const TQString &fieldClassName, const TQString &description, Uml::Changeability_Type change, TQTextStream &stream) { - if(multi.isEmpty() || multi.tqcontains(TQRegExp("^[01]$"))) + if(multi.isEmpty() || multi.contains(TQRegExp("^[01]$"))) { TQString fieldVarName = "m_" + roleName.lower(); writeSingleAttributeAccessorMethods(fieldClassName, fieldVarName, roleName, @@ -860,9 +860,9 @@ void CppWriter::writeVectorAttributeAccessorMethods ( stream << "add" << fldName << " ( " << className << " add_object )"; if (writeMethodBody) { TQString method = VECTOR_METHOD_APPEND; - method.tqreplace(TQRegExp("%VARNAME%"),fieldVarName); - method.tqreplace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); - method.tqreplace(TQRegExp("%ITEMCLASS%"),className); + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); + method.replace(TQRegExp("%ITEMCLASS%"),className); stream << indent << " {" << m_endl; m_indentLevel++; printTextAsSeparateLinesWithIndent(method,getIndent(),stream); @@ -883,9 +883,9 @@ void CppWriter::writeVectorAttributeAccessorMethods ( stream << "remove" << fldName << " ( " << className << " remove_object )"; if (writeMethodBody) { TQString method = VECTOR_METHOD_REMOVE; - method.tqreplace(TQRegExp("%VARNAME%"),fieldVarName); - method.tqreplace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); - method.tqreplace(TQRegExp("%ITEMCLASS%"),className); + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); + method.replace(TQRegExp("%ITEMCLASS%"),className); stream << indent << " {" << m_endl; m_indentLevel++; printTextAsSeparateLinesWithIndent(method,getIndent(),stream); @@ -1034,8 +1034,8 @@ void CppWriter::writeInitAttibuteMethod (TQTextStream &stream) for( it = VectorFieldVariables.begin(); it != VectorFieldVariables.end(); ++it ) { TQString fieldVarName = *it; TQString method = VECTOR_METHOD_INIT; - method.tqreplace(TQRegExp("%VARNAME%"),fieldVarName); - method.tqreplace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%VECTORTYPENAME%"), policyExt()->getVectorClassName()); stream << getIndent() << method << m_endl; } } @@ -1047,8 +1047,8 @@ void CppWriter::writeInitAttibuteMethod (TQTextStream &stream) it++; TQString fieldClassName = *it; TQString method = OBJECT_METHOD_INIT; - method.tqreplace(TQRegExp("%VARNAME%"),fieldVarName); - method.tqreplace(TQRegExp("%ITEMCLASS%"),fieldClassName); + method.replace(TQRegExp("%VARNAME%"),fieldVarName); + method.replace(TQRegExp("%ITEMCLASS%"),fieldClassName); stream << getIndent() << method << m_endl; } } |