本文整理汇总了C++中QCString::mid方法的典型用法代码示例。如果您正苦于以下问题:C++ QCString::mid方法的具体用法?C++ QCString::mid怎么用?C++ QCString::mid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCString
的用法示例。
在下文中一共展示了QCString::mid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getKeys
KStringList KDEsuClient::getKeys(const QCString &group)
{
QCString cmd = "GETK ";
cmd += escape(group);
cmd += "\n";
QCString reply;
command(cmd, &reply);
int index = 0, pos;
KStringList list;
if(!reply.isEmpty())
{
// kdDebug(900) << "Found a matching entry: " << reply << endl;
while(1)
{
pos = reply.find('\007', index);
if(pos == -1)
{
if(index == 0)
list.append(reply);
else
list.append(reply.mid(index));
break;
}
else
{
list.append(reply.mid(index, pos - index));
}
index = pos + 1;
}
}
return list;
}
示例2: dcopForward
QCString SshProcess::dcopForward()
{
QCString result;
setDcopTransport("tcp");
QCString srv = StubProcess::dcopServer();
if(srv.isEmpty())
return result;
int i = srv.find('/');
if(i == -1)
return result;
if(srv.left(i) != "tcp")
return result;
int j = srv.find(':', ++i);
if(j == -1)
return result;
QCString host = srv.mid(i, j - i);
bool ok;
int port = srv.mid(++j).toInt(&ok);
if(!ok)
return result;
m_dcopPort = 10000 + (int)((40000.0 * rand()) / (1.0 + RAND_MAX));
result.sprintf("%d:%s:%d", m_dcopPort, host.data(), port);
return result;
}
示例3: 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;
}
}
示例4: CommentData
CommentData(const QCString & f, const int l, const QCString & t) :
isJavaStyle(false),
isQtStyle(false),
line(l),
fileName(f)
{
isJavaStyle = t.length()>0 && t.at(0)=='*';
isQtStyle = t.length()>0 && t.at(0)=='!';
shouldIgnore = (!isJavaStyle && !isQtStyle);
associateWithPrevious = (t.length()>1 && t.at(1)=='<');
if (associateWithPrevious)
{ text = t.mid(2); }
else
{ text = t.mid(1); }
}
示例5: replace_alias
void UmlItem::replace_alias(QCString & s) {
int index = 0;
while ((index = s.find("@{", index)) != -1) {
int index2 = s.find('}', index + 2);
if (index2 == -1)
return;
UmlBaseItem * obj = this;
QCString key = s.mid(index + 2, index2 - index - 2);
QCString value;
for (;;) {
if (obj->propertyValue(key, value)) {
s.replace(index, index2 - index + 1, value);
index += value.length();
break;
}
else if ((obj = obj->parent()) == 0) {
index = index2 + 1;
break;
}
}
}
}
示例6: substitute
static QCString convertFileId2Var(const QCString &fileId)
{
QCString varId = fileId;
int i=varId.findRev('/');
if (i>=0) varId = varId.mid(i+1);
return substitute(varId,"-","_");
}
示例7: init
void DefinitionImpl::init(const char *df,int dl,
const char *n)
{
defFileName = df;
int lastDot = defFileName.findRev('.');
if (lastDot!=-1)
{
defFileExt = defFileName.mid(lastDot);
}
defLine = dl;
QCString name = n;
if (name!="<globalScope>")
{
//extractNamespaceName(m_name,m_localName,ns);
localName=stripScope(n);
}
else
{
localName=n;
}
//printf("m_localName=%s\n",m_localName.data());
brief = 0;
details = 0;
body = 0;
inbodyDocs = 0;
sourceRefByDict = 0;
sourceRefsDict = 0;
sectionDict = 0,
outerScope = Doxygen::globalScope;
partOfGroups = 0;
xrefListItems = 0;
hidden = FALSE;
isArtificial = FALSE;
}
示例8: makeInlineDoc
void makeInlineDoc(int endCode)
{
int len=endCode-iCodeLen;
QCString par=inputString.mid(iCodeLen,len);
//fprintf(stderr,"\n inline code: \n<%s>",par.data());
gBlock.doc=par;
gBlock.inbodyDocs=par;
gBlock.section=Entry::VARIABLE_SEC;
gBlock.spec=VhdlDocGen::MISCELLANEOUS;
gBlock.fileName = yyFileName;
gBlock.endBodyLine=yyLineNr-1;
gBlock.lang=SrcLangExt_VHDL;
Entry *temp=new Entry(gBlock);
Entry* compound=getVhdlCompound();
if (compound)
{
compound->addSubEntry(temp);
}
else
{
temp->type="misc"; // global code like library ieee...
VhdlParser::current_root->addSubEntry(temp);
}
strComment.resize(0);
gBlock.reset();
}// makeInlineDoc
示例9: command
int KDEsuClient::command(const QCString &cmd, QCString *result)
{
if(sockfd < 0)
return -1;
if(send(sockfd, cmd, cmd.length(), 0) != (int)cmd.length())
return -1;
char buf[1024];
int nbytes = recv(sockfd, buf, 1023, 0);
if(nbytes <= 0)
{
kdWarning(900) << k_lineinfo << "no reply from daemon\n";
return -1;
}
buf[nbytes] = '\000';
QCString reply = buf;
if(reply.left(2) != "OK")
return -1;
if(result)
*result = reply.mid(3, reply.length() - 4);
return 0;
}
示例10: visit
void HtmlDocVisitor::visit(DocURL *u)
{
if (m_hide) return;
if (u->isEmail()) // mail address
{
QCString url = u->url();
writeObfuscatedMailAddress(url);
uint size=5,i;
for (i=0;i<url.length();)
{
filter(url.mid(i,size));
if (i<url.length()-size) m_t << "<span style=\"display: none;\">[email protected]</span>";
i+=size;
if (size==5) size=4; else size=5;
}
m_t << "</a>";
}
else // web address
{
m_t << "<a href=\"";
m_t << u->url() << "\">";
filter(u->url());
m_t << "</a>";
}
}
示例11: linkInclude
void ClangParser::linkInclude(CodeOutputInterface &ol,FileDef *fd,
uint &line,uint &column,const char *text)
{
QCString incName = text;
incName = incName.mid(1,incName.length()-2); // strip ".." or <..>
FileDef *ifd=0;
if (!incName.isEmpty())
{
FileName *fn = Doxygen::inputNameDict->find(incName);
if (fn)
{
bool found=false;
FileNameIterator fni(*fn);
// for each include name
for (fni.toFirst();!found && (ifd=fni.current());++fni)
{
// see if this source file actually includes the file
found = fd->isIncluded(ifd->absFilePath());
//printf(" include file %s found=%d\n",ifd->absFilePath().data(),found);
}
}
}
if (ifd)
{
ol.writeCodeLink(ifd->getReference(),ifd->getOutputFileBase(),0,text,ifd->briefDescriptionAsTooltip());
}
else
{
codifyLines(ol,ifd,text,line,column,"preprocessor");
}
}
示例12: getExtension
static QCString getExtension()
{
/*
* [.][nuber][rest]
* in case of . missing, just ignore it
* in case number missing, just place a 3 in front of it
*/
QCString ext = Config_getString("MAN_EXTENSION");
if (ext.isEmpty())
{
ext = "3";
}
else
{
if (ext.at(0)=='.')
{
if (ext.length()==1)
{
ext = "3";
}
else // strip .
{
ext = ext.mid(1);
}
}
if (ext.at(0)<'0' || ext.at(0)>'9')
{
ext.prepend("3");
}
}
return ext;
}
示例13: getListOfBibFiles
static QCString getListOfBibFiles(const QCString &sep,bool stripExtension)
{
QCString result;
QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
const char *bibdata = citeDataList.first();
while (bibdata)
{
int i;
QCString bibFile = bibdata;
if (stripExtension && bibFile.right(4)==".bib")
{
bibFile = bibFile.left(bibFile.length()-4);
}
if (stripExtension && (i=bibFile.findRev('/'))!=-1)
{
bibFile = bibFile.mid(i+1);
}
if (!bibFile.isEmpty())
{
result+=bibFile;
bibdata = citeDataList.next();
if (bibdata)
{
result+=sep;
}
}
else
{
bibdata = citeDataList.next();
}
}
return result;
}
示例14: messageToInfo
qCopInfo ButtonUtils::messageToInfo ( const OQCopMessage &c )
{
QCString ch = c.channel();
QCString f = c.message();
if ( ch == "ignore" )
return qCopInfo ( qApp->translate ( "ButtonSettings", "<nobr>Ignored</nobr>" ));
for ( const predef_qcop *p = predef; p->m_text; p++ ) {
if (( ch == p->m_channel ) && ( f == p->m_function )) {
return qCopInfo ( qApp->translate ( "ButtonSettings", p->m_text ),
Opie::Core::OResource::loadPixmap( p->m_pixmap, Opie::Core::OResource::SmallIcon ) );
}
}
if ( ch.left ( 16 ) == "QPE/Application/" ) {
QString app = ch.mid ( 16 );
const AppLnk *applnk = m_apps->findExec ( app );
if ( applnk )
app = applnk->name();
if (( f == "raise()" ) || ( f == "nextView()" ))
return qCopInfo ( qApp->translate ( "ButtonSettings", "<nobr>Show <b>%1</b></nobr>" ).arg ( app ), applnk ? applnk->pixmap() : QPixmap());
else
return qCopInfo ( qApp->translate ( "ButtonSettings", "<nobr>Call <b>%1</b>: <i>%2</i></nobr>" ).arg ( app ).arg ( f ), applnk ? applnk->pixmap() : QPixmap());
}
else {
return qCopInfo ( qApp->translate ( "ButtonSettings", "<nobr>Call <b>%1</b> <i>%2</i></nobr>" ).arg (( ch.left ( 4 ) == "QPE/" ) ? ch.mid ( 4 ) : ch ).arg ( f ));
}
}
示例15: write_multiplicity
void UmlItem::write_multiplicity(FileOut & out, QCString s, UmlItem * who)
{
if (!s.isEmpty()) {
QCString min;
QCString max;
int index = s.find("..");
if (index != -1) {
min = s.left(index).stripWhiteSpace();
max = s.mid(index+2).stripWhiteSpace();
}
else
min = max = s.stripWhiteSpace();
out.indent();
out << "<lowerValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_L_");
out << " value=\"" << min << "\"/>\n";
out.indent();
out << "<upperValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_U_");
out << " value=\"" << max << "\"/>\n";
}
}