Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
HtmlHelp Class Reference

#include <htmlhelp.h>

Inheritance diagram for HtmlHelp:
IndexIntf

Public Member Functions

 HtmlHelp ()
 
 ~HtmlHelp ()
 
void initialize ()
 
void finalize ()
 
void incContentsDepth ()
 
void decContentsDepth ()
 
void addContentsItem (bool isDir, const char *name, const char *ref, const char *file, const char *anchor, bool separateIndex, bool addToNavIndex, Definition *def)
 
void addIndexItem (Definition *context, MemberDef *md, const char *sectionAnchor, const char *title)
 
void addIndexFile (const char *name)
 
void addImageFile (const char *)
 
void addStyleSheetFile (const char *)
 
- Public Member Functions inherited from IndexIntf
virtual ~IndexIntf ()
 

Private Types

enum  ImageNumber {
  BOOK_CLOSED =1, BOOK_OPEN, BOOK_CLOSED_NEW, BOOK_OPEN_NEW,
  FOLDER_CLOSED, FOLDER_OPEN, FOLDER_CLOSED_NEW, FOLDER_OPEN_NEW,
  QUERY, QUERY_NEW, TEXT, TEXT_NEW,
  WEB_DOC, WEB_DOC_NEW, WEB_LINK, WEB_LINK_NEW,
  INFO, INFO_NEW, LINK, LINK_NEW,
  BOOKLET, BOOKLET_NEW, EMAIL, EMAIL_NEW,
  EMAIL2, EMAIL2_NEW, IMAGE, IMAGE_NEW,
  AUDIO, AUDIO_NEW, MUSIC, MUSIC_NEW,
  VIDEO, VIDEO_NEW, INDEX, INDEX_NEW,
  IDEA, IDEA_NEW, NOTE, NOTE_NEW,
  TOOL, TOOL_NEW
}
 

Private Member Functions

void createProjectFile ()
 
QCString recode (const QCString &s)
 

Private Attributes

QFilecf
 
QFilekf
 
FTextStream cts
 
FTextStream kts
 
HtmlHelpIndexindex
 
int dc
 
QStrList indexFiles
 
QStrList imageFiles
 
QDict< void > indexFileDict
 
void * m_fromUtf8
 

Static Private Attributes

static HtmlHelptheInstance = 0
 

Friends

class HtmlHelpIndex
 

Detailed Description

A class that generated the HTML Help specific files.

These files can be used with the Microsoft HTML Help workshop to generate compressed HTML files (.chm).

Definition at line 38 of file htmlhelp.h.

Member Enumeration Documentation

enum HtmlHelp::ImageNumber
private

used in imageNumber param of HTMLHelp::addContentsItem() function to specify document icon in tree view. Writes <param name="ImageNumber" value="xx"> in .HHC file.

Enumerator
BOOK_CLOSED 
BOOK_OPEN 
BOOK_CLOSED_NEW 
BOOK_OPEN_NEW 
FOLDER_CLOSED 
FOLDER_OPEN 
FOLDER_CLOSED_NEW 
FOLDER_OPEN_NEW 
QUERY 
QUERY_NEW 
TEXT 
TEXT_NEW 
WEB_DOC 
WEB_DOC_NEW 
WEB_LINK 
WEB_LINK_NEW 
INFO 
INFO_NEW 
LINK 
LINK_NEW 
BOOKLET 
BOOKLET_NEW 
EMAIL 
EMAIL_NEW 
EMAIL2 
EMAIL2_NEW 
IMAGE 
IMAGE_NEW 
AUDIO 
AUDIO_NEW 
MUSIC 
MUSIC_NEW 
VIDEO 
VIDEO_NEW 
INDEX 
INDEX_NEW 
IDEA 
IDEA_NEW 
NOTE 
NOTE_NEW 
TOOL 
TOOL_NEW 

Definition at line 43 of file htmlhelp.h.

43  {
49  TEXT, TEXT_NEW,
52  INFO, INFO_NEW,
53  LINK, LINK_NEW,
62  IDEA, IDEA_NEW,
63  NOTE, NOTE_NEW,
64  TOOL, TOOL_NEW
65  };

