54 t <<
"% Bibliography\n"
60 t <<
"\\clearemptydoublepage\n";
63 t <<
"\\bibliographystyle{" << style <<
"}\n"
67 const char *bibdata = citeDataList.first();
70 QCString bibFile = bibdata;
72 if (!bibFile.isEmpty() && bibFile.right(4)!=
".bib") bibFile+=
".bib";
73 QFileInfo fi(bibFile);
76 if (!bibFile.isEmpty())
83 bibdata = citeDataList.next();
100 return label ?
m_entries.find(label) : 0;
111 return (citeBibFiles.count()==0 ||
m_entries.isEmpty());
124 QCString citeListFile = outputDir+
"/citelist.doc";
125 f.setName(citeListFile);
126 if (!f.open(IO_WriteOnly))
128 err(
"could not open file %s for writing\n",citeListFile.data());
131 t <<
"<!-- BEGIN CITATIONS -->" <<
endl;
135 for (it.toFirst();(ci=it.current());++it)
137 t <<
"\\citation{" << ci->
label <<
"}" <<
endl;
140 t <<
"<!-- END CITATIONS -->" <<
endl;
141 t <<
"<!-- BEGIN BIBLIOGRAPHY -->" <<
endl;
142 t <<
"<!-- END BIBLIOGRAPHY -->" <<
endl;
146 QCString bib2xhtmlFile = outputDir+
"/bib2xhtml.pl";
150 QCString doxygenBstFile = outputDir+
"/doxygen.bst";
158 QCString bibOutputDir = outputDir+
"/"+
bibTmpDir;
159 QCString bibOutputFiles =
"";
161 thisDir.mkdir(bibOutputDir);
162 const char *bibdata = citeDataList.first();
166 QCString bibFile = bibdata;
167 if (!bibFile.isEmpty() && bibFile.right(4)!=
".bib") bibFile+=
".bib";
168 QFileInfo fi(bibFile);
171 if (!bibFile.isEmpty())
175 bibOutputFiles = bibOutputFiles +
" " + bibTmpDir +
bibTmpFile + QCString().setNum(i) +
".bib";
178 else if (!fi.exists())
180 err(
"bib file %s not found!\n",bibFile.data());
182 bibdata = citeDataList.next();
185 QString oldDir = QDir::currentDirPath();
186 QDir::setCurrent(outputDir);
192 if ((exitCode=
portable_system(
"perl",
"\""+bib2xhtmlFile+
"\" "+bibOutputFiles+
" \""+
193 citeListFile+
"\"")) != 0)
195 err(
"Problems running bibtex. Verify that the command 'perl --version' works from the command line. Exit code: %d\n",
200 QDir::setCurrent(oldDir);
203 f.setName(citeListFile);
204 if (!f.open(IO_ReadOnly))
206 err(
"could not open file %s for reading\n",citeListFile.data());
208 bool insideBib=FALSE;
211 QFileInfo fi(citeListFile);
212 QCString input(fi.size()+1);
213 f.readBlock(input.rawData(),fi.size());
215 input.at(fi.size())=
'\0';
218 while ((s=input.find(
'\n',p))!=-1)
220 QCString line = input.mid(p,s-p);
224 if (line.find(
"<!-- BEGIN BIBLIOGRAPHY")!=-1) insideBib=TRUE;
225 else if (line.find(
"<!-- END BIBLIOGRAPH")!=-1) insideBib=FALSE;
226 else if (insideBib) doc+=line+
"\n";
229 if (insideBib && (i=line.find(
"name=\"CITEREF_"))!=-1)
231 int j=line.find(
"\">[");
232 int k=line.find(
"]</a>");
235 QCString label = line.mid(i+14,j-i-14);
236 QCString number = line.mid(j+2,k-j-1);
260 const char *bibdata = citeDataList.first();
263 QCString bibFile = bibdata;
265 if (!bibFile.isEmpty() && bibFile.right(4)!=
".bib") bibFile+=
".bib";
266 QFileInfo fi(bibFile);
269 if (!bibFile.isEmpty())
279 err(
"bib file %s not found!\n",bibFile.data());
281 bibdata = citeDataList.next();
286 thisDir.remove(citeListFile);
287 thisDir.remove(doxygenBstFile);
288 thisDir.remove(bib2xhtmlFile);
292 for (
unsigned int j = 1; j <= citeDataList.count(); j++)
294 thisDir.remove(bibOutputDir +
bibTmpFile + QCString().setNum(j) +
".bib");
296 thisDir.rmdir(bibOutputDir);