예제 #1
0
파일: UmlPackage.cpp 프로젝트: SciBoy/douml
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);
}
예제 #2
0
void tst_Q3CString::append()
{
    Q3CString a;
    a = "<>ABCABCABCABC";
    QCOMPARE(a.append(">"),(Q3CString)"<>ABCABCABCABC>");
}