VERY brittle routine inline RTF's included by other RTF's. it is recursive and ugly.
2369 err(
"problems opening rtf file %s for reading\n",infName.
data());
2373 const int maxLineLength = 10240;
2374 static QCString lineBuf(maxLineLength);
2383 lineBuf.resize(maxLineLength);
2384 if ((len=
f.readLine(lineBuf.rawData(),maxLineLength))==-1)
2386 err(
"read error in %s before end of RTF header!\n",infName.
data());
2389 lineBuf.resize(len+1);
2390 if (lineBuf.find(
"\\comment begin body")!=-1)
break;
2395 lineBuf.resize(maxLineLength);
2396 while ((len=
f.readLine(lineBuf.rawData(),maxLineLength))!=-1)
2398 lineBuf.resize(len+1);
2400 if ((pos=lineBuf.find(
"INCLUDETEXT"))!=-1)
2402 int startNamePos = lineBuf.find(
'"',pos)+1;
2403 int endNamePos = lineBuf.find(
'"',startNamePos);
2405 DBG_RTF(t <<
"{\\comment begin include " << fileName <<
"}" <<
endl)
2409 else // no INCLUDETEXT on this line 2411 // elaborate hoopla to skip the final "}
" if we didn't include the 2413 if (!f.atEnd() || bIncludeHeader) 2415 encodeForOutput(t,lineBuf); 2417 else // last line of included file 2419 // null terminate at the last '}' 2420 //char *str = strrchr(buffer,'}'); 2421 int pos = lineBuf.findRev('}'); 2424 lineBuf.at(pos) = '\0'; 2426 err("Strange, the last
char was not
a '}'\n"); 2427 encodeForOutput(t,lineBuf); 2430 lineBuf.resize(maxLineLength); 2433 // remove temporary file
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
static void encodeForOutput(FTextStream &t, const char *s)
const char * data() const
void include(std::istream &in, std::string &result)
void err(const char *fmt,...)
The QFile class is an I/O device that operates on files.
static bool preProcessFile(QDir &d, QCString &infName, FTextStream &t, bool bIncludeHeader=TRUE)
QTextStream & endl(QTextStream &s)