当前位置: 首页>>代码示例>>C++>>正文


C++ Q3CString类代码示例

本文整理汇总了C++中Q3CString的典型用法代码示例。如果您正苦于以下问题:C++ Q3CString类的具体用法?C++ Q3CString怎么用?C++ Q3CString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Q3CString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parent

void UmlArtifact::genpro() {
  UmlPackage * pack = (UmlPackage *) parent()->parent();
  
  Q3CString path;

  if (! propertyValue("genpro path", path)) {

    path = pack->cppSrcDir();
  
    if (path.isEmpty())
      path = root_dir();
    else if (QDir::isRelativePath(path)) {
      QDir d(root_dir());
      
      d.cd(path);
      path = d.absPath();
    }
  }

  if (stereotype() == "executable") {
    gen_app(path);
  }
  else
    UmlCom::trace(stereotype() + " : not managed");
}
开发者ID:SciBoy,项目名称:douml,代码行数:25,代码来源:UmlArtifact.cpp

示例2: define

void UmlExitPointPseudoState::html(Q3CString pfix, unsigned int rank, unsigned int level) {
  define();

  UmlCom::message(name());

  Q3CString s = sKind();
  
  s.replace(0, 1, s.left(1).upper());
  UmlItem::html(s, (UmlDiagram *) 0);
  
  fw.write("<p>Defined in ");
  if (parent()->kind() == aRegion)
    parent()->parent()->write();
  else
    parent()->write();
  fw.write("</p>");
  
  if (reference() != 0) {
    fw.write("<p>References ");
    reference()->write();
    fw.write("</p>");
  }

  write_children(pfix, rank, level);

  unload(FALSE, FALSE);
}
开发者ID:SciBoy,项目名称:douml,代码行数:27,代码来源:UmlExitPointPseudoState.cpp

示例3: javaAnnotations

