本文整理汇总了C++中QCString::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ QCString::contains方法的具体用法?C++ QCString::contains怎么用?C++ QCString::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCString
的用法示例。
在下文中一共展示了QCString::contains方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sirc_receive
void KSircIONotify::sirc_receive(QCString str, bool)
{
if(str.contains("*)*")){
int s1, s2;
s1 = str.find("Signon by") + 10;
s2 = str.find(" ", s1);
if(s1 < 0 || s2 < 0){
kdDebug(5008) << "Nick Notify mesage broken: " << str << endl;
return;
}
QString nick = str.mid(s1, s2 - s1);
emit notify_online(nick);
}
else if(str.contains("*(*")){
int s1, s2;
s1 = str.find("Signoff by") + 11;
s2 = str.find(" ", s1);
if(s1 < 0 || s2 < 0){
kdDebug(5008) << "Nick Notify mesage broken: " << str << endl;
return;
}
QString nick = str.mid(s1, s2 - s1);
emit notify_offline(nick);
}
else{
proc->getWindowList()["!default"]->sirc_receive(str);
kdDebug(5008) << "Nick Notifer got " << str << endl;
}
}
示例2: ConverseChfn
/*
* The actual work.
* Return values: -1 = unknown error, 0 = ok, >0 = error code.
*/
int ChfnProcess::ConverseChfn(const char *pass)
{
int status=-1;
QCString line;
while(1)
{
line = readLine();
if ( line.isEmpty() )
continue;// discard line
if ( line.contains( "Password: " )/*isPrompt( line, "password" )*/ )
{
WaitSlave();
write(m_Fd, pass, strlen(pass));
write(m_Fd, "\n", 1);
}
line = readLine(); // Let's see what the outcome was
if ( line.contains( "Changing finger info" ) )
{
// do nothing
}
else if ( line.contains( "information changed" ) )
{
status=0;
break;
}
else if ( line.isEmpty() )
{
status=0;
break;
}
else if ( line.contains( "Password error" ) || line.contains("Incorrect password") )
{
status=PasswordError;
break;
}
else
{
status=MiscError;
m_Error=line;
break;
}
}
return status;
}
示例3: encode
void QUrl::encode( QString& url )
{
if ( url.isEmpty() )
return;
QCString curl = url.utf8();
int oldlen = curl.length();
const QCString special( "<>#@\"&%$:,;?={}|^~[]\'`\\ \n\t\r" );
QString newUrl;
int newlen = 0;
for ( int i = 0; i < oldlen ;++i ) {
uchar inCh = (uchar)curl[ i ];
if ( inCh >= 128 || special.contains(inCh) ) {
newUrl[ newlen++ ] = QChar( '%' );
ushort c = inCh / 16;
c += c > 9 ? 'A' - 10 : '0';
newUrl[ newlen++ ] = c;
c = inCh % 16;
c += c > 9 ? 'A' - 10 : '0';
newUrl[ newlen++ ] = c;
} else {
newUrl[ newlen++ ] = inCh;
}
}
url = newUrl;
}
示例4: oneLineComment
void VhdlParser::oneLineComment(QCString qcs)
{
bool isEndCode=qcs.contains("\\endcode");
int index = qcs.find("\\code");
if (isEndCode)
{
int end = inputString.find(qcs.data(),iCodeLen);
makeInlineDoc(end);
}
else if (index > 0)
{
// assert(false);
strComment=qcs;
startCodeBlock(index);
strComment.resize(0);
}
if (!isEndCode && index==-1)
{
int j=qcs.find("--!");
qcs=qcs.right(qcs.length()-3-j);
if (!checkMultiComment(qcs,iDocLine))
{
handleCommentBlock(qcs,TRUE);
}
}
}
示例5: parseDefineConstruct
void parseDefineConstruct(QCString & largs, MemberDef* mdef ,OutputList& ol)
{
// QCString largs=mdef->getDefinition();
int kr=largs.contains("\\?");
ol.startBold();
VerilogDocGen::writeLink(mdef,ol);
ol.docify(" ");
ol.insertMemberAlign();
ol.startTextBlock();
if(kr>0)
{
largs=mdef->definition();
largs.stripPrefix("feature");
while(largs.stripPrefix(" "));
largs.stripPrefix(mdef->name().data());
QStringList ql=QStringList::split("\\?",largs,false);
for(uint i=0;i<ql.count();i++)
{
// ol.startParagraph();
QCString val=ql[i].data();
//ol.codify(val.data());
VhdlDocGen::formatString(val,ol,mdef);
// ol.lineBreak();
// ol.endParagraph();
}
}
else
VhdlDocGen::formatString(largs,ol,mdef);
ol.endTextBlock(true);
ol.endBold();
}
示例6: appRegistered
void NoatunInterface::appRegistered(const QCString &appId)
{
if (appId.contains("noatun",false))
{
mAppId = appId;
emit playerStarted();
mNoatunTimer->start(mTimerValue);
}
}
示例7: appRemoved
void NoatunInterface::appRemoved(const QCString &appId)
{
if (appId.contains("noatun",false))
{
// is there still another noatun alive?
if (findRunningNoatun())
return;
mNoatunTimer->stop();
emit playerStopped();
emit newSliderPosition(0,0);
}
}
示例8: write_description_properties
void UmlItem::write_description_properties(FileOut & out) {
if (! description().isEmpty()) {
static int rank = 0;
out.indent();
out << "<ownedComment xmi:type=\"uml:Comment\" xmi:id=\"COMMENT_"
<< ++rank << "\" body=\"";
out.quote(description());
out << "\"/>\n";
}
QCString ste = stereotype();
if (_gen_extension) {
const QDict<QCString> up = properties();
QDictIterator<QCString> it(up);
if (it.current()) {
out.indent();
out << "<xmi:Extension extender=\"Bouml\">\n";
if (! ste.isEmpty()) {
out.indent();
out << "\t<stereotype name=\"";
out.quote(ste);
out << "\"/>\n";
}
do {
out.indent();
out << "\t<taggedValue tag=\"";
out.quote(it.currentKey());
out << "\" value=\"";
out.quote(*(it.current()));
out << "\"/>\n";
++it;
} while (it.current());
out.indent();
out << "</xmi:Extension>\n";
}
else if (! ste.isEmpty()) {
out.indent();
out << "<xmi:Extension extender=\"Bouml\"><stereotype name=\"";
out.quote(ste);
out << "\"/></xmi:Extension>\n";
}
}
if (ste.contains(':') == 1)
// probably a stereotype part of profile
_stereotypes[ste].append(this);
}
示例9: sirc_receive
void KSircIOLAG::sirc_receive(QCString str, bool)
{
if(str.contains("*L*")){
int s1, s2;
s1 = str.find("*L* ") + 4;
s2 = str.length();
if(s1 < 0 || s2 < 0){
kdDebug(5008) << "Lag mesage broken: " << str << endl;
return;
}
QString lag = str.mid(s1, s2 - s1);
// cerr << "Lag: " << str << endl;
// cerr << "Setting lag to: " << lag << endl;
(proc->getWindowList())["!all"]->control_message(SET_LAG, lag);
}
}
示例10: isPrompt
bool PasswdProcess::isPrompt(QCString line, const char *word)
{
unsigned i, j, colon;
unsigned int lineLength(line.length());
for(i = 0, j = 0, colon = 0; i < lineLength; i++)
{
if(line[i] == ':')
{
j = i;
colon++;
continue;
}
if(!isspace(line[i]))
j++;
}
if((colon != 1) || (line[j] != ':'))
return false;
if(word == 0L)
return true;
return line.contains(word, false);
}
示例11: doCommand
//.........这里部分代码省略.........
repo->add(key, data);
data.value = m_Pass;
data.timeout = m_Timeout;
key = makeKey(0, m_Host, auth_user, command);
repo->add(key, data);
pass = m_Pass;
}
// Execute the command asynchronously
kdDebug(1205) << "Executing command: " << command << endl;
pid_t pid = fork();
if(pid < 0)
{
kdDebug(1205) << "fork(): " << strerror(errno) << endl;
respond(Res_NO);
break;
}
else if(pid > 0)
{
m_pid = pid;
respond(Res_OK);
break;
}
// Ignore SIGCHLD because "class SuProcess" needs waitpid()
signal(SIGCHLD, SIG_DFL);
int ret;
if(m_Host.isEmpty())
{
SuProcess proc;
proc.setCommand(command);
proc.setUser(user);
if(options.contains('x'))
proc.setXOnly(true);
if(options.contains('f'))
proc.setDCOPForwarding(true);
proc.setPriority(m_Priority);
proc.setScheduler(m_Scheduler);
proc.setEnvironment(env);
ret = proc.exec(pass.data());
}
else
{
SshProcess proc;
proc.setCommand(command);
proc.setUser(user);
proc.setHost(m_Host);
ret = proc.exec(pass.data());
}
kdDebug(1205) << "Command completed: " << command << endl;
_exit(ret);
}
case Lexer::Tok_delCmd: // "DEL command:string user:string\n"
tok = l->lex();
if(tok != Lexer::Tok_str)
goto parse_error;
command = l->lval();
tok = l->lex();
if(tok != Lexer::Tok_str)
goto parse_error;
user = l->lval();
if(l->lex() != '\n')
goto parse_error;
示例12: setOptions
bool KSshProcess::setOptions(const SshOptList &opts)
{
kdDebug(KSSHPROC) << "KSshProcess::setOptions()" << endl;
mArgs.clear();
SshOptListConstIterator it;
QString cmd, subsystem;
mPassword = mUsername = mHost = QString::null;
QCString tmp;
for(it = opts.begin(); it != opts.end(); ++it)
{
// kdDebug(KSSHPROC) << "opt.opt = " << (*it).opt << endl;
// kdDebug(KSSHPROC) << "opt.str = " << (*it).str << endl;
// kdDebug(KSSHPROC) << "opt.num = " << (*it).num << endl;
switch((*it).opt)
{
case SSH_VERBOSE:
mArgs.append("-v");
break;
case SSH_SUBSYSTEM:
subsystem = (*it).str;
break;
case SSH_PORT:
mArgs.append("-p");
tmp.setNum((*it).num);
mArgs.append(tmp);
mPort = (*it).num;
break;
case SSH_HOST:
mHost = (*it).str;
break;
case SSH_USERNAME:
mArgs.append("-l");
mArgs.append((*it).str.latin1());
mUsername = (*it).str;
break;
case SSH_PASSWD:
mPassword = (*it).str;
break;
case SSH_PROTOCOL:
if(mVersion <= OPENSSH)
{
tmp = "Protocol=";
tmp += QString::number((*it).num).latin1();
mArgs.append("-o");
mArgs.append(tmp);
}
else if(mVersion <= SSH)
{
if((*it).num == 1)
{
mArgs.append("-1");
}
// else uses version 2 by default
}
break;
case SSH_FORWARDX11:
tmp = "ForwardX11=";
tmp += (*it).boolean ? "yes" : "no";
mArgs.append("-o");
mArgs.append(tmp);
break;
case SSH_FORWARDAGENT:
tmp = "ForwardAgent=";
tmp += (*it).boolean ? "yes" : "no";
mArgs.append("-o");
mArgs.append(tmp);
break;
case SSH_ESCAPE_CHAR:
if((*it).num == -1)
tmp = "none";
else
tmp = (char)((*it).num);
mArgs.append("-e");
mArgs.append(tmp);
break;
case SSH_OPTION:
// don't allow NumberOfPasswordPrompts or StrictHostKeyChecking
// since KSshProcess depends on specific setting of these for
// preforming authentication correctly.
tmp = (*it).str.latin1();
if(tmp.contains("NumberOfPasswordPrompts") || tmp.contains("StrictHostKeyChecking"))
{
mError = ERR_INVALID_OPT;
return false;
}
else
{
mArgs.append("-o");
mArgs.append(tmp);
}
//.........这里部分代码省略.........
示例13: handleCommentBlock
void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
{
int position=0;
static bool isIn;
QCString doc;
doc.append(doc1);
// fprintf(stderr,"\n %s",doc.data());
if (doc.isEmpty()) return;
if (checkMultiComment(doc,yyLineNr))
{
strComment.resize(0);
return;
}
isIn=checkInlineCode(doc);
bool isEndCode=doc.contains("\\endcode");
// empty comment --!
if (isEndCode)
{
int end=inputString.find(doc.data(),iCodeLen);
makeInlineDoc(end);
strComment.resize(0);
isIn=false;
}
if (isIn)
{
isIn=false;
return;
}
VhdlDocGen::prepareComment(doc);
bool needsEntry=FALSE;
Protection protection=Public;
int lineNr;
if (iDocLine==-1)
lineNr=yyLineNr;
if (oldEntry==current)
{
//printf("\n find pending message < %s > at line: %d \n ",doc.data(),iDocLine);
str_doc.doc=doc;
str_doc.iDocLine=iDocLine;
str_doc.brief=brief;
str_doc.pending=TRUE;
return;
}
oldEntry=current;
if (brief)
{
current->briefLine = yyLineNr;
}
else
{
current->docLine = yyLineNr;
}
// printf("parseCommentBlock file<%s>\n [%s]\n at line [%d] \n ",yyFileName.data(),doc.data(),iDocLine);
int j=doc.find("[plant]");
if (j>=0)
{
doc=doc.remove(j,7);
current->stat=true;
}
while (parseCommentBlock(
g_thisParser,
current,
doc, // text
yyFileName, // file
iDocLine, // line of block start
brief,
0,
FALSE,
protection,
position,
needsEntry
)
)
{
//printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
if (needsEntry) newEntry();
}
if (needsEntry)
{
if (varr)
{
varr=FALSE;
current->name=varName;
current->section=Entry::VARIABLEDOC_SEC;
varName="";
}
newEntry();
}
iDocLine=-1;
strComment.resize(0);
}
示例14: processLine
bool LhaArch::processLine( const QCString &line )
{
const char *_line = ( const char * ) line;
char columns[13][80];
char filename[4096];
if ( line.contains( "[generic]" ) )
{
sscanf( _line,
" %79[]\\[generic] %79[0-9] %79[0-9] %79[0-9.%*] %10[-a-z0-9 ] %3[A-Za-z]%1[ ]%2[0-9 ]%1[ ]%5[ 0-9:]%1[ ]%4095[^\n]",
columns[0], columns[2], columns[3], columns[4], columns[5],
columns[6], columns[10], columns[7], columns[11], columns[8],
columns[9], filename );
strcpy( columns[1], " " );
}
else if ( line.contains( "[MS-DOS]" ) )
{
sscanf( _line,
" %79[]\\[MS-DOS] %79[0-9] %79[0-9] %79[0-9.%*] %10[-a-z0-9 ] %3[A-Za-z]%1[ ]%2[0-9 ]%1[ ]%5[ 0-9:]%1[ ]%4095[^\n]",
columns[0], columns[2], columns[3], columns[4], columns[5],
columns[6], columns[10], columns[7], columns[11], columns[8],
columns[9], filename );
strcpy( columns[1], " " );
}
else
{
sscanf( _line,
" %79[-drlwxst] %79[0-9/] %79[0-9] %79[0-9] %79[0-9.%*] %10[-a-z0-9 ] %3[A-Za-z]%1[ ]%2[0-9 ]%1[ ]%5[ 0-9:]%1[ ]%4095[^\n]",
columns[0], columns[1], columns[2], columns[3],
columns[4], columns[5], columns[6], columns[10], columns[7],
columns[11], columns[8], columns[9], filename );
}
// make the time stamp sortable
QString massagedTimeStamp = ArkUtils::getTimeStamp( columns[6], columns[7],
columns[8] );
strlcpy( columns[6], massagedTimeStamp.ascii(), sizeof( columns[6] ) );
// see if there was a link in filename
QString file = filename;
QString name, link;
bool bLink = false;
int pos = file.find( " -> " );
if ( pos != -1 )
{
bLink = true;
name = file.left(pos);
link = file.right(file.length()-pos-4);
}
else
{
name = file;
}
QStringList list;
list.append( name );
for ( int i = 0; i < 7; i++ )
{
list.append( QString::fromLocal8Bit( columns[i] ) );
}
if ( bLink )
list.append( link );
else
list.append( "" );
m_gui->fileList()->addItem( list ); // send to GUI
return true;
}