Constructor & Destructor Documentation

HtmlHelp::HtmlHelp ( )

Constructs an html object. The object has to be initialized before it can be used.

Definition at line 272 of file htmlhelp.cpp.

272  : indexFileDict(1009)
273 {
274  /* initial depth */
275  dc = 0;
276  cf = kf = 0;
277  index = new HtmlHelpIndex(this);
278  m_fromUtf8 = (void *)(-1);
279 }
QDict< void > indexFileDict
Definition: htmlhelp.h:98
void * m_fromUtf8
Definition: htmlhelp.h:101
QFile * cf
Definition: htmlhelp.h:92
QFile * kf
Definition: htmlhelp.h:92
HtmlHelpIndex * index
Definition: htmlhelp.h:94
int dc
Definition: htmlhelp.h:95
friend class HtmlHelpIndex
Definition: htmlhelp.h:89
HtmlHelp::~HtmlHelp ( )

Definition at line 281 of file htmlhelp.cpp.

282 {
283  if (m_fromUtf8!=(void *)(-1)) portable_iconv_close(m_fromUtf8);
284  delete index;
285 }
int portable_iconv_close(void *cd)
Definition: portable_c.c:30
void * m_fromUtf8
Definition: htmlhelp.h:101
HtmlHelpIndex * index
Definition: htmlhelp.h:94

Member Function Documentation

void HtmlHelp::addContentsItem ( bool  isDir,
const char *  name,
const char *  ref,
const char *  file,
const char *  anchor,
bool  separateIndex,
bool  addToNavIndex,
Definition def 
)
virtual

Add an list item to the contents file.

Parameters
isDirboolean indicating if this is a dir or file entry
namethe name of the item.
refthe URL of to the item.
filethe file in which the item is defined.
anchorthe anchor of the item.
separateIndexnot used.
addToNavIndexnot used.
defnot used.

Implements IndexIntf.

Definition at line 627 of file htmlhelp.cpp.

635 {
636  // If we're using a binary toc then folders cannot have links.
637  // Tried this and I didn't see any problems, when not using
638  // the resetting of file and anchor the TOC works better
639  // (prev / next button)
640  //if(Config_getBool("BINARY_TOC") && isDir)
641  //{
642  //file = 0;
643  //anchor = 0;
644  //}
645  int i; for (i=0;i<dc;i++) cts << " ";
646  cts << "<LI><OBJECT type=\"text/sitemap\">";
647  cts << "<param name=\"Name\" value=\"" << convertToHtml(recode(name),TRUE) << "\">";
648  if (file) // made file optional param - KPW
649  {
650  if (file && (file[0]=='!' || file[0]=='^')) // special markers for user defined URLs
651  {
652  cts << "<param name=\"";
653  if (file[0]=='^') cts << "URL"; else cts << "Local";
654  cts << "\" value=\"";
655  cts << &file[1];
656  }
657  else
658  {
659  cts << "<param name=\"Local\" value=\"";
661  if (anchor) cts << "#" << anchor;
662  }
663  cts << "\">";
664  }
665  cts << "<param name=\"ImageNumber\" value=\"";
666  if (isDir) // added - KPW
667  {
668  cts << (int)BOOK_CLOSED ;
669  }
670  else
671  {
672  cts << (int)TEXT;
673  }
674  cts << "\">";
675  cts << "</OBJECT>\n";
676 }
static QCString name
Definition: declinfo.cpp:673
static QCString htmlFileExtension
Definition: doxygen.h:130
QCString convertToHtml(const char *s, bool keepEntities)
Definition: util.cpp:5746
QCString recode(const QCString &s)
Definition: htmlhelp.cpp:595
int dc
Definition: htmlhelp.h:95
FTextStream cts
Definition: htmlhelp.h:93
const bool TRUE
Definition: qglobal.h:371
void HtmlHelp::addImageFile ( const char *  fileName)
virtual

