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


C++ QCString::find方法代码示例

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


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

示例1: checkInlineCode

bool checkInlineCode(QCString & doc)
{
  int index=doc.find("\\code");

  if (index>0)
  {
     strComment+=doc;
	 startCodeBlock(index);
	 doxComment=TRUE;
	 return true;
  }
  return false;
}
开发者ID:Distrotech,项目名称:doxygen,代码行数:13,代码来源:vhdljjparser.cpp

示例2: findMatchingPart

static int findMatchingPart(const QCString &path,const QCString dir)
{
  int si1;
  int pos1=0,pos2=0;
  while ((si1=path.find('/',pos1))!=-1)
  {
    int si2=dir.find('/',pos2);
    //printf("  found slash at pos %d in path %d: %s<->%s\n",si1,si2,
    //    path.mid(pos1,si1-pos2).data(),dir.mid(pos2).data());
    if (si2==-1 && path.mid(pos1,si1-pos2)==dir.mid(pos2)) // match at end
    {
      return dir.length();
    }
    if (si1!=si2 || path.mid(pos1,si1-pos2)!=dir.mid(pos2,si2-pos2)) // no match in middle
    {
      return QMAX(pos1-1,0);
    }
    pos1=si1+1;
    pos2=si2+1;
  }
  return 0;
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例3: if

void UmlClass::uml2java(bool rec) {
  if (isJavaExternal())
    set_JavaDecl(JavaSettings::externalClassDecl());
  else {
    QCString st = JavaSettings::classStereotype(stereotype());
    UmlItem * pack = parent()->parent();
    
    while (pack->kind() != aPackage)
      pack = pack->parent();
    
    if ((st == "stereotype") ||
	(st == "metaclass") ||
	(pack->stereotype() == "profile")) {
      set_CppDecl("");
      return;
    }
    
    if (st == "enum_pattern")
      set_JavaDecl(JavaSettings::enumPatternDecl());
    else if (st == "enum")
      set_JavaDecl(JavaSettings::enumDecl());
    else if (st == "interface")
      set_JavaDecl(JavaSettings::interfaceDecl());
    else if (st == "@interface") {
      QCString s = JavaSettings::interfaceDecl();
      int index = s.find("interface");
      
      if (index != -1)
	s.insert(index, '@');
      set_JavaDecl(s);
    }
    else if (st == "ignored") {
      set_JavaDecl("");
      return;
    }
    else
      set_JavaDecl(JavaSettings::classDecl());
    
    if (rec) {
      const QVector<UmlItem> ch = children();
      unsigned n = ch.size();
      
      for (unsigned i = 0; i != n; i += 1)
	ch[i]->uml2java(rec);
    }
    
    if (parent()->kind() == aClassView)
      // not nested
      artifact()->set_JavaSource(JavaSettings::sourceContent());
  }
}
开发者ID:gregsmirnov,项目名称:bouml,代码行数:51,代码来源:UmlClass.cpp

示例4: define_datatypes

void FileOut::define_datatypes(bool uml_20, bool primitive_type, bool gen_extension) {
  const char * pfix = (primitive_type) 
	? ((uml_20) ? "<ownedMember xmi:type=\"uml:PrimitiveType\""
		    : "<packagedElement xmi:type=\"uml:PrimitiveType\"")
	: ((uml_20) ? "<ownedMember xmi:type=\"uml:DataType\""
		    : "<packagedElement xmi:type=\"uml:DataType\"");

  QMap<QCString, int>::ConstIterator it;
  
  for (it = _datatypes.begin();
       it != _datatypes.end();
       ++it) {
    indent();
    (*this) << pfix << " xmi:id=\"BOUML_datatype_"
      << it.data() << "\" name=\"";
    quote(it.key());
    (*this) << "\"/>\n";
  }
  
  const char * postfix = 
    (uml_20) ? "</ownedMember>\n" : "</packagedElement>\n";

  for (it = _modifiedtypes.begin();
       it != _modifiedtypes.end();
       ++it) {
    QCString k = it.key();
    int index = k.find('_');
    
    indent();
    (*this) << pfix << " xmi:id=\"BOUML_basedontype_"
      << it.data() << "\" name = \"";
    quote(k.mid(index + 1));
    (*this) << '"';

    if (gen_extension) {
      (*this) << ">\n";
      indent();
      (*this) << "\t<xmi:Extension extender=\"Bouml\">\n";
      indent();
      (*this) << "\t\t<basedOn \"BOUML_" << k.left(index) << "\"/>\n";
      indent();
      (*this) << "\t</xmi:Extension>\n";
      indent();
      (*this) << postfix;
    }
    else
      (*this) << "/>\n";
  }
}
开发者ID:,项目名称:,代码行数:49,代码来源:

示例5: numReserve

int DM::numReserve()
{
    if(DMType == GDM)
        return 1; /* Bleh */

    if(DMType == OldKDM)
        return strstr(ctl, ",rsvd") ? 1 : -1;

    QCString re;
    int p;

    if(!(exec("caps\n", re) && (p = re.find("\treserve ")) >= 0))
        return -1;
    return atoi(re.data() + p + 9);
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:15,代码来源:dmctl.cpp

示例6: remove_preprocessor

void UmlClassItem::remove_preprocessor(QCString & s)
{
  int index = 0;
  
  while ((index = s.find('#', index)) != -1) {
    // remove all up to the end of line
    int index2 = index + 1;
    int index3;
    
    while ((index3 = s.find('\n', index2)) != -1) {
      // manage multi lines #define
      if (((const char *) s)[index3 - 1] != '\\')
	break;
      else
	index2 = index3 + 1;
    }
    
    // the \n is still here to hava a separator
    if (index3 == -1)
      s.truncate(index);
    else
      s.remove(index, index3 - index);
  }
}
开发者ID:,项目名称:,代码行数:24,代码来源:

示例7: timeUpdate

void KJFilename::timeUpdate(int)
{
	if ( !napp->player()->current() ) // just for safety
		return;

	QCString title = QCString( napp->player()->current().title().local8Bit() );

	if ( title == mLastTitle )
		return;

	mLastTitle = title;

	QCString timestring = napp->player()->lengthString().local8Bit();
	timestring = timestring.mid(timestring.find('/')+1);
	prepareString ( title + " (" + timestring + ")   ");
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:16,代码来源:kjtextdisplay.cpp

示例8: value_of

QCString value_of(QCString s, QCString k, int & index)
{
  index = s.find(k);
  
  if (index == -1) {
    QCString result;
    
    return result;
  }
  else {
    int index2;
    
    index += k.length();
    return get_next_word(s, index, index2);
  }
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例9: codecForCharset

// tries to create a codec by the given charset description
static QTextCodec* codecForCharset( const QCString& Desc )
{
  int i = Desc.find( "charset=" );
  if( i >= 0 )
  {
    QCString CharSetName = Desc.mid( i+8 );
    // remove any further attributes
    if( (i=CharSetName.find( ';' )) >= 0 )
      CharSetName = CharSetName.left( i );

    // try to find codec
    return QTextCodec::codecForName( CharSetName );
  }
  // no charset=, use locale
  return KGlobal::locale()->codecForEncoding();
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:17,代码来源:kbufferdrag.cpp

示例10: findcharset

static
QTextCodec* findcharset(const QCString& mimetype)
{
    int i=mimetype.find("charset=");
    if ( i >= 0 ) {
	QCString cs = mimetype.mid(i+8);
	stripws(cs);
	i = cs.find(';');
	if ( i >= 0 )
	    cs = cs.left(i);
	// May return 0 if unknown charset
	return QTextCodec::codecForName(cs,cs.length()*3/4);
    }
    // no charset=, use locale
    return QTextCodec::codecForLocale();
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:16,代码来源:qdragobject.cpp

示例11: addClass

bool GroupDef::addClass(const ClassDef *cd)
{
  static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
  if (cd->isHidden()) return FALSE;
  updateLanguage(cd);
  QCString qn = cd->name();
  if (classSDict->find(qn)==0)
  {
    //printf("--- addClass %s sort=%d\n",qn.data(),sortBriefDocs);
    if (sortBriefDocs)
    {
      classSDict->inSort(qn,cd);
    }
    else
    {
      int i=qn.findRev("::");
      if (i==-1) i=qn.find('.');
      bool found=FALSE;
      //printf("i=%d\n",i);
      if (i!=-1)
      {
        // add nested classes (e.g. A::B, A::C) after their parent (A) in 
        // order of insertion
        QCString scope = qn.left(i);
        int j=classSDict->findAt(scope);
        if (j!=-1)
        {
          while (j<(int)classSDict->count() && 
              classSDict->at(j)->qualifiedName().left(i)==scope)
          {
            //printf("skipping over %s\n",classSDict->at(j)->qualifiedName().data());
            j++;
          }
          //printf("Found scope at index %d\n",j);
          classSDict->insertAt(j,qn,cd);
          found=TRUE;
        }
      }
      if (!found) // no insertion point found -> just append
      {
        classSDict->append(qn,cd);
      }
    }
    return TRUE;
  }
  return FALSE;
}
开发者ID:wufengyi,项目名称:doxygen,代码行数:47,代码来源:groupdef.cpp

示例12: slotDCOPApplicationRegistered

void DebuggerPart::slotDCOPApplicationRegistered(const QCString& appId)
{
    if (appId.find("drkonqi-") == 0) {
        QByteArray answer;
        QCString replyType;

        kapp->dcopClient()->call(appId, "krashinfo", "appName()", QByteArray(), replyType, answer, true, 5000);

        QDataStream d(answer, IO_ReadOnly);
        QCString appName;
        d >> appName;

        if (appName.length() && project() && project()->mainProgram().endsWith(appName)) {
            kapp->dcopClient()->send(appId, "krashinfo", "registerDebuggingApplication(QString)", i18n("Debug in &KDevelop"));
            connectDCOPSignal(appId, "krashinfo", "acceptDebuggingApplication()", "slotDebugExternalProcess()", true);
        }
    }
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:17,代码来源:debuggerpart.cpp

示例13: QCString

// creates the name for the local text/plain
static const char *localTextPlain()
{
  static QCString TextPlainLocal;

  if( TextPlainLocal.isNull() )
  {
    TextPlainLocal = QCString(KGlobal::locale()->encoding()).lower();
    // remove the whitespaces
    int s;
    while( (s=TextPlainLocal.find(' ')) >= 0 )
      TextPlainLocal.remove( s, 1 );

    TextPlainLocal.prepend( TextPlainLocalStub );
  }

  return TextPlainLocal;
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:18,代码来源:kbufferdrag.cpp

示例14: emitSignal

/**
 * Client "conn" emits the signal "fun" with "data" as arguments.
 *
 * If "excludeSelf" is true, signal is never sent to "conn" itself.
 */
void DCOPSignals::emitSignal(DCOPConnection *conn, const QCString &_fun, const QByteArray &data, bool excludeSelf)
{
    QCString senderObj;
    QCString fun = _fun;
    int i = fun.find('#');
    if(i > -1)
    {
        senderObj = fun.left(i);
        fun = fun.mid(i + 1);
    }

    DCOPSignalConnectionList *list = connections.find(fun);
    if(!list)
        return;
    for(DCOPSignalConnection *current = list->first(); current; current = list->next())
    {
        bool doSend = false;
        if(current->senderConn)
        {
            if(current->senderConn == conn)
                doSend = true;
        }
        else if(!current->sender.isEmpty())
        {
            if((conn && current->sender == conn->appId) || (current->sender == "DCOPServer"))
                doSend = true;
        }
        else
        {
            doSend = true;
        }

        if(!current->senderObj.isEmpty() && (current->senderObj != senderObj))
        {
            doSend = false;
        }

        if(excludeSelf && (conn == current->recvConn))
            doSend = false;
        if(doSend)
        {
            the_server->sendMessage(current->recvConn, conn ? conn->appId : QCString("DCOPServer"), current->recvConn->appId, current->recvObj,
                                    current->slot, data);
        }
    }
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:51,代码来源:dcopsignals.cpp

示例15: execute

/*!
  Executes the application associated with this AppLnk, with
  \a args as arguments.

  \sa exec()
*/
void AppLnk::execute(const QStringList& args) const
{
#ifdef Q_WS_QWS
    if ( !mRotation.isEmpty() ) {
  // ######## this will only work in the server
  int rot = QPEApplication::defaultRotation();
  int j = 0;
  rot = (rot+mRotation.toInt())%360;
  QCString old = getenv( "QWS_DISPLAY" ) ? getenv( "QWS_DISPLAY" ) : "Transformed";
  QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() );
  setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg( driver ).arg( rot ), 1 );
  invoke(args);
  setenv("QWS_DISPLAY", old.data(), 1);
    } else
#endif
  invoke(args);
}
开发者ID:opieproject,项目名称:opie,代码行数:23,代码来源:applnk.cpp


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