27 #include "qtextcodec.h"
61 return qstricmp(item1->
name,item2->
name);
73 void addItem(
const char *first,
const char *second,
74 const char *url,
const char *anchor,
75 bool hasLink,
bool reversed);
109 const char *url,
const char *anchor,
bool hasLink,
112 QCString key = level1;
113 if (level2) key+= (QCString)
"?" + level2;
114 if (key.find(QRegExp(
"@[0-9]+"))!=-1)
175 bool level2Started=FALSE;
176 for (;(f=ifli.current());++ifli)
178 QCString level1,level2;
180 if ((i=f->
name.find(
'?'))!=-1)
182 level1 = f->
name.left(i);
183 level2 = f->
name.right(f->
name.length()-i-1);
187 level1 = f->
name.copy();
190 if (level1!=lastLevel1)
192 if (level2Started) t <<
" </UL>" <<
endl;
206 nextLevel1 = fnext->
name.left(fnext->
name.find(
'?'));
209 if (level1 != nextLevel1)
215 if (level2.isEmpty())
217 t <<
" <LI><OBJECT type=\"text/sitemap\">";
218 t <<
"<param name=\"Local\" value=\"" <<
field2URL(f,FALSE);
220 t <<
"<param name=\"Name\" value=\"" <<
m_help->
recode(level1) <<
"\">"
227 t <<
" <LI><OBJECT type=\"text/sitemap\">";
228 t <<
"<param name=\"Local\" value=\"" <<
field2URL(f,TRUE);
230 t <<
"<param name=\"Name\" value=\"" <<
m_help->
recode(level1) <<
"\">"
235 t <<
" <LI><OBJECT type=\"text/sitemap\">";
236 t <<
"<param name=\"See Also\" value=\"" <<
m_help->
recode(level1) <<
"\">";
237 t <<
"<param name=\"Name\" value=\"" <<
m_help->
recode(level1) <<
"\">"
242 if (!level2Started && !level2.isEmpty())
244 t <<
" <UL>" <<
endl;
247 else if (level2Started && level2.isEmpty())
249 t <<
" </UL>" <<
endl;
254 t <<
" <LI><OBJECT type=\"text/sitemap\">";
255 t <<
"<param name=\"Local\" value=\"" <<
field2URL(f,FALSE);
257 t <<
"<param name=\"Name\" value=\"" <<
m_help->
recode(level2) <<
"\">"
260 lastLevel1 = level1.copy();
262 if (level2Started) t <<
" </UL>" <<
endl;
307 if (!str) str =
"CP1250";
311 err(
"unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", str);
317 cf =
new QFile(fName);
318 if (!
cf->open(IO_WriteOnly))
320 err(
"Could not open file %s for writing\n",fName.data());
325 cts <<
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
326 "<HTML><HEAD></HEAD><BODY>\n"
327 "<OBJECT type=\"text/site properties\">\n"
328 "<param name=\"FrameName\" value=\"right\">\n"
334 kf =
new QFile(fName);
335 if (!
kf->open(IO_WriteOnly))
337 err(
"Could not open file %s for writing\n",fName.data());
342 kts <<
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
343 "<HTML><HEAD></HEAD><BODY>\n"
344 "<OBJECT type=\"text/site properties\">\n"
345 "<param name=\"FrameName\" value=\"right\">\n"
399 s_languageDict.setAutoDelete(TRUE);
400 s_languageDict.clear();
401 s_languageDict.insert(
"czech",
new QCString(
"0x405 Czech"));
402 s_languageDict.insert(
"danish",
new QCString(
"0x406 Danish"));
403 s_languageDict.insert(
"dutch",
new QCString(
"0x413 Dutch"));
404 s_languageDict.insert(
"finnish",
new QCString(
"0x40B Finnish"));
405 s_languageDict.insert(
"french",
new QCString(
"0x40C French"));
406 s_languageDict.insert(
"german",
new QCString(
"0x407 German"));
407 s_languageDict.insert(
"greek",
new QCString(
"0x408 Greece"));
408 s_languageDict.insert(
"hungarian",
new QCString(
"0x40E Hungarian"));
409 s_languageDict.insert(
"italian",
new QCString(
"0x410 Italian"));
410 s_languageDict.insert(
"norwegian",
new QCString(
"0x814 Norwegian"));
411 s_languageDict.insert(
"polish",
new QCString(
"0x415 Polish"));
412 s_languageDict.insert(
"portuguese",
new QCString(
"0x816 Portuguese(Portugal)"));
413 s_languageDict.insert(
"brazilian",
new QCString(
"0x416 Portuguese(Brazil)"));
414 s_languageDict.insert(
"russian",
new QCString(
"0x419 Russian"));
415 s_languageDict.insert(
"spanish",
new QCString(
"0x40A Spanish(Traditional Sort)"));
416 s_languageDict.insert(
"swedish",
new QCString(
"0x41D Swedish"));
417 s_languageDict.insert(
"turkish",
new QCString(
"0x41F Turkey"));
418 s_languageDict.insert(
"japanese",
new QCString(
"0x411 Japanese"));
419 s_languageDict.insert(
"japanese-en",
new QCString(
"0x411 Japanese"));
420 s_languageDict.insert(
"korean",
new QCString(
"0x412 Korean"));
421 s_languageDict.insert(
"korean-en",
new QCString(
"0x412 Korean"));
422 s_languageDict.insert(
"chinese",
new QCString(
"0x804 Chinese (PRC)"));
423 s_languageDict.insert(
"chinese-traditional",
new QCString(
"0x404 Chinese (Taiwan)"));
426 s_languageDict.insert(
"indonesian",
new QCString(
"0x412 Indonesian"));
427 s_languageDict.insert(
"croatian",
new QCString(
"0x41A Croatian"));
428 s_languageDict.insert(
"romanian",
new QCString(
"0x418 Romanian"));
429 s_languageDict.insert(
"slovene",
new QCString(
"0x424 Slovenian"));
430 s_languageDict.insert(
"slovak",
new QCString(
"0x41B Slovak"));
431 s_languageDict.insert(
"ukrainian",
new QCString(
"0x422 Ukrainian"));
432 s_languageDict.insert(
"serbian",
new QCString(
"0x81A Serbian (Serbia, Latin)"));
433 s_languageDict.insert(
"catalan",
new QCString(
"0x403 Catalan"));
434 s_languageDict.insert(
"lithuanian",
new QCString(
"0x427 Lithuanian"));
435 s_languageDict.insert(
"afrikaans",
new QCString(
"0x436 Afrikaans"));
436 s_languageDict.insert(
"vietnamese",
new QCString(
"0x42A Vietnamese"));
437 s_languageDict.insert(
"persian",
new QCString(
"0x429 Persian (Iran)"));
438 s_languageDict.insert(
"arabic",
new QCString(
"0xC01 Arabic (Egypt)"));
439 s_languageDict.insert(
"latvian",
new QCString(
"0x426 Latvian"));
440 s_languageDict.insert(
"macedonian",
new QCString(
"0x042f Macedonian (Former Yugoslav Republic of Macedonia)"));
441 s_languageDict.insert(
"armenian",
new QCString(
"0x42b Armenian"));
446 s_languageDict.insert(
"serbian-cyrillic",
new QCString(
"0xC1A Serbian (Serbia, Cyrillic)"));
461 return "0x409 English (United States)";
471 if (f.open(IO_WriteOnly))
481 t <<
"Compatibility=1.1\n"
482 "Full-text search=Yes\n"
483 "Contents file=index.hhc\n"
484 "Default Window=main\n"
485 "Default topic=" << indexName <<
"\n"
486 "Index file=index.hhk\n"
492 t <<
"[WINDOWS]" <<
endl;
507 "\"index.hhk\",\"" << indexName <<
"\",\"" <<
508 indexName <<
"\",,,,,0x23520,,0x70387e,,,,,,,,0" << endl <<
endl;
513 "\"index.hhk\",\"" << indexName <<
"\",\"" <<
514 indexName <<
"\",,,,,0x23520,,0x10387e,,,,,,,,0" << endl <<
endl;
517 t <<
"[FILES]" <<
endl;
533 err(
"Could not open file %s for writing\n",fName.data());
571 s_languageDict.clear();
580 int i;
for (i=0;i<
dc+1;i++)
cts <<
" ";
591 int i;
for (i=0;i<
dc;i++)
cts <<
" ";
598 int iSize = s.length();
599 int oSize = iSize*4+1;
600 QCString output(oSize);
601 size_t iLeft = iSize;
602 size_t oLeft = oSize;
603 char *iPtr = s.rawData();
604 char *oPtr = output.rawData();
608 output.resize(oSize+1);
609 output.at(oSize)=
'\0';
646 int i;
for (i=0;i<
dc;i++)
cts <<
" ";
647 cts <<
"<LI><OBJECT type=\"text/sitemap\">";
651 if (file && (file[0]==
'!' || file[0]==
'^'))
653 cts <<
"<param name=\"";
654 if (file[0]==
'^')
cts <<
"URL";
else cts <<
"Local";
655 cts <<
"\" value=\"";
660 cts <<
"<param name=\"Local\" value=\"";
662 if (anchor)
cts <<
"#" << anchor;
666 cts <<
"<param name=\"ImageNumber\" value=\"";
676 cts <<
"</OBJECT>\n";
681 const char *sectionAnchor,
const char *word)
685 static bool separateMemberPages =
Config_getBool(SEPARATE_MEMBER_PAGES);
693 if (context==0)
return;
697 QCString level1 = context->
name();
698 QCString level2 = md->
name();
699 QCString contRef = separateMemberPages ? cfname : cfiname;
700 QCString memRef = cfname;
701 QCString anchor = sectionAnchor ? QCString(sectionAnchor) : md->
anchor();
702 index->
addItem(level1,level2,contRef,anchor,TRUE,FALSE);
707 QCString level1 = word ? QCString(word) : context->
name();