Implements IndexIntf.

Definition at line 711 of file htmlhelp.cpp.

712 {
714 }
uint contains(const type *d) const
Definition: qinternallist.h:78
fileName
Definition: dumpTree.py:9
void append(const type *d)
Definition: qinternallist.h:61
QStrList imageFiles
Definition: htmlhelp.h:97
void HtmlHelp::addIndexFile ( const char *  name)
virtual

Implements IndexIntf.

Definition at line 536 of file htmlhelp.cpp.

537 {
538  if (indexFileDict.find(s)==0)
539  {
541  indexFileDict.insert(s,(void *)0x8);
542  }
543 }
QDict< void > indexFileDict
Definition: htmlhelp.h:98
QStrList indexFiles
Definition: htmlhelp.h:96
void append(const type *d)
Definition: qinternallist.h:61
static QCString * s
Definition: config.cpp:1042
void HtmlHelp::addIndexItem ( Definition context,
MemberDef md,
const char *  sectionAnchor,
const char *  title 
)
virtual

Implements IndexIntf.

Definition at line 679 of file htmlhelp.cpp.

681 {
682  if (md)
683  {
684  static bool separateMemberPages = Config_getBool("SEPARATE_MEMBER_PAGES");
685  if (context==0) // global member
686  {
687  if (md->getGroupDef())
688  context = md->getGroupDef();
689  else if (md->getFileDef())
690  context = md->getFileDef();
691  }
692  if (context==0) return; // should not happen
693 
694  QCString cfname = md->getOutputFileBase();
695  QCString cfiname = context->getOutputFileBase();
696  QCString level1 = context->name();
697  QCString level2 = md->name();
698  QCString contRef = separateMemberPages ? cfname : cfiname;
699  QCString memRef = cfname;
700  QCString anchor = sectionAnchor ? QCString(sectionAnchor) : md->anchor();
701  index->addItem(level1,level2,contRef,anchor,TRUE,FALSE);
702  index->addItem(level2,level1,memRef,anchor,TRUE,TRUE);
703  }
704  else if (context)
705  {
706  QCString level1 = word ? QCString(word) : context->name();
707  index->addItem(level1,0,context->getOutputFileBase(),sectionAnchor,TRUE,FALSE);
708  }
709 }
static QCString name
Definition: declinfo.cpp:673
const bool FALSE
Definition: qglobal.h:370
virtual QCString getOutputFileBase() const =0
FileDef * getFileDef() const
Definition: memberdef.cpp:4075
const QCString & name() const
Definition: definition.h:114
#define Config_getBool(val)
Definition: config.cpp:664
GroupDef * getGroupDef() const
Definition: memberdef.cpp:4095
QCString getOutputFileBase() const
Definition: memberdef.cpp:941
void addItem(const char *first, const char *second, const char *url, const char *anchor, bool hasLink, bool reversed)
Definition: htmlhelp.cpp:108
HtmlHelpIndex * index
Definition: htmlhelp.h:94
union ptb::content::word::word word
const bool TRUE
Definition: qglobal.h:371
void HtmlHelp::addStyleSheetFile ( const char *  )
inlinevirtual

Implements IndexIntf.

Definition at line 86 of file htmlhelp.h.

86 {}
void HtmlHelp::createProjectFile ( )
private

Definition at line 465 of file htmlhelp.cpp.