void UmlClassMember::write_annotation(FileOut & out) {
    if (_lang == Java) {
        Q3CString a = javaAnnotations();

        if (!a.isEmpty()) {
            switch (_taggedvalue_mode) {
            case 1:
                out.indent();
                out << "<UML:ModelElement.taggedValue>\n";
                out.indent();
                out << "\t<UML:TaggedValue tag=\"annotations\" value=\"";
                out.quote(a);
                out << "\"/>\n";
                out.indent();
                out << "</UML:ModelElement.taggedValue>\n";
                break;
            case 2:
                out.indent();
                out << "<UML:ModelElement.taggedValue>\n";
                out.indent();
                out << "\t<UML:TaggedValue.tag>annotations</UML:TaggedValue.tag>\n";
                out.indent();
                out << "\t<UML:TaggedValue.value>";
                out.quote(a);
                out << "</UML:TaggedValue.value>\n";
                out.indent();
                out << "</UML:ModelElement.taggedValue>\n";
            }
        }
    }
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: write_begin

void UmlAcceptEventAction::write(FileOut & out) {
  write_begin(out, "AcceptEventAction");
  
  if (isUnmarshall())
    out << " isUnmarshall=\"true\"";
  
  Q3CString trig;
  
  switch (_lang) {
  case Uml:
    trig = trigger();
    break;
  case Cpp:
    trig = cppTrigger();
    break;
  default:
    // java
    trig = javaTrigger();
  }

  if (! trig.isEmpty()) {
    out.ref(this, "trigger", "TRIGGER_");
    write_end(out);
    
    out.indent();
    out << "<trigger xmi:type=\"uml:Trigger\"";
    out.id_prefix(this, "TRIGGER_");
    out << " name=\"";
    out.quote(trig);
    out << "\"/>\n";
  }
  else
    write_end(out);

}
开发者ID:SciBoy,项目名称:douml,代码行数:35,代码来源:UmlActivityActionClasses.cpp

示例5: name

Q3CString UmlClassMember::true_name(Q3CString decl) {
    int index = decl.find("${name}", 0); //[rageek] Removed CS=FALSE param - rethink this, case sensitive

    if (index == -1)
        // too complicated, return the Uml one
        return name();

    int begin = index;

    while ((begin != 0) && identChar(decl[begin - 1]))
        begin -= 1;

    int sup = index + 7;

    while (identChar(decl[sup]))
        sup += 1;

    Q3CString r = decl.mid(begin, index - begin);
    Q3CString k = decl.mid(index + 2, 4);

    if (k == "name")
        r += name();
    else if (k == "Name")
        r += name().left(1).upper() + name().mid(1);
    else
        // NAME
        r += name().upper();

    r += decl.mid(index + 7, sup - index - 7);

    return r;
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例6: read_list_elt

Q3CString Lex::read_list_elt()
{
  const char * p = _context.pointer;  
  int level = 1;
  Q3CString s;
  
  while (!((s = read_word(TRUE)).isEmpty())) {
    int c = *s;
    
    if ((c == '>') || (c == ')') || (c == ']')) {
      if (--level == 0)
	break;
    }
    else if (c == ',') {
      if (level == 1)
	break;
    }
    else if ((c == '<') || (c == '(') || (c == '['))
      level += 1;
  }
  
  if (! s.isEmpty())
    unread_word();
  
  char c = *_context.pointer;
  
  *_context.pointer = 0;
  s = p;  
  *_context.pointer = c;
  
  return s.stripWhiteSpace();
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例7: manage_decorators

static void manage_decorators(QTextOStream & f, const Q3CString & decorators,
			      QString indent, BooL & indent_needed)
{
  if (! decorators.isEmpty()) {
    int index = 0;
    int index2;
    
    while ((index2 = decorators.find("\n", index)) != -1){
      if (indent_needed)
	f << indent;
      else
	indent_needed = TRUE;
      f << decorators.mid(index, index2 + 1 - index);
      index = index2 + 1;
    }
    
    if (index != (int) decorators.length()) {
      if (indent_needed) {
	f << indent;
	indent_needed = FALSE;
      }
      f << decorators.mid(index);
    }
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:25,代码来源:UmlOperation.cpp

示例8: mimetype

QByteArray K3BookmarkDrag::encodedData( const char* mime ) const
{
    QByteArray a;
    Q3CString mimetype( mime );
    if ( mimetype == "text/uri-list" )
        return Q3UriDrag::encodedData( mime );
    else if ( mimetype == "application/x-xbel" )
    {
        a = m_doc.toByteArray();
        //kDebug(7043) << "K3BookmarkDrag::encodedData " << m_doc.toCString();
    }
    else if ( mimetype == "text/plain" )
    {
        KUrl::List m_lstDragURLs;
        if ( K3URLDrag::decode( this, m_lstDragURLs ) )
        {
            QStringList uris;
            KUrl::List::ConstIterator uit = m_lstDragURLs.constBegin();
            KUrl::List::ConstIterator uEnd = m_lstDragURLs.constEnd();
            for ( ; uit != uEnd ; ++uit )
                uris.append( (*uit).prettyUrl() );

            Q3CString s = uris.join( "\n" ).toLocal8Bit();
            a.resize( s.length() + 1 ); // trailing zero
            memcpy( a.data(), s.data(), s.length() + 1 );
        }
    }
    return a;
}
开发者ID:ssj-gz,项目名称:emscripten-kdelibs,代码行数:29,代码来源:k3bookmarkdrag.cpp

示例9: pythonNameSpec

Q3CString UmlOperation::compute_name() {
  Q3CString get_set_spec = pythonNameSpec();
  
  if (! get_set_spec.isEmpty()) {
    UmlClassMember * it;
    
    if ((it = getOf()) == 0)
      it = setOf();
    
    int index;
    Q3CString s = (it->kind() == aRelation)
      ? ((UmlRelation *) it)->roleName()
      : it->name();
    
    if ((index = get_set_spec.find("${name}")) != -1)
      get_set_spec.replace(index, 7, s);
    else if ((index = get_set_spec.find("${Name}")) != -1)
      get_set_spec.replace(index, 7, capitalize(s));
    else if ((index = s.find("${NAME}")) != -1)
      get_set_spec.replace(index, 7, s.upper());
    else if ((index = s.find("${nAME}")) != -1)
      get_set_spec.replace(index, 7, s.lower());
    
    return get_set_spec;
  }
  else
    return name();
}
开发者ID:SciBoy,项目名称:douml,代码行数:28,代码来源:UmlOperation.cpp

示例10: nequal

bool nequal(const Q3CString & s1, const Q3CString & s2)
{
  // don't take into account first and last white spaces (like a stripWhiteSpace())
  const char * p1 = (s1.isNull()) ? "" : (const char *) s1;
  const char * p2 = (s2.isNull()) ? "" : (const char *) s2;
  const char * e1 = p1 + s1.length();
  const char * e2 = p2 + s2.length();
  
  while ((p1 != e1) && is_white_space(p1[0]))
    p1 += 1;
  
  while ((p2 != e2) && is_white_space(p2[0]))
    p2 += 1;
  
  while ((e1 != p1) && is_white_space(e1[-1]))
    e1 -= 1;
  
   while ((e2 != p2) && is_white_space(e2[-1]))
    e2 -= 1;
  
  for (;;) {
    if (p1 >= e1)
      return (p2 < e2);
    if (*p1 != *p2)
      return TRUE;
    
    while (*++p1 == '\r') ;
    while (*++p2 == '\r') ;
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:30,代码来源:Lex.cpp

示例11: create

void UmlUseCase::importIt(FileIn & in, Token & token, UmlItem * where)
{
  where = where->container(anUseCase, token, in);
    
  if (where != 0) {
    Q3CString s = token.valueOf("name");
    
    if (s.isEmpty()) {
      static unsigned n = 0;
      
      s.sprintf("anonymous_usecase_%u", ++n);
    }
    
    UmlUseCase * uc = create(where, s);
    
    if (uc == 0)
      in.error("cannot create use case '" + s +
	       "' in '" + where->name() + "'");
    
    uc->addItem(token.xmiId(), in);
    
    if (! token.closed()) {
      Q3CString k = token.what();
      const char * kstr = k;
      
      while (in.read(), !token.close(kstr))
	uc->UmlItem::import(in, token);
    }

    uc->unload(TRUE, FALSE);
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:32,代码来源:UmlUseCase.cpp

示例12: c

void tst_Q3CString::constructor()
{
    Q3CString a;
    Q3CString b; //b(10);
    Q3CString c("String C");
    char tmp[10];
    tmp[0] = 'S';
    tmp[1] = 't';
    tmp[2] = 'r';
    tmp[3] = 'i';
    tmp[4] = 'n';
    tmp[5] = 'g';
    tmp[6] = ' ';
    tmp[7] = 'D';
    tmp[8] = 'X';
    tmp[9] = '\0';
    Q3CString d(tmp,9);
    Q3CString ca(a);
    Q3CString cb(b);
    Q3CString cc(c);

    QCOMPARE(a,ca);
    QVERIFY(a.isNull());
    QVERIFY(a == Q3CString(""));
    QCOMPARE(b,cb);
    QCOMPARE(c,cc);
    QCOMPARE(d,(Q3CString)"String D");

    Q3CString null(0);
    QVERIFY( null.isNull() );
    QVERIFY( null.isEmpty() );
    Q3CString empty("");
    QVERIFY( !empty.isNull() );
    QVERIFY( empty.isEmpty() );
}
开发者ID:mpvader,项目名称:qt,代码行数:35,代码来源:tst_q3cstring.cpp

示例13: name

void UmlRelation::write_relation(FileOut & out) {
  // note : it is the first side
 
  if (_assoc_class != 0)
    // generated in the association class
    return;
    
  const char * k = (_uml_20) ? "ownedElement" : "packagedElement";

  out.indent();
  out << '<' << k << " xmi:type=\"uml:Association\"";
  out.id_prefix(this, "ASSOC_");
  
  Q3CString s = name();
  int i1 = s.find("(");
  int i2 = s.findRev(")");
  
  if ((i1 != -1) && (i2 != -1) && (i2 > i1) && (s[i1+1] != '<')  && (s[i2-1] != '>')) {
    s = s.mid(i1 + 1, i2 - i1 - 1);
    
    if (!s.isEmpty()) {
      out << " name=\"";
      out.quote((const char*)s);//[jasa] ambiguous call
      out << '"';
    }
  }
  write_visibility(out);
  out << ">\n";
  
  write_ends(out);
  
  out.indent();
  out << "</" << k << ">\n";

}
开发者ID:SciBoy,项目名称:douml,代码行数:35,代码来源:UmlRelation.cpp

示例14: javaSource

bool UmlArtifact::is_imported(Q3CString path, Q3CString class_name) {
  if (imports == 0) {
    imports = new Q3AsciiDict<UmlArtifact>(17);
    
    Q3CString s = javaSource();
    int index = 0;
    
    while ((index = s.find("import", index)) != -1) {
      if ((index == 0) || (s[index - 1] < ' ')) {
	int index2 = index + 6;
	
	while ((s[index2] == ' ') || (s[index2] == '\t'))
	  index2 += 1;
	
	if ((index2 != (index + 6)) &&
	    ((index = s.find(';', index2)) != -1) &&
	    (index != index2)) {
	 Q3CString p = s.mid(index2, index - index2);
	 
	 imports->insert(p, this);
	}
	else
	  index = index2;
      }
      else
	index += 6;
    }
  }
  
  return ((imports->find(path + '.' + class_name) != 0) ||
	  (imports->find(path + ".*") != 0));
}
开发者ID:SciBoy,项目名称:douml,代码行数:32,代码来源:UmlArtifact.cpp

示例15: QVERIFY

void tst_Q3CString::isEmpty()
{
    Q3CString a;
    QVERIFY(a.isEmpty());
    Q3CString c("Not empty");
    QVERIFY(!c.isEmpty());
}
开发者ID:mpvader,项目名称:qt,代码行数:7,代码来源:tst_q3cstring.cpp


注:本文中的Q3CString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。