本文整理汇总了C++中QCString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ QCString::length方法的具体用法?C++ QCString::length怎么用?C++ QCString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCString
的用法示例。
在下文中一共展示了QCString::length方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visitPre
void LatexDocVisitor::visitPre(DocImage *img)
{
if (img->type()==DocImage::Latex)
{
if (m_hide) return;
QCString gfxName = img->name();
if (gfxName.right(4)==".eps" || gfxName.right(4)==".pdf")
{
gfxName=gfxName.left(gfxName.length()-4);
}
visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height());
}
else // other format -> skip
{
pushEnabled();
m_hide=TRUE;
}
}
示例2: writeToken
void DocSets::writeToken(FTextStream &t,
const Definition *d,
const QCString &type,
const QCString &lang,
const char *scope,
const char *anchor,
const char *decl)
{
t << " <Token>" << endl;
t << " <TokenIdentifier>" << endl;
QCString name = d->name();
if (name.right(2)=="-p") name=name.left(name.length()-2);
t << " <Name>" << convertToXML(name) << "</Name>" << endl;
if (!lang.isEmpty())
{
t << " <APILanguage>" << lang << "</APILanguage>" << endl;
}
if (!type.isEmpty())
{
t << " <Type>" << type << "</Type>" << endl;
}
if (scope)
{
t << " <Scope>" << convertToXML(scope) << "</Scope>" << endl;
}
t << " </TokenIdentifier>" << endl;
t << " <Path>" << d->getOutputFileBase()
<< Doxygen::htmlFileExtension << "</Path>" << endl;
if (anchor)
{
t << " <Anchor>" << anchor << "</Anchor>" << endl;
}
QCString tooltip = d->briefDescriptionAsTooltip();
if (!tooltip.isEmpty())
{
t << " <Abstract>" << convertToXML(tooltip) << "</Abstract>" << endl;
}
if (decl)
{
t << " <DeclaredIn>" << convertToXML(decl) << "</DeclaredIn>" << endl;
}
t << " </Token>" << endl;
}
示例3: decodeEndLine
QCString MIMECodec::decodeEndLine(const QCString &str)
{
int size = str.length();
const char *data = str.data();
QCString buffer(size);
char *buf = buffer.data();
int index = 0;
for (int i = 0; i < size; i++) {
char c = data[i];
if (c != '\r') {
buf[index++] = c;
}
}
buffer.truncate(index);
return buffer;
}
示例4: parseDoc
void OutputList::parseDoc(const char *fileName,int startLine,
Definition *ctx,MemberDef * md,
const QCString &docStr,bool indexWords,
bool isExample,const char *exampleName,
bool singleLine,bool linkFromIndex)
{
int count=0;
if (docStr.isEmpty()) return;
OutputGenerator *og=outputs->first();
while (og)
{
if (og->isEnabled()) count++;
og=outputs->next();
}
if (count==0) return; // no output formats enabled.
DocNode *root=0;
if (docStr.at(docStr.length()-1)=='\n')
{
root = validatingParseDoc(fileName,startLine,
ctx,md,docStr,indexWords,isExample,exampleName,
singleLine,linkFromIndex);
}
else
{
root = validatingParseDoc(fileName,startLine,
ctx,md,docStr+"\n",indexWords,isExample,exampleName,
singleLine,linkFromIndex);
}
og=outputs->first();
while (og)
{
//printf("og->printDoc(extension=%s)\n",
// ctx?ctx->getDefFileExtension().data():"<null>");
if (og->isEnabled()) og->printDoc(root,ctx?ctx->getDefFileExtension():QCString(""));
og=outputs->next();
}
delete root;
}
示例5:
/*! convert path name into the url in the hypertext generated by htags.
* \param path path name
* \returns URL NULL: not found.
*/
QCString Htags::path2URL(const QCString &path)
{
QCString url,symName=path;
QCString dir = g_inputDir.absPath().utf8();
int dl=dir.length();
if ((int)symName.length()>dl+1)
{
symName = symName.mid(dl+1);
}
if (!symName.isEmpty())
{
QCString *result = g_symbolDict[symName];
//printf("path2URL=%s symName=%s result=%p\n",path.data(),symName.data(),result);
if (result)
{
url = "HTML/" + *result;
}
}
return url;
}
示例6: save
void MonitorWindow::save()
{
QString s = QFileDialog::getSaveFileName ("sim.log", QString::null, this);
if (s.isEmpty()) return;
QFile f(s);
if (!f.open(IO_WriteOnly)){
QMessageBox::warning(this, i18n("Error"), i18n("Can't create file %1") .arg(s));
return;
}
QCString t;
if (edit->hasSelectedText()){
t = unquoteText(edit->selectedText()).local8Bit();
}else{
t = unquoteText(edit->text()).local8Bit();
}
#if defined(WIN32) || defined(__OS2__)
t.replace(QRegExp("\n"),"\r\n");
#endif
f.writeBlock(t, t.length());
}
示例7: value_of
QCString value_of(QCString s, QCString k, int & index,
QCString & next, int & index2)
{
QCString result;
index = s.find(k, index);
if (index != -1) {
index += k.length();
result = get_next_word(s, index, index2);
if (! result.isEmpty()) {
int index3;
next = get_next_word(s, index2, index3);
}
}
return result;
}
示例8: sendCutEvent
void KRFBDecoder::sendCutEvent( const QString &unicode )
{
//
// Warning: There is a bug in the RFB protocol because there is no way to find
// out the codepage in use on the remote machine. This could be fixed by requiring
// the remote server to use utf8 etc. but for now we have to assume they're the
// same. I've reported this problem to the ORL guys, but they apparantly have no
// immediate plans to fix the issue. :-( (rich)
//
CARD8 padding[3];
QCString text = unicode.local8Bit();
CARD32 length = text.length();
length = Swap32IfLE( length );
con->write( &ClientCutTextId, 1 );
con->write( &padding, 3 );
con->write( &length, 4 );
con->write( text.data(), length );
}
示例9: saveAll
void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, QFile *file )
{
VCardEntity vcards;
VCardList vcardlist;
vcardlist.setAutoDelete( true );
AddressBook::Iterator it;
for ( it = ab->begin(); it != ab->end(); ++it ) {
if ( (*it).resource() == resource ) {
VCARD::VCard *v = new VCARD::VCard;
saveAddressee( (*it), v, false );
(*it).setChanged( false );
vcardlist.append( v );
}
}
vcards.setCardList( vcardlist );
QCString vcardData = vcards.asString();
file->writeBlock( (const char*)vcardData, vcardData.length() );
}
示例10: addTooltip
void TooltipManager::addTooltip(Definition *d)
{
static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
if (!sourceTooltips) return;
QCString id = d->getOutputFileBase();
int i=id.findRev('/');
if (i!=-1)
{
id = id.right(id.length()-i-1); // strip path (for CREATE_SUBDIRS=YES)
}
id+=escapeId(Doxygen::htmlFileExtension);
QCString anc = d->anchor();
if (!anc.isEmpty())
{
id+="_"+anc;
}
if (p->tooltipInfo.find(id)==0)
{
p->tooltipInfo.insert(id,d);
}
}
示例11: evilBytes
static QString evilBytes( const QCString& str, bool utf8 )
{
if ( utf8 )
{
return protect( str );
}
else
{
QString result;
QCString t = protect( str ).latin1();
int len = ( int ) t.length();
for ( int k = 0; k < len; k++ )
{
if ( ( uchar ) t[k] >= 0x7f )
result += numericEntity( ( uchar ) t[k] );
else
result += QChar( t[k] );
}
return result;
}
}
示例12: recode
QCString HtmlHelp::recode(const QCString &s)
{
int iSize = s.length();
int oSize = iSize*4+1;
QCString output(oSize);
size_t iLeft = iSize;
size_t oLeft = oSize;
const char *iPtr = s.data();
char *oPtr = output.data();
if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
{
oSize -= oLeft;
output.resize(oSize+1);
output.at(oSize)='\0';
return output;
}
else
{
return s;
}
}
示例13: replaceSelection
void cTextField::replaceSelection(const QCString &replacement) {
// Delete the selection, reposition caret_, then reinsert
if (selection_ != 0) {
if (selection_ < 0) {
setCaret(caret_ + selection_); // Place the caret at the start of the selection
selection_ = - selection_;
}
for (int i = 0; i < selection_ && caret_ < text_.length(); ++i) {
text_.remove(caret_, 1);
}
selection_ = 0;
invalidateText();
}
// Insert text at the caret
int i;
for (i = 0; i < (int)replacement.length() && text_.length() + 1 <= maxLength_; ++i) {
text_.insert(caret_ + i, replacement.at(i));
}
setCaret(caret_ + i);
}
示例14: _docsAlreadyAdded
bool Definition::_docsAlreadyAdded(const QCString &doc,QCString &sigList)
{
uchar md5_sig[16];
QCString sigStr(33);
// to avoid mismatches due to differences in indenting, we first remove
// double whitespaces...
QCString docStr = doc.simplifyWhiteSpace();
MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
MD5SigToString(md5_sig,sigStr.rawData(),33);
//printf("%s:_docsAlreadyAdded doc='%s' sig='%s' docSigs='%s'\n",
// name().data(),doc.data(),sigStr.data(),sigList.data());
if (sigList.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
{
sigList+=":"+sigStr;
return FALSE;
}
else
{
return TRUE;
}
}
示例15: label
QCString DiagramItem::label() const
{
QCString result;
if (!templSpec.isEmpty())
{
// we use classDef->name() here and not diplayName() in order
// to get the name used in the inheritance relation.
QCString n = classDef->name();
if (/*n.right(2)=="-g" ||*/ n.right(2)=="-p")
{
n = n.left(n.length()-2);
}
result=insertTemplateSpecifierInScope(n,templSpec);
}
else
{
result=classDef->displayName();
}
if (Config_getBool("HIDE_SCOPE_NAMES")) result=stripScope(result);
return result;
}