466 {
467  /* Write the project file */
468  QCString fName = Config_getString("HTML_OUTPUT") + "/index.hhp";
469  QFile f(fName);
470  if (f.open(IO_WriteOnly))
471  {
472  FTextStream t(&f);
473 
474  QCString indexName="index"+Doxygen::htmlFileExtension;
475  t << "[OPTIONS]\n";
476  if (!Config_getString("CHM_FILE").isEmpty())
477  {
478  t << "Compiled file=" << Config_getString("CHM_FILE") << "\n";
479  }
480  t << "Compatibility=1.1\n"
481  "Full-text search=Yes\n"
482  "Contents file=index.hhc\n"
483  "Default Window=main\n"
484  "Default topic=" << indexName << "\n"
485  "Index file=index.hhk\n"
486  "Language=" << getLanguageString() << endl;
487  if (Config_getBool("BINARY_TOC")) t << "Binary TOC=YES\n";
488  if (Config_getBool("GENERATE_CHI")) t << "Create CHI file=YES\n";
489  t << "Title=" << recode(Config_getString("PROJECT_NAME")) << endl << endl;
490 
491  t << "[WINDOWS]" << endl;
492 
493  // NOTE: the 0x10387e number is a set of bits specifying the buttons
494  // which should appear in the CHM viewer; that specific value
495  // means "show all buttons including the font-size one";
496  // the font-size one is not normally settable by the HTML Help Workshop
497  // utility but the way to set it is described here:
498  // http://support.microsoft.com/?scid=kb%3Ben-us%3B240062&x=17&y=18
499  // NOTE: the 0x70387e number in addition to the above the Next and Prev button
500  // are shown. They can only be shown in case of a binary toc.
501  // dee http://www.mif2go.com/xhtml/htmlhelp_0016_943addingtabsandtoolbarbuttonstohtmlhelp.htm#Rz108x95873
502  // Value has been taken from htmlhelp.h file of the HTML Help Workshop
503  if (Config_getBool("BINARY_TOC"))
504  {
505  t << "main=\"" << recode(Config_getString("PROJECT_NAME")) << "\",\"index.hhc\","
506  "\"index.hhk\",\"" << indexName << "\",\"" <<
507  indexName << "\",,,,,0x23520,,0x70387e,,,,,,,,0" << endl << endl;
508  }
509  else
510  {
511  t << "main=\"" << recode(Config_getString("PROJECT_NAME")) << "\",\"index.hhc\","
512  "\"index.hhk\",\"" << indexName << "\",\"" <<
513  indexName << "\",,,,,0x23520,,0x10387e,,,,,,,,0" << endl << endl;
514  }
515 
516  t << "[FILES]" << endl;
517  char *s = indexFiles.first();
518  while (s)
519  {
520  t << s << endl;
521  s = indexFiles.next();
522  }
523  uint i;
524  for (i=0;i<imageFiles.count();i++)
525  {
526  t << imageFiles.at(i) << endl;
527  }
528  f.close();
529  }
530  else
531  {
532  err("Could not open file %s for writing\n",fName.data());
533  }
534 }
#define IO_WriteOnly
Definition: qiodevice.h:62
static QCString htmlFileExtension
Definition: doxygen.h:130
type * first()
Definition: qinternallist.h:87
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
QStrList indexFiles
Definition: htmlhelp.h:96
const char * data() const
Definition: qcstring.h:207
QCString recode(const QCString &s)
Definition: htmlhelp.cpp:595
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
type * next()
Definition: qinternallist.h:89
void err(const char *fmt,...)
Definition: message.cpp:226
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QStrList imageFiles
Definition: htmlhelp.h:97
type * at(uint i)
Definition: qinternallist.h:81
static QCString getLanguageString()
Definition: htmlhelp.cpp:449
uint count() const
Definition: qinternallist.h:56
unsigned uint
Definition: qglobal.h:351
static QCString * s
Definition: config.cpp:1042
QTextStream & endl(QTextStream &s)
void HtmlHelp::decContentsDepth ( )
virtual

Decrease the level of the contents hierarchy. This will end the unnumber HTML list.

See also
incContentsDepth()

Implements IndexIntf.

Definition at line 588 of file htmlhelp.cpp.

589 {
590  int i; for (i=0;i<dc;i++) cts << " ";
591  cts << "</UL>\n";
592  --dc;
593 }
int dc
Definition: htmlhelp.h:95
FTextStream cts
Definition: htmlhelp.h:93
void HtmlHelp::finalize ( )
virtual

Finalizes the HTML help. This will finish and close the contents file (index.hhc) and the index file (index.hhk).

See also
initialize()

Implements IndexIntf.

Definition at line 549 of file htmlhelp.cpp.

