void UmlPackage::reverse_main(const Q3CString & type, Q3CString comment) { // do not lost main ! Lex::mark(); UmlOperation::skip_body(); UmlArtifact * cp; #ifdef ROUNDTRIP bool roundtrip = FALSE; if ((cp = UmlArtifact::get_main()) != 0) { roundtrip = TRUE; cp->set_usefull(); } else #endif if ((cp = UmlBaseArtifact::create(get_deploymentview(0), "main")) == 0) { UmlCom::trace("<font face=helvetica><b>cannot create <i>artifact main</i></b></font><br><hr>"); return; } if (! comment.isEmpty()) { unsigned start = 0; do { comment.insert(start, "//"); start = comment.find('\n', start + 2) + 1; } while (start != 0); comment.append("\n\n"); } comment.append(type); comment.append(" main("); comment.append(Lex::region()); comment.append("\n"); #ifdef ROUNDTRIP if (roundtrip) { if (cp->cppSource() != comment) cp->set_CppSource(comment); return; } #endif cp->set_Stereotype("source"); cp->set_CppSource(comment); cp->set_CppHeader(0); }
void tst_Q3CString::append() { Q3CString a; a = "<>ABCABCABCABC"; QCOMPARE(a.append(">"),(Q3CString)"<>ABCABCABCABC>"); }