本文整理汇总了C++中QCString::fill方法的典型用法代码示例。如果您正苦于以下问题:C++ QCString::fill方法的具体用法?C++ QCString::fill怎么用?C++ QCString::fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCString
的用法示例。
在下文中一共展示了QCString::fill方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visitPre
void ManDocVisitor::visitPre(DocAutoListItem *li)
{
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
if (!m_firstCol) m_t << endl;
m_t << ".IP \"" << ws;
if (((DocAutoList *)li->parent())->isEnumList())
{
m_t << li->itemNumber() << ".\" " << m_indent+2;
}
else // bullet list
{
m_t << "\\(bu\" " << m_indent;
}
m_t << endl;
m_firstCol=TRUE;
}
示例2: writeTemplateArgumentList
static void writeTemplateArgumentList(sqlite3* /*db*/,
ArgumentList * /*al*/,
Definition * /*scope*/,
FileDef * /*fileScope*/,
int /*indent*/)
{
#if 0
QCString indentStr;
indentStr.fill(' ',indent);
if (al)
{
t << indentStr << "<templateparamlist>" << endl;
ArgumentListIterator ali(*al);
Argument *a;
for (ali.toFirst();(a=ali.current());++ali)
{
t << indentStr << " <param>" << endl;
if (!a->type.isEmpty())
{
t << indentStr << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
t << "</type>" << endl;
}
if (!a->name.isEmpty())
{
t << indentStr << " <declname>" << a->name << "</declname>" << endl;
t << indentStr << " <defname>" << a->name << "</defname>" << endl;
}
if (!a->defval.isEmpty())
{
t << indentStr << " <defval>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
t << "</defval>" << endl;
}
t << indentStr << " </param>" << endl;
}
t << indentStr << "</templateparamlist>" << endl;
}
#endif
}
示例3: generateJSTree
static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
const QList<FTVNode> &nl,int level,bool &first)
{
static QCString htmlOutput = Config_getString("HTML_OUTPUT");
QCString indentStr;
indentStr.fill(' ',level*2);
bool found=FALSE;
QListIterator<FTVNode> nli(nl);
FTVNode *n;
for (nli.toFirst(); (n=nli.current()); ++nli)
{
// terminate previous entry
if (!first) t << "," << endl;
first=FALSE;
// start entry
if (!found)
{
t << "[" << endl;
}
found=TRUE;
if (n->addToNavIndex) // add entry to the navigation index
{
if (n->def && n->def->definitionType()==Definition::TypeFile)
{
FileDef *fd = (FileDef*)n->def;
bool doc,src;
doc = fileVisibleInIndex(fd,src);
if (doc)
{
navIndex.append(new NavIndexEntry(node2URL(n,TRUE,FALSE),pathToNode(n,n)));
}
if (src)
{
navIndex.append(new NavIndexEntry(node2URL(n,TRUE,TRUE),pathToNode(n,n)));
}
}
else
{
navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n)));
}
}
if (n->separateIndex) // store items in a separate file for dynamic loading
{
bool firstChild=TRUE;
t << indentStr << " [ ";
generateJSLink(t,n);
if (n->children.count()>0) // write children to separate file for dynamic loading
{
QCString fileId = n->file;
if (n->anchor)
{
fileId+="_"+n->anchor;
}
if (dupOfParent(n))
{
fileId+="_dup";
}
QFile f(htmlOutput+"/"+fileId+".js");
if (f.open(IO_WriteOnly))
{
FTextStream tt(&f);
tt << "var " << convertFileId2Var(fileId) << " =" << endl;
generateJSTree(navIndex,tt,n->children,1,firstChild);
tt << endl << "];";
}
t << "\"" << fileId << "\" ]";
}
else // no children
{
t << "null ]";
}
}
else // show items in this file
{
bool firstChild=TRUE;
t << indentStr << " [ ";
generateJSLink(t,n);
bool emptySection = !generateJSTree(navIndex,t,n->children,level+1,firstChild);
if (emptySection)
t << "null ]";
else
t << endl << indentStr << " ] ]";
}
}
return found;
}
示例4: indent
QCString DocSets::indent()
{
QCString result;
result.fill(' ',(m_dc+2)*2);
return result;
}
示例5: readCodeFragment
/*! Reads a fragment of code from file \a fileName starting at
* line \a startLine and ending at line \a endLine (inclusive). The fragment is
* stored in \a result. If FALSE is returned the code fragment could not be
* found.
*
* The file is scanned for a opening bracket ('{') from \a startLine onward
* The line actually containing the bracket is returned via startLine.
* The file is scanned for a closing bracket ('}') from \a endLine backward.
* The line actually containing the bracket is returned via endLine.
* Note that for VHDL code the bracket search is not done.
*/
static bool readCodeFragment(const char *fileName,
int &startLine,int &endLine,QCString &result)
{
static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
static bool filterSourceFiles = Config_getBool("FILTER_SOURCE_FILES");
//printf("readCodeFragment(%s,%d,%d)\n",fileName,startLine,endLine);
if (fileName==0 || fileName[0]==0) return FALSE; // not a valid file name
QCString filter = getFileFilter(fileName,TRUE);
FILE *f=0;
bool usePipe = !filter.isEmpty() && filterSourceFiles;
if (!usePipe) // no filter given or wanted
{
f = portable_fopen(fileName,"r");
}
else // use filter
{
QCString cmd=filter+" \""+fileName+"\"";
Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data());
f = portable_popen(cmd,"r");
}
bool found=vhdlOpt; // for VHDL no bracket search is possible
if (f)
{
int c=0;
int col=0;
int lineNr=1;
// skip until the startLine has reached
while (lineNr<startLine && !feof(f))
{
while ((c=fgetc(f))!='\n' && c!=EOF) /* skip */;
lineNr++;
}
if (!feof(f))
{
// skip until the opening bracket or lonely : is found
char cn=0;
while (lineNr<=endLine && !feof(f) && !found)
{
int pc=0;
while ((c=fgetc(f))!='{' && c!=':' && c!=EOF)
{
//printf("parsing char `%c'\n",c);
if (c=='\n')
{
lineNr++,col=0;
}
else if (c=='\t')
{
col+=Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE"));
}
else if (pc=='/' && c=='/') // skip single line comment
{
while ((c=fgetc(f))!='\n' && c!=EOF) pc=c;
if (c=='\n') lineNr++,col=0;
}
else if (pc=='/' && c=='*') // skip C style comment
{
while (((c=fgetc(f))!='/' || pc!='*') && c!=EOF)
{
if (c=='\n') lineNr++,col=0;
pc=c;
}
}
else
{
col++;
}
pc = c;
}
if (c==':')
{
cn=fgetc(f);
if (cn!=':') found=TRUE;
}
else if (c=='{')
{
found=TRUE;
}
}
//printf(" -> readCodeFragment(%s,%d,%d) lineNr=%d\n",fileName,startLine,endLine,lineNr);
if (found)
{
// For code with more than one line,
// fill the line with spaces until we are at the right column
// so that the opening brace lines up with the closing brace
if (endLine!=startLine)
{
QCString spaces;
spaces.fill(' ',col);
//.........这里部分代码省略.........