550 {
551  // end the contents file
552  cts << "</UL>\n";
553  cts << "</BODY>\n";
554  cts << "</HTML>\n";
555  cts.unsetDevice();
556  cf->close();
557  delete cf;
558 
560 
561  // end the index file
562  kts << "</UL>\n";
563  kts << "</BODY>\n";
564  kts << "</HTML>\n";
565  kts.unsetDevice();
566  kf->close();
567  delete kf;
568 
570  s_languageDict.clear();
571 }
void unsetDevice()
void writeFields(FTextStream &t)
Definition: htmlhelp.cpp:168
static QDict< QCString > s_languageDict
Definition: htmlhelp.cpp:296
FTextStream kts
Definition: htmlhelp.h:93
QFile * cf
Definition: htmlhelp.h:92
QFile * kf
Definition: htmlhelp.h:92
HtmlHelpIndex * index
Definition: htmlhelp.h:94
void createProjectFile()
Definition: htmlhelp.cpp:465
void close()
Definition: qfile_unix.cpp:614
FTextStream cts
Definition: htmlhelp.h:93
void HtmlHelp::incContentsDepth ( )
virtual

Increase the level of the contents hierarchy. This will start a new unnumbered HTML list in contents file.

See also
decContentsDepth()

Implements IndexIntf.

Definition at line 577 of file htmlhelp.cpp.

578 {
579  int i; for (i=0;i<dc+1;i++) cts << " ";
580  cts << "<UL>\n";
581  ++dc;
582 }
int dc
Definition: htmlhelp.h:95
FTextStream cts
Definition: htmlhelp.h:93
void HtmlHelp::initialize ( )
virtual

This will create a contents file (index.hhc) and a index file (index.hhk) and write the header of those files. It also creates a project file (index.hhp)

See also
finalize()

Implements IndexIntf.

Definition at line 303 of file htmlhelp.cpp.

304 {
305  const char *str = Config_getString("CHM_INDEX_ENCODING");
306  if (!str) str = "CP1250"; // use safe and likely default
307  m_fromUtf8 = portable_iconv_open(str,"UTF-8");
308  if (m_fromUtf8==(void *)(-1))
309  {
310  err("unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", str);
311  exit(1);
312  }
313 
314  /* open the contents file */
315  QCString fName = Config_getString("HTML_OUTPUT") + "/index.hhc";
316  cf = new QFile(fName);
317  if (!cf->open(IO_WriteOnly))
318  {
319  err("Could not open file %s for writing\n",fName.data());
320  exit(1);
321  }
322  /* Write the header of the contents file */
323  cts.setDevice(cf);
324  cts << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
325  "<HTML><HEAD></HEAD><BODY>\n"
326  "<OBJECT type=\"text/site properties\">\n"
327  "<param name=\"FrameName\" value=\"right\">\n"
328  "</OBJECT>\n"
329  "<UL>\n";
330 
331  /* open the contents file */
332  fName = Config_getString("HTML_OUTPUT") + "/index.hhk";
333  kf = new QFile(fName);
334  if (!kf->open(IO_WriteOnly))
335  {
336  err("Could not open file %s for writing\n",fName.data());
337  exit(1);
338  }
339  /* Write the header of the contents file */
340  kts.setDevice(kf);
341  kts << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n"
342  "<HTML><HEAD></HEAD><BODY>\n"
343  "<OBJECT type=\"text/site properties\">\n"
344  "<param name=\"FrameName\" value=\"right\">\n"
345  "</OBJECT>\n"
346  "<UL>\n";
347 
348  /* language codes for Html help
349  0x405 Czech
350  0x406 Danish
351  0x413 Dutch
352  0xC09 English (Australia)
353  0x809 English (Britain)
354  0x1009 English (Canada)
355  0x1809 English (Ireland)
356  0x1409 English (New Zealand)
357  0x1C09 English (South Africa)
358  0x409 English (United States)
359  0x40B Finnish
360  0x40C French
361  0x407 German
362  0x408 Greece
363  0x40E Hungarian
364  0x410 Italian
365  0x814 Norwegian
366  0x415 Polish
367  0x816 Portuguese(Portugal)
368  0x416 Portuguese(Brazil)
369  0x419 Russian
370  0x80A Spanish(Mexico)
371  0xC0A Spanish(Modern Sort)
372  0x40A Spanish(Traditional Sort)
373  0x41D Swedish
374  0x41F Turkey
375  0x411 Japanese
376  0x412 Korean
377  0x804 Chinese (PRC)
378  0x404 Chinese (Taiwan)
379 
380  New LCIDs:
381  0x421 Indonesian
382  0x41A Croatian
383  0x418 Romanian
384  0x424 Slovenian
385  0x41B Slovak
386  0x422 Ukrainian
387  0x81A Serbian (Serbia, Latin)
388  0x403 Catalan
389  0x426 Latvian
390  0x427 Lithuanian
391  0x436 Afrikaans
392  0x42A Vietnamese
393  0x429 Persian (Iran)
394  0xC01 Arabic (Egypt) - I don't know which version of arabic is used inside translator_ar.h ,
395  so I have chosen Egypt at random
396 
397  */
398  s_languageDict.setAutoDelete(TRUE);
399  s_languageDict.clear();
400  s_languageDict.insert("czech", new QCString("0x405 Czech"));
401  s_languageDict.insert("danish", new QCString("0x406 Danish"));
402  s_languageDict.insert("dutch", new QCString("0x413 Dutch"));
403  s_languageDict.insert("finnish", new QCString("0x40B Finnish"));
404  s_languageDict.insert("french", new QCString("0x40C French"));
405  s_languageDict.insert("german", new QCString("0x407 German"));
406  s_languageDict.insert("greek", new QCString("0x408 Greece"));
407  s_languageDict.insert("hungarian", new QCString("0x40E Hungarian"));
408  s_languageDict.insert("italian", new QCString("0x410 Italian"));
409  s_languageDict.insert("norwegian", new QCString("0x814 Norwegian"));
410  s_languageDict.insert("polish", new QCString("0x415 Polish"));
411  s_languageDict.insert("portuguese", new QCString("0x816 Portuguese(Portugal)"));
412  s_languageDict.insert("brazilian", new QCString("0x416 Portuguese(Brazil)"));
413  s_languageDict.insert("russian", new QCString("0x419 Russian"));
414  s_languageDict.insert("spanish", new QCString("0x40A Spanish(Traditional Sort)"));
415  s_languageDict.insert("swedish", new QCString("0x41D Swedish"));
416  s_languageDict.insert("turkish", new QCString("0x41F Turkey"));
417  s_languageDict.insert("japanese", new QCString("0x411 Japanese"));
418  s_languageDict.insert("japanese-en", new QCString("0x411 Japanese"));
419  s_languageDict.insert("korean", new QCString("0x412 Korean"));
420  s_languageDict.insert("korean-en", new QCString("0x412 Korean"));
421  s_languageDict.insert("chinese", new QCString("0x804 Chinese (PRC)"));
422  s_languageDict.insert("chinese-traditional", new QCString("0x404 Chinese (Taiwan)"));
423 
424  // new LCIDs
425  s_languageDict.insert("indonesian", new QCString("0x412 Indonesian"));
426  s_languageDict.insert("croatian", new QCString("0x41A Croatian"));
427  s_languageDict.insert("romanian", new QCString("0x418 Romanian"));
428  s_languageDict.insert("slovene", new QCString("0x424 Slovenian"));
429  s_languageDict.insert("slovak", new QCString("0x41B Slovak"));
430  s_languageDict.insert("ukrainian", new QCString("0x422 Ukrainian"));
431  s_languageDict.insert("serbian", new QCString("0x81A Serbian (Serbia, Latin)"));
432  s_languageDict.insert("catalan", new QCString("0x403 Catalan"));
433  s_languageDict.insert("lithuanian", new QCString("0x427 Lithuanian"));
434  s_languageDict.insert("afrikaans", new QCString("0x436 Afrikaans"));
435  s_languageDict.insert("vietnamese", new QCString("0x42A Vietnamese"));
436  s_languageDict.insert("persian", new QCString("0x429 Persian (Iran)"));
437  s_languageDict.insert("arabic", new QCString("0xC01 Arabic (Egypt)"));
438  s_languageDict.insert("latvian", new QCString("0x426 Latvian"));
439  s_languageDict.insert("macedonian", new QCString("0x042f Macedonian (Former Yugoslav Republic of Macedonia)"));
440  s_languageDict.insert("armenian", new QCString("0x42b Armenian"));
441  //Code for Esperanto should be as shown below but the htmlhelp compiler 1.3 does not support this
442  // (and no newer version is available).
443  //So do a fallback to the default language (see getLanguageString())
444  //s_languageDict.insert("esperanto", new QCString("0x48f Esperanto"));
445  s_languageDict.insert("serbian-cyrillic", new QCString("0xC1A Serbian (Serbia, Cyrillic)"));
446 }
#define IO_WriteOnly
Definition: qiodevice.h:62
void setDevice(QIODevice *)
bool open(int)
Definition: qfile_unix.cpp:134
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
static QDict< QCString > s_languageDict
Definition: htmlhelp.cpp:296
void * portable_iconv_open(const char *tocode, const char *fromcode)
Definition: portable_c.c:19
void err(const char *fmt,...)
Definition: message.cpp:226
FTextStream kts
Definition: htmlhelp.h:93
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
void * m_fromUtf8
Definition: htmlhelp.h:101
QFile * cf
Definition: htmlhelp.h:92
QFile * kf
Definition: htmlhelp.h:92
FTextStream cts
Definition: htmlhelp.h:93
const bool TRUE
Definition: qglobal.h:371
static QCString str
QCString HtmlHelp::recode ( const QCString s)
private

Definition at line 595 of file htmlhelp.cpp.

596 {
597  int iSize = s.length();
598  int oSize = iSize*4+1;
599  QCString output(oSize);
600  size_t iLeft = iSize;
601  size_t oLeft = oSize;
602  char *iPtr = s.rawData();
603  char *oPtr = output.rawData();
604  if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
605  {
606  oSize -= (int)oLeft;
607  output.resize(oSize+1);
608  output.at(oSize)='\0';
609  return output;
610  }
611  else
612  {
613  return s;
614  }
615 }
char * rawData() const
Definition: qcstring.h:216
uint length() const
Definition: qcstring.h:195
size_t portable_iconv(void *cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Definition: portable_c.c:24
void * m_fromUtf8
Definition: htmlhelp.h:101
static QCString * s
Definition: config.cpp:1042

Friends And Related Function Documentation

friend class HtmlHelpIndex
friend

Definition at line 89 of file htmlhelp.h.

Member Data Documentation

QFile* HtmlHelp::cf
private

Definition at line 92 of file htmlhelp.h.

FTextStream HtmlHelp::cts
private

Definition at line 93 of file htmlhelp.h.

int HtmlHelp::dc
private

Definition at line 95 of file htmlhelp.h.

QStrList HtmlHelp::imageFiles
private

Definition at line 97 of file htmlhelp.h.

HtmlHelpIndex* HtmlHelp::index
private

Definition at line 94 of file htmlhelp.h.

QDict<void> HtmlHelp::indexFileDict
private

Definition at line 98 of file htmlhelp.h.

QStrList HtmlHelp::indexFiles
private

Definition at line 96 of file htmlhelp.h.

QFile * HtmlHelp::kf
private

Definition at line 92 of file htmlhelp.h.

FTextStream HtmlHelp::kts
private

Definition at line 93 of file htmlhelp.h.

void* HtmlHelp::m_fromUtf8
private

Definition at line 101 of file htmlhelp.h.

HtmlHelp * HtmlHelp::theInstance = 0
staticprivate

Definition at line 99 of file htmlhelp.h.


The documentation for this class was generated from the following files: