From 243272688a4a3bc7921b7d05dda927f4adf3036c Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 16 Jul 2006 20:10:06 +0000 Subject: Release-1.4.7-20060716 --- INSTALL | 4 +- README | 4 +- addon/doxywizard/doxywizard.cpp | 2 +- configure | 6 +- doc/config.doc | 8 +- doc/language.doc | 62 +- doc/maintainers.txt | 10 +- doc/translator_report.txt | 138 ++-- qtools/qfile.h | 3 + qtools/qfile_unix.cpp | 21 + qtools/qfile_win32.cpp | 23 + qtools/qglobal.h | 7 + src/classdef.cpp | 1472 ++++++++++++++++++--------------- src/classdef.h | 104 +-- src/cmdmapper.cpp | 4 +- src/code.l | 24 +- src/commentcnv.l | 2 +- src/commentscan.l | 17 +- src/config.l | 24 +- src/defgen.cpp | 94 ++- src/definition.cpp | 148 ++-- src/definition.h | 89 +- src/diagram.cpp | 15 +- src/docparser.cpp | 4 +- src/doctokenizer.l | 6 +- src/dot.cpp | 245 +++--- src/doxygen.cpp | 1702 +++++++++++++++++++++------------------ src/doxygen.css | 1 + src/doxygen_css.h | 2 +- src/entry.cpp | 587 +++++++++++++- src/entry.h | 102 ++- src/filedef.cpp | 364 +++++---- src/filedef.h | 67 +- src/groupdef.cpp | 22 +- src/htmlgen.cpp | 320 ++++---- src/index.cpp | 8 +- src/lang_cfg.h | 2 + src/language.cpp | 18 + src/latexdocvisitor.cpp | 4 +- src/memberdef.cpp | 10 +- src/memberdef.h | 96 +-- src/namespacedef.cpp | 12 +- src/perlmodgen.cpp | 139 ++-- src/pycode.l | 11 +- src/pyscanner.l | 13 +- src/scanner.l | 127 +-- src/translator_ar.h | 1615 +++++++++++++++++++++++++++++++++++++ src/translator_br.h | 31 +- src/translator_ca.h | 20 +- src/translator_cn.h | 40 +- src/translator_cz.h | 10 +- src/translator_de.h | 24 +- src/translator_fa.h | 1603 ++++++++++++++++++++++++++++++++++++ src/translator_hr.h | 21 +- src/translator_it.h | 8 + src/translator_ru.h | 20 +- src/util.cpp | 77 +- src/util.h | 6 +- src/xmlgen.cpp | 245 +++--- 59 files changed, 7168 insertions(+), 2695 deletions(-) create mode 100644 src/translator_ar.h create mode 100644 src/translator_fa.h diff --git a/INSTALL b/INSTALL index cacc382..609ad00 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.4.7 +DOXYGEN Version 1.4.7-20060716 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (11 June 2006) +Dimitri van Heesch (16 July 2006) diff --git a/README b/README index 609272b..63417c1 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.4.7 +DOXYGEN Version 1.4.7_20060716 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (11 June 2006) +Dimitri van Heesch (dimitri@stack.nl) (16 July 2006) diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index 230143c..099792b 100644 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -70,7 +70,7 @@ void setDotPath() if (checkIfDotInstalled()) { Config_getString("DOT_PATH")=DOT_PATH; - Config_getBool("HAVE_DOT")=TRUE; + //Config_getBool("HAVE_DOT")=TRUE; } } diff --git a/configure b/configure index 27650f4..b98897a 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=4 doxygen_version_revision=7 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=NO +doxygen_version_mmn=20060716 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` @@ -35,7 +35,7 @@ f_insttool=NO f_english=NO f_wizard=NO f_thread=NO -f_langs=nl,se,cz,fr,id,it,de,jp,je,es,fi,ru,hr,pl,pt,hu,kr,ke,ro,si,cn,no,br,dk,sk,ua,gr,tw,sr,ca,lt,za +f_langs=nl,se,cz,fr,id,it,de,jp,je,es,fi,ru,hr,pl,pt,hu,kr,ke,ro,si,cn,no,br,dk,sk,ua,gr,tw,sr,ca,lt,za,ar,fa while test -n "$1"; do case $1 in @@ -587,7 +587,7 @@ fi echo -n " Generating src/lang_cfg.h..." echo $f_langs | $f_perl -e '@l=split(/,/,); chomp @l; - @allowed=(split(/,/,"NL,SE,CZ,FR,ID,IT,DE,JP,JE,ES,FI,RU,HR,PL,PT,HU,KR,KE,RO,SI,CN,NO,BR,DK,SK,UA,GR,TW,SR,CA,LT,ZA")); + @allowed=(split(/,/,"NL,SE,CZ,FR,ID,IT,DE,JP,JE,ES,FI,RU,HR,PL,PT,HU,KR,KE,RO,SI,CN,NO,BR,DK,SK,UA,GR,TW,SR,CA,LT,ZA,AR,FA")); foreach my $elem (@l){ $elem =~ tr/a-z/A-Z/; $r=0; diff --git a/doc/config.doc b/doc/config.doc index 75cf0dd..928691e 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -267,10 +267,10 @@ followed by the descriptions of the tags grouped by category. documentation generated by doxygen is written. Doxygen will use this information to generate all constant output in the proper language. The default language is English, other supported languages are: - Brazilian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, - German, Greek, Hungarian, Italian, Japanese, Korean, Lithuanian, Norwegian, - Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, - Swedish, and Ukrainian. + Afrikaans, Arabic, Brazilian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, + Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, + Lithuanian, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, + Slovak, Slovene, Spanish, Swedish, and Ukrainian. \anchor cfg_use_windows_encoding
\c USE_WINDOWS_ENCODING
diff --git a/doc/language.doc b/doc/language.doc index 0c8ef41..963d3db 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -23,13 +23,13 @@ text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration file (with default name and known as Doxyfile). -Currently (version 1.4.7), 31 languages +Currently (version 1.4.7), 33 languages are supported (sorted alphabetically): -Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese +Afrikaans, Arabic, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Indonesian, Italian, Japanese (+En), Korean -(+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.. +(+En), Lithuanian, Norwegian, Persian, Polish, Portuguese, Romanian, +Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.. The table of information related to the supported languages follows. It is sorted by language alphabetically. The Status column @@ -57,40 +57,46 @@ when the translator was updated. 1.4.6 + Arabic + Moaz Reyad + + 1.4.6 + + Brazilian Portuguese Fabio "FJTC" Jun Takada Chino jun-chino at uol dot com dot br - 1.4.6 + up-to-date Catalan Maximiliano Pin
Albert Mora mcpin at emtesistemas dot com
amora at iua dot upf dot es - 1.4.6 + up-to-date Chinese Li Daobing
Wei Liu lidaobing at gmail dot com
liuwei at asiainfo dot com - 1.4.1 + up-to-date Chinese Traditional Daniel YC Lin
Gary Lee - daniel at twpda dot com
garylee at ecosine dot com dot tw + dlin at taifex dot com dot tw
garywlee at gmail dot com 1.4.6 Croatian Boris Bralo boris.bralo at zg dot htnet dot hr - 1.4.6 + up-to-date Czech Petr Přikryl prikrylp at skil dot cz - 1.4.6 + up-to-date Danish @@ -126,7 +132,7 @@ when the translator was updated. German Jens Seidel jensseidel at users dot sf dot net - 1.4.6 + up-to-date Greek @@ -150,7 +156,7 @@ when the translator was updated. Italian Alessandro Falappa
Ahmed Aldo Faisal alessandro at falappa dot net
aaf23 at cam dot ac dot uk - 1.4.6 + up-to-date Japanese @@ -189,6 +195,12 @@ when the translator was updated. 1.4.6 + Persian + Ali Nadalizadeh + + 1.4.6 + + Polish Piotr Kaminski
Grzegorz Kowal Piotr.Kaminski at ctm dot gdynia dot pl
g_kowal at poczta dot onet dot pl @@ -210,7 +222,7 @@ when the translator was updated. Russian Alexandr Chelpanov cav at cryptopro dot ru - 1.4.6 + up-to-date Serbian @@ -265,20 +277,22 @@ when the translator was updated. \hline Afrikaans & Johan Prinsloo & {\tt\tiny johan@zippysnoek.com} & 1.4.6 \\ \hline - Brazilian Portuguese & Fabio "FJTC" Jun Takada Chino & {\tt\tiny jun-chino@uol.com.br} & 1.4.6 \\ + Arabic & Moaz Reyad & {\tt\tiny } & 1.4.6 \\ + \hline + Brazilian Portuguese & Fabio "FJTC" Jun Takada Chino & {\tt\tiny jun-chino@uol.com.br} & up-to-date \\ \hline - Catalan & Maximiliano Pin & {\tt\tiny mcpin@emtesistemas.com} & 1.4.6 \\ + Catalan & Maximiliano Pin & {\tt\tiny mcpin@emtesistemas.com} & up-to-date \\ ~ & Albert Mora & {\tt\tiny amora@iua.upf.es} & ~ \\ \hline - Chinese & Li Daobing & {\tt\tiny lidaobing@gmail.com} & 1.4.1 \\ + Chinese & Li Daobing & {\tt\tiny lidaobing@gmail.com} & up-to-date \\ ~ & Wei Liu & {\tt\tiny liuwei@asiainfo.com} & ~ \\ \hline - Chinese Traditional & Daniel YC Lin & {\tt\tiny daniel@twpda.com} & 1.4.6 \\ - ~ & Gary Lee & {\tt\tiny garylee@ecosine.com.tw} & ~ \\ + Chinese Traditional & Daniel YC Lin & {\tt\tiny dlin@taifex.com.tw} & 1.4.6 \\ + ~ & Gary Lee & {\tt\tiny garywlee@gmail.com} & ~ \\ \hline - Croatian & Boris Bralo & {\tt\tiny boris.bralo@zg.htnet.hr} & 1.4.6 \\ + Croatian & Boris Bralo & {\tt\tiny boris.bralo@zg.htnet.hr} & up-to-date \\ \hline - Czech & Petr P\v{r}ikryl & {\tt\tiny prikrylp@skil.cz} & 1.4.6 \\ + Czech & Petr P\v{r}ikryl & {\tt\tiny prikrylp@skil.cz} & up-to-date \\ \hline Danish & Erik S\o{}e S\o{}rensen & {\tt\tiny eriksoe+doxygen@daimi.au.dk} & 1.3.9 \\ \hline @@ -290,7 +304,7 @@ when the translator was updated. \hline French & Xavier Outhier & {\tt\tiny xouthier@yahoo.fr} & 1.4.6 \\ \hline - German & Jens Seidel & {\tt\tiny jensseidel@users.sf.net} & 1.4.6 \\ + German & Jens Seidel & {\tt\tiny jensseidel@users.sf.net} & up-to-date \\ \hline Greek & Harry Kalogirou & {\tt\tiny harkal@rainbow.cs.unipi.gr} & 1.2.11 \\ \hline @@ -299,7 +313,7 @@ when the translator was updated. \hline Indonesian & Hendy Irawan & {\tt\tiny ceefour@gauldong.net} & 1.4.6 \\ \hline - Italian & Alessandro Falappa & {\tt\tiny alessandro@falappa.net} & 1.4.6 \\ + Italian & Alessandro Falappa & {\tt\tiny alessandro@falappa.net} & up-to-date \\ ~ & Ahmed Aldo Faisal & {\tt\tiny aaf23@cam.ac.uk} & ~ \\ \hline Japanese & Ryunosuke Satoh & {\tt\tiny sun594@hotmail.com} & 1.4.6 \\ @@ -319,6 +333,8 @@ when the translator was updated. \hline Norwegian & Lars Erik Jordet & {\tt\tiny lejordet@gmail.com} & 1.4.6 \\ \hline + Persian & Ali Nadalizadeh & {\tt\tiny } & 1.4.6 \\ + \hline Polish & Piotr Kaminski & {\tt\tiny Piotr.Kaminski@ctm.gdynia.pl} & 1.4.6 \\ ~ & Grzegorz Kowal & {\tt\tiny g\_kowal@poczta.onet.pl} & ~ \\ \hline @@ -326,7 +342,7 @@ when the translator was updated. \hline Romanian & Alexandru Iosup & {\tt\tiny aiosup@yahoo.com} & 1.4.1 \\ \hline - Russian & Alexandr Chelpanov & {\tt\tiny cav@cryptopro.ru} & 1.4.6 \\ + Russian & Alexandr Chelpanov & {\tt\tiny cav@cryptopro.ru} & up-to-date \\ \hline Serbian & Dejan Milosavljevic & {\tt\tiny dmilos@email.com} & 1.4.1 \\ \hline diff --git a/doc/maintainers.txt b/doc/maintainers.txt index bbb36f2..bc6bb22 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -12,6 +12,9 @@ TranslatorAfrikaans Johan Prinsloo: johan@zippysnoek.com +TranslatorArabic +Moaz Reyad: + TranslatorBrazilian Fabio "FJTC" Jun Takada Chino: jun-chino@uol.com.br @@ -24,8 +27,8 @@ Li Daobing: lidaobing@gmail.com Wei Liu: liuwei@asiainfo.com TranslatorChinesetraditional -Daniel YC Lin: daniel@twpda.com -Gary Lee: garylee@ecosine.com.tw +Daniel YC Lin: dlin@taifex.com.tw +Gary Lee: garywlee@gmail.com TranslatorCroatian Boris Bralo: boris.bralo@zg.htnet.hr @@ -82,6 +85,9 @@ Aidas Berukstis: aidasber@takas.lt TranslatorNorwegian Lars Erik Jordet: lejordet@gmail.com +TranslatorPersian +Ali Nadalizadeh: + TranslatorPolish Piotr Kaminski: Piotr.Kaminski@ctm.gdynia.pl Grzegorz Kowal: g_kowal@poczta.onet.pl diff --git a/doc/translator_report.txt b/doc/translator_report.txt index 17aa5f7..1b04745 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -1,14 +1,14 @@ (1.4.7) -Doxygen supports the following 31 languages (sorted alphabetically): +Doxygen supports the following 33 languages (sorted alphabetically): -Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese +Afrikaans, Arabic, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Indonesian, Italian, Japanese (+En), Korean -(+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. +(+En), Lithuanian, Norwegian, Persian, Polish, Portuguese, Romanian, +Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. -Of them, 2 translators are up-to-date, 29 translators are based on +Of them, 10 translators are up-to-date, 23 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -17,8 +17,16 @@ alphabetically). This means that they derive from the Translator class and they implement all 194 of the required methods. Anyway, there still may be some details listed even for them: + TranslatorBrazilian -- Remove the obsolete methods (never used). + TranslatorCatalan + TranslatorChinese + TranslatorCroatian + TranslatorCzech TranslatorDutch -- Remove the obsolete methods (never used). TranslatorEnglish -- Remove the obsolete methods (never used). + TranslatorGerman + TranslatorItalian -- Change the base class to Translator. + TranslatorRussian ---------------------------------------------------------------------- The following translator classes need some maintenance (the most @@ -29,27 +37,21 @@ must be implemented to become up-to-date: TranslatorSwedish 1.4.6 2 methods to implement TranslatorSpanish 1.4.6 1 method to implement TranslatorSlovene 1.4.6 2 methods to implement - TranslatorRussian 1.4.6 2 methods to implement TranslatorPolish 1.4.6 1 method to implement + TranslatorPersian 1.4.6 1 method to implement TranslatorNorwegian 1.4.6 1 method to implement TranslatorLithuanian 1.4.6 2 methods to implement TranslatorKorean 1.4.6 2 methods to implement TranslatorJapanese 1.4.6 1 method to implement - TranslatorItalian 1.4.6 1 method to implement TranslatorIndonesian 1.4.6 1 method to implement TranslatorHungarian 1.4.6 2 methods to implement - TranslatorGerman 1.4.6 2 methods to implement TranslatorFrench 1.4.6 1 method to implement - TranslatorCzech 1.4.6 1 method to implement - TranslatorCroatian 1.4.6 2 methods to implement TranslatorChinesetraditional 1.4.6 1 method to implement - TranslatorCatalan 1.4.6 2 methods to implement - TranslatorBrazilian 1.4.6 1 method to implement + TranslatorArabic 1.4.6 1 method to implement TranslatorAfrikaans 1.4.6 2 methods to implement TranslatorUkrainian 1.4.1 2 methods to implement TranslatorSerbian 1.4.1 2 methods to implement TranslatorRomanian 1.4.1 2 methods to implement - TranslatorChinese 1.4.1 3 methods to implement TranslatorDanish 1.3.9 8 methods to implement TranslatorPortuguese 1.3.3 13 methods to implement TranslatorSlovak 1.2.18 22 methods to implement @@ -81,8 +83,8 @@ TranslatorAfrikaans (TranslatorAdapter_1_4_6) 2 methods to implement virtual QCString trEnumerationValueDocumentation() -TranslatorBrazilian (TranslatorAdapter_1_4_6) 1 method to implement -------------------- +TranslatorArabic (TranslatorAdapter_1_4_6) 1 method to implement +---------------- Implements 193 of the required methods. @@ -93,7 +95,7 @@ TranslatorBrazilian (TranslatorAdapter_1_4_6) 1 method to implement Obsolete methods (should be removed, never used): virtual QCString trHeaderFilesDescription() - virtual QCString trField(bool first_capital, bool singular) + virtual QCString trField(bool/*first_capital*/, bool singular) virtual QCString trPackageDocumentation() virtual QCString trSources() virtual QCString trReimplementedForInternalReasons() @@ -103,27 +105,22 @@ TranslatorBrazilian (TranslatorAdapter_1_4_6) 1 method to implement virtual QCString trNoDescriptionAvailable() -TranslatorCatalan (TranslatorAdapter_1_4_6) 2 methods to implement ------------------ - - Implements 192 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trCallerGraph() - virtual QCString trEnumerationValueDocumentation() - - -TranslatorChinese (TranslatorAdapter_1_4_1) 3 methods to implement ------------------ +TranslatorBrazilian (Translator) +------------------- - Implements 191 of the required methods. + Implements 194 of the required methods. - Missing methods (should be implemented): + Obsolete methods (should be removed, never used): - virtual QCString trOverloadText() - virtual QCString trCallerGraph() - virtual QCString trEnumerationValueDocumentation() + virtual QCString trHeaderFilesDescription() + virtual QCString trField(bool first_capital, bool singular) + virtual QCString trPackageDocumentation() + virtual QCString trSources() + virtual QCString trReimplementedForInternalReasons() + virtual QCString trInterfaces() + virtual QCString trHeaderFiles() + virtual QCString trBugsAndLimitations() + virtual QCString trNoDescriptionAvailable() TranslatorChinesetraditional (TranslatorAdapter_1_4_6) 1 method to implement @@ -148,27 +145,6 @@ TranslatorChinesetraditional (TranslatorAdapter_1_4_6) 1 method to implement virtual QCString trNoDescriptionAvailable() -TranslatorCroatian (TranslatorAdapter_1_4_6) 2 methods to implement ------------------- - - Implements 192 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trCallerGraph() - virtual QCString trEnumerationValueDocumentation() - - -TranslatorCzech (TranslatorAdapter_1_4_6) 1 method to implement ---------------- - - Implements 193 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trEnumerationValueDocumentation() - - TranslatorDanish (TranslatorAdapter_1_3_9) 8 methods to implement ---------------- @@ -372,17 +348,6 @@ TranslatorFrench (TranslatorAdapter_1_4_6) 1 method to implement virtual QCString trNoDescriptionAvailable() -TranslatorGerman (TranslatorAdapter_1_4_6) 2 methods to implement ----------------- - - Implements 192 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trCallerGraph() - virtual QCString trEnumerationValueDocumentation() - - TranslatorGreek (TranslatorAdapter_1_2_11) 27 methods to implement --------------- @@ -464,14 +429,10 @@ TranslatorIndonesian (TranslatorAdapter_1_4_6) 1 method to implement virtual QCString trNoDescriptionAvailable() -TranslatorItalian (TranslatorAdapter_1_4_6) 1 method to implement +TranslatorItalian (TranslatorAdapter_1_4_6) ----------------- - Implements 193 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trEnumerationValueDocumentation() + Implements 194 of the required methods. TranslatorJapanese (TranslatorAdapter_1_4_6) 1 method to implement @@ -568,6 +529,28 @@ TranslatorNorwegian (TranslatorAdapter_1_4_6) 1 method to implement virtual QCString trNoDescriptionAvailable() +TranslatorPersian (TranslatorAdapter_1_4_6) 1 method to implement +----------------- + + Implements 193 of the required methods. + + Missing methods (should be implemented): + + virtual QCString trCallerGraph() + + Obsolete methods (should be removed, never used): + + virtual QCString trHeaderFilesDescription() + virtual QCString trField(bool first_capital, bool singular) + virtual QCString trPackageDocumentation() + virtual QCString trSources() + virtual QCString trReimplementedForInternalReasons() + virtual QCString trInterfaces() + virtual QCString trHeaderFiles() + virtual QCString trBugsAndLimitations() + virtual QCString trNoDescriptionAvailable() + + TranslatorPolish (TranslatorAdapter_1_4_6) 1 method to implement ---------------- @@ -647,17 +630,6 @@ TranslatorRomanian (TranslatorAdapter_1_4_1) 2 methods to implement virtual QCString trNoDescriptionAvailable() -TranslatorRussian (TranslatorAdapter_1_4_6) 2 methods to implement ------------------ - - Implements 192 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trCallerGraph() - virtual QCString trEnumerationValueDocumentation() - - TranslatorSerbian (TranslatorAdapter_1_4_1) 2 methods to implement ----------------- diff --git a/qtools/qfile.h b/qtools/qfile.h index 4ef0685..cfd357b 100644 --- a/qtools/qfile.h +++ b/qtools/qfile.h @@ -94,6 +94,9 @@ public: int handle() const; + int64 pos() const; + bool seek(int64 pos); + protected: QString fn; FILE *fh; diff --git a/qtools/qfile_unix.cpp b/qtools/qfile_unix.cpp index 6b63d99..fbf6acf 100644 --- a/qtools/qfile_unix.cpp +++ b/qtools/qfile_unix.cpp @@ -632,3 +632,24 @@ void QFile::close() return; } + +int64 QFile::pos() const +{ + if (isOpen()) + { + // TODO: support 64 bit size + return ftell( fh ); + } + return -1; +} + +bool QFile::seek( int64 pos ) +{ + if (isOpen()) + { + // TODO: support 64 bit size + return fseek( fh, pos, SEEK_SET )!=-1; + } + return FALSE; +} + diff --git a/qtools/qfile_win32.cpp b/qtools/qfile_win32.cpp index 39b1fa5..83c8c8d 100644 --- a/qtools/qfile_win32.cpp +++ b/qtools/qfile_win32.cpp @@ -591,3 +591,26 @@ void QFile::close() return; } + +int64 QFile::pos() const +{ + if (isOpen()) + { + // TODO: support 64 bit size + return ftell( fh ); + } + return -1; +} + +bool QFile::seek( int64 pos ) +{ + if (isOpen()) + { + // TODO: support 64 bit size + return fseek( fh, pos, SEEK_SET )!=-1; + } + return FALSE; +} + + + diff --git a/qtools/qglobal.h b/qtools/qglobal.h index 7dca39b..0123dee 100644 --- a/qtools/qglobal.h +++ b/qtools/qglobal.h @@ -336,6 +336,13 @@ typedef unsigned long ulong; typedef char *pchar; typedef uchar *puchar; typedef const char *pcchar; +#if defined(_OS_WIN32_) && !defined(_CC_GNU_) +typedef __int64 int64; +typedef unsigned __int64 uint64; +#else +typedef long long int64; +typedef unsigned long long uint64; +#endif // diff --git a/src/classdef.cpp b/src/classdef.cpp index 5450b46..e484748 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -55,23 +55,12 @@ ClassDef::ClassDef( } else { - m_fileName=compoundName+m_name; + m_fileName=compoundName+name(); } - if (lref) - { - m_exampleSDict = 0; - } - else - { - m_exampleSDict = new ExampleSDict(17); - } - m_memListFileName=convertNameToFile(compoundName+m_name+"-members"); - m_inherits = new BaseClassList; - m_inherits->setAutoDelete(TRUE); - m_inheritedBy = new BaseClassList; - m_inheritedBy->setAutoDelete(TRUE); - m_allMemberNameInfoSDict = new MemberNameInfoSDict(257); - m_allMemberNameInfoSDict->setAutoDelete(TRUE); + m_exampleSDict = 0; + m_inherits = 0; + m_inheritedBy = 0; + m_allMemberNameInfoSDict = 0; visited=FALSE; setReference(lref); m_incInfo=0; @@ -82,9 +71,8 @@ ClassDef::ClassDef( m_usesImplClassDict=0; m_usedByImplClassDict=0; m_usesIntfClassDict=0; - memberGroupSDict = new MemberGroupSDict; - memberGroupSDict->setAutoDelete(TRUE); - m_innerClasses = new ClassSDict(17); + memberGroupSDict = 0; + m_innerClasses = 0; m_subGrouping=Config_getBool("SUBGROUPING"); m_templateInstances = 0; m_variableInstances = 0; @@ -97,7 +85,7 @@ ClassDef::ClassDef( m_membersMerged = FALSE; m_categoryOf = 0; QCString ns; - extractNamespaceName(m_name,m_className,ns); + extractNamespaceName(name(),m_className,ns); //printf("m_name=%s m_className=%s ns=%s\n",m_name.data(),m_className.data(),ns.data()); if (((QCString)defFileName).right(5)!=".java" && @@ -109,6 +97,47 @@ ClassDef::ClassDef( { m_isLocal=FALSE; } + + pubMethods=0; + proMethods=0; + pacMethods=0; + priMethods=0; + pubStaticMethods=0; + proStaticMethods=0; + pacStaticMethods=0; + priStaticMethods=0; + pubSlots=0; + proSlots=0; + priSlots=0; + pubAttribs=0; + proAttribs=0; + pacAttribs=0; + priAttribs=0; + pubStaticAttribs=0; + proStaticAttribs=0; + pacStaticAttribs=0; + priStaticAttribs=0; + pubTypes=0; + proTypes=0; + pacTypes=0; + priTypes=0; + related=0; + signals=0; + friends=0; + dcopMethods=0; + properties=0; + events=0; + + constructors=0; + typedefMembers=0; + enumMembers=0; + enumValMembers=0; + functionMembers=0; + relatedMembers=0; + variableMembers=0; + propertyMembers=0; + eventMembers=0; + } // destroy the class definition @@ -130,6 +159,11 @@ ClassDef::~ClassDef() delete m_tempArgs; } +QCString ClassDef::getMemberListFileName() const +{ + return convertNameToFile(compoundTypeString()+name()+"-members"); +} + QCString ClassDef::displayName() const { static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES"); @@ -160,6 +194,11 @@ void ClassDef::insertBaseClass(ClassDef *cd,const char *n,Protection p, { //printf("*** insert base class %s into %s\n",cd->name().data(),name().data()); //inherits->inSort(new BaseClassDef(cd,p,s,t)); + if (m_inherits==0) + { + m_inherits = new BaseClassList; + m_inherits->setAutoDelete(TRUE); + } m_inherits->append(new BaseClassDef(cd,n,p,s,t)); } @@ -168,50 +207,58 @@ void ClassDef::insertSubClass(ClassDef *cd,Protection p, Specifier s,const char *t) { //printf("*** insert sub class %s into %s\n",cd->name().data(),name().data()); + if (m_inheritedBy==0) + { + m_inheritedBy = new BaseClassList; + m_inheritedBy->setAutoDelete(TRUE); + } m_inheritedBy->inSort(new BaseClassDef(cd,0,p,s,t)); } void ClassDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&pubTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubSlots,memberGroupSDict,this); - ::addMembersToMemberGroup(&signals,memberGroupSDict,this); - ::addMembersToMemberGroup(&dcopMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&proTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&proMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&proAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&proSlots,memberGroupSDict,this); - ::addMembersToMemberGroup(&proStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&proStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&priTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&priMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&priAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&priSlots,memberGroupSDict,this); - ::addMembersToMemberGroup(&priStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&priStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&friends,memberGroupSDict,this); - ::addMembersToMemberGroup(&related,memberGroupSDict,this); - ::addMembersToMemberGroup(&properties,memberGroupSDict,this); - ::addMembersToMemberGroup(&events,memberGroupSDict,this); + ::addMembersToMemberGroup(pubTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubSlots,&memberGroupSDict,this); + ::addMembersToMemberGroup(signals,&memberGroupSDict,this); + ::addMembersToMemberGroup(dcopMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(proTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(proMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(proAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(proSlots,&memberGroupSDict,this); + ::addMembersToMemberGroup(proStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(proStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(priTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(priMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(priAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(priSlots,&memberGroupSDict,this); + ::addMembersToMemberGroup(priStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(priStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(friends,&memberGroupSDict,this); + ::addMembersToMemberGroup(related,&memberGroupSDict,this); + ::addMembersToMemberGroup(properties,&memberGroupSDict,this); + ::addMembersToMemberGroup(events,&memberGroupSDict,this); // add members inside sections to their groups - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - if (mg->allMembersInSameSection() && m_subGrouping) + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) { - //printf("addToDeclarationSection(%s)\n",mg->header().data()); - mg->addToDeclarationSection(); + if (mg->allMembersInSameSection() && m_subGrouping) + { + //printf("addToDeclarationSection(%s)\n",mg->header().data()); + mg->addToDeclarationSection(); + } } } } @@ -232,77 +279,86 @@ void ClassDef::internalInsertMember(MemberDef *md, if (md->isRelated() && (Config_getBool("EXTRACT_PRIVATE") || prot!=Private)) { + if (related==0) related = new MemberList; if (sortBriefDocs) - related.inSort(md); + related->inSort(md); else - related.append(md); - md->setSectionList(this,&related); + related->append(md); + md->setSectionList(this,related); } else if (md->isFriend()) { + if (friends==0) friends = new MemberList; if (sortBriefDocs) - friends.inSort(md); + friends->inSort(md); else - friends.append(md); - md->setSectionList(this,&friends); + friends->append(md); + md->setSectionList(this,friends); } else { switch (md->memberType()) { case MemberDef::Signal: // Qt specific + if (signals==0) signals = new MemberList; if (sortBriefDocs) - signals.inSort(md); + signals->inSort(md); else - signals.append(md); - md->setSectionList(this,&signals); + signals->append(md); + md->setSectionList(this,signals); break; case MemberDef::DCOP: // KDE2 specific + if (dcopMethods==0) dcopMethods = new MemberList; if (sortBriefDocs) - dcopMethods.inSort(md); + dcopMethods->inSort(md); else - dcopMethods.append(md); - md->setSectionList(this,&dcopMethods); + dcopMethods->append(md); + md->setSectionList(this,dcopMethods); break; case MemberDef::Property: + if (properties==0) properties = new MemberList; if (sortBriefDocs) - properties.inSort(md); + properties->inSort(md); else - properties.append(md); - md->setSectionList(this,&properties); + properties->append(md); + md->setSectionList(this,properties); break; case MemberDef::Event: + if (events==0) events = new MemberList; if (sortBriefDocs) - events.inSort(md); + events->inSort(md); else - events.append(md); - md->setSectionList(this,&events); + events->append(md); + md->setSectionList(this,events); break; case MemberDef::Slot: // Qt specific switch (prot) { case Protected: case Package: // slots in packages are not possible! + if (proSlots==0) proSlots = new MemberList; if (sortBriefDocs) - proSlots.inSort(md); + proSlots->inSort(md); else - proSlots.append(md); - md->setSectionList(this,&proSlots); + proSlots->append(md); + md->setSectionList(this,proSlots); break; break; case Public: + if (pubSlots==0) pubSlots = new MemberList; if (sortBriefDocs) - pubSlots.inSort(md); + pubSlots->inSort(md); else - pubSlots.append(md); - md->setSectionList(this,&pubSlots); + pubSlots->append(md); + md->setSectionList(this,pubSlots); break; case Private: + if (priSlots==0) priSlots = new MemberList; if (sortBriefDocs) - priSlots.inSort(md); + priSlots->inSort(md); else - priSlots.append(md); - md->setSectionList(this,&priSlots); + priSlots->append(md); + md->setSectionList(this,priSlots); break; } break; @@ -314,32 +370,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proStaticAttribs==0) proStaticAttribs= new MemberList; if (sortBriefDocs) - proStaticAttribs.inSort(md); + proStaticAttribs->inSort(md); else - proStaticAttribs.append(md); - md->setSectionList(this,&proStaticAttribs); + proStaticAttribs->append(md); + md->setSectionList(this,proStaticAttribs); break; case Package: + if (pacStaticAttribs==0) pacStaticAttribs= new MemberList; if (sortBriefDocs) - pacStaticAttribs.inSort(md); + pacStaticAttribs->inSort(md); else - pacStaticAttribs.append(md); - md->setSectionList(this,&pacStaticAttribs); + pacStaticAttribs->append(md); + md->setSectionList(this,pacStaticAttribs); break; case Public: + if (pubStaticAttribs==0) pubStaticAttribs= new MemberList; if (sortBriefDocs) - pubStaticAttribs.inSort(md); + pubStaticAttribs->inSort(md); else - pubStaticAttribs.append(md); - md->setSectionList(this,&pubStaticAttribs); + pubStaticAttribs->append(md); + md->setSectionList(this,pubStaticAttribs); break; case Private: + if (priStaticAttribs==0) priStaticAttribs= new MemberList; if (sortBriefDocs) - priStaticAttribs.inSort(md); + priStaticAttribs->inSort(md); else - priStaticAttribs.append(md); - md->setSectionList(this,&priStaticAttribs); + priStaticAttribs->append(md); + md->setSectionList(this,priStaticAttribs); break; } } @@ -348,32 +408,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proStaticMethods==0) proStaticMethods = new MemberList; if (sortBriefDocs) - proStaticMethods.inSort(md); + proStaticMethods->inSort(md); else - proStaticMethods.append(md); - md->setSectionList(this,&proStaticMethods); + proStaticMethods->append(md); + md->setSectionList(this,proStaticMethods); break; case Package: + if (pacStaticMethods==0) pacStaticMethods = new MemberList; if (sortBriefDocs) - pacStaticMethods.inSort(md); + pacStaticMethods->inSort(md); else - pacStaticMethods.append(md); - md->setSectionList(this,&pacStaticMethods); + pacStaticMethods->append(md); + md->setSectionList(this,pacStaticMethods); break; case Public: + if (pubStaticMethods==0) pubStaticMethods = new MemberList; if (sortBriefDocs) - pubStaticMethods.inSort(md); + pubStaticMethods->inSort(md); else - pubStaticMethods.append(md); - md->setSectionList(this,&pubStaticMethods); + pubStaticMethods->append(md); + md->setSectionList(this,pubStaticMethods); break; case Private: + if (priStaticMethods==0) priStaticMethods = new MemberList; if (sortBriefDocs) - priStaticMethods.inSort(md); + priStaticMethods->inSort(md); else - priStaticMethods.append(md); - md->setSectionList(this,&priStaticMethods); + priStaticMethods->append(md); + md->setSectionList(this,priStaticMethods); break; } } @@ -385,32 +449,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proAttribs==0) proAttribs = new MemberList; if (sortBriefDocs) - proAttribs.inSort(md); + proAttribs->inSort(md); else - proAttribs.append(md); - md->setSectionList(this,&proAttribs); + proAttribs->append(md); + md->setSectionList(this,proAttribs); break; case Package: + if (pacAttribs==0) pacAttribs = new MemberList; if (sortBriefDocs) - pacAttribs.inSort(md); + pacAttribs->inSort(md); else - pacAttribs.append(md); - md->setSectionList(this,&pacAttribs); + pacAttribs->append(md); + md->setSectionList(this,pacAttribs); break; case Public: + if (pubAttribs==0) pubAttribs = new MemberList; if (sortBriefDocs) - pubAttribs.inSort(md); + pubAttribs->inSort(md); else - pubAttribs.append(md); - md->setSectionList(this,&pubAttribs); + pubAttribs->append(md); + md->setSectionList(this,pubAttribs); break; case Private: + if (priAttribs==0) priAttribs = new MemberList; if (sortBriefDocs) - priAttribs.inSort(md); + priAttribs->inSort(md); else - priAttribs.append(md); - md->setSectionList(this,&priAttribs); + priAttribs->append(md); + md->setSectionList(this,priAttribs); break; } } @@ -419,32 +487,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proTypes==0) proTypes = new MemberList; if (sortBriefDocs) - proTypes.inSort(md); + proTypes->inSort(md); else - proTypes.append(md); - md->setSectionList(this,&proTypes); + proTypes->append(md); + md->setSectionList(this,proTypes); break; case Package: + if (pacTypes==0) pacTypes = new MemberList; if (sortBriefDocs) - pacTypes.inSort(md); + pacTypes->inSort(md); else - pacTypes.append(md); - md->setSectionList(this,&pacTypes); + pacTypes->append(md); + md->setSectionList(this,pacTypes); break; case Public: + if (pubTypes==0) pubTypes = new MemberList; if (sortBriefDocs) - pubTypes.inSort(md); + pubTypes->inSort(md); else - pubTypes.append(md); - md->setSectionList(this,&pubTypes); + pubTypes->append(md); + md->setSectionList(this,pubTypes); break; case Private: + if (priTypes==0) priTypes = new MemberList; if (sortBriefDocs) - priTypes.inSort(md); + priTypes->inSort(md); else - priTypes.append(md); - md->setSectionList(this,&priTypes); + priTypes->append(md); + md->setSectionList(this,priTypes); break; } } @@ -453,32 +525,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proMethods==0) proMethods = new MemberList; if (sortBriefDocs) - proMethods.inSort(md); + proMethods->inSort(md); else - proMethods.append(md); - md->setSectionList(this,&proMethods); + proMethods->append(md); + md->setSectionList(this,proMethods); break; case Package: + if (pacMethods==0) pacMethods = new MemberList; if (sortBriefDocs) - pacMethods.inSort(md); + pacMethods->inSort(md); else - pacMethods.append(md); - md->setSectionList(this,&pacMethods); + pacMethods->append(md); + md->setSectionList(this,pacMethods); break; case Public: + if (pubMethods==0) pubMethods = new MemberList; if (sortBriefDocs) - pubMethods.inSort(md); + pubMethods->inSort(md); else - pubMethods.append(md); - md->setSectionList(this,&pubMethods); + pubMethods->append(md); + md->setSectionList(this,pubMethods); break; case Private: + if (priMethods==0) priMethods = new MemberList; if (sortBriefDocs) - priMethods.inSort(md); + priMethods->inSort(md); else - priMethods.append(md); - md->setSectionList(this,&priMethods); + priMethods->append(md); + md->setSectionList(this,priMethods); break; } } @@ -495,33 +571,37 @@ void ClassDef::internalInsertMember(MemberDef *md, ) || md->isFriend() ) { + if (relatedMembers==0) relatedMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - relatedMembers.inSort(md); + relatedMembers->inSort(md); else - relatedMembers.append(md); + relatedMembers->append(md); } else { switch (md->memberType()) { case MemberDef::Property: + if (propertyMembers==0) propertyMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - propertyMembers.inSort(md); + propertyMembers->inSort(md); else - propertyMembers.append(md); + propertyMembers->append(md); break; case MemberDef::Event: + if (eventMembers==0) eventMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - eventMembers.inSort(md); + eventMembers->inSort(md); else - eventMembers.append(md); + eventMembers->append(md); break; case MemberDef::Signal: // fall through case MemberDef::DCOP: + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); break; case MemberDef::Slot: switch (prot) @@ -529,18 +609,20 @@ void ClassDef::internalInsertMember(MemberDef *md, case Protected: case Package: case Public: + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); break; case Private: + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("EXTRACT_PRIVATE")) { if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); } break; } @@ -551,41 +633,47 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (md->memberType()) { case MemberDef::Typedef: + if (typedefMembers==0) typedefMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - typedefMembers.inSort(md); + typedefMembers->inSort(md); else - typedefMembers.append(md); + typedefMembers->append(md); break; case MemberDef::Enumeration: + if (enumMembers==0) enumMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - enumMembers.inSort(md); + enumMembers->inSort(md); else - enumMembers.append(md); + enumMembers->append(md); break; case MemberDef::EnumValue: + if (enumValMembers==0) enumValMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - enumValMembers.inSort(md); + enumValMembers->inSort(md); else - enumValMembers.append(md); + enumValMembers->append(md); break; case MemberDef::Function: if (md->isConstructor() || md->isDestructor()) { - constructors.append(md); + if (constructors==0) constructors = new MemberList; + constructors->append(md); } else { + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); } break; case MemberDef::Variable: + if (variableMembers==0) variableMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - variableMembers.inSort(md); + variableMembers->inSort(md); else - variableMembers.append(md); + variableMembers->append(md); break; default: err("Unexpected member type %d found!\n",md->memberType()); @@ -620,6 +708,11 @@ void ClassDef::internalInsertMember(MemberDef *md, MemberInfo *mi = new MemberInfo((MemberDef *)md, prot,md->virtualness(),FALSE); MemberNameInfo *mni=0; + if (m_allMemberNameInfoSDict==0) + { + m_allMemberNameInfoSDict = new MemberNameInfoSDict(17); + m_allMemberNameInfoSDict->setAutoDelete(TRUE); + } if ((mni=m_allMemberNameInfoSDict->find(md->name()))) { mni->append(mi); @@ -642,90 +735,99 @@ void ClassDef::insertMember(MemberDef *md) void ClassDef::computeAnchors() { ClassDef *context = Config_getBool("INLINE_INHERITED_MEMB") ? this : 0; - setAnchors(context,'a',&pubMethods); - setAnchors(context,'b',&proMethods); - setAnchors(context,'c',&pacMethods); - setAnchors(context,'d',&priMethods); - setAnchors(context,'e',&pubStaticMethods); - setAnchors(context,'f',&proStaticMethods); - setAnchors(context,'g',&pacStaticMethods); - setAnchors(context,'h',&priStaticMethods); - setAnchors(context,'i',&pubSlots); - setAnchors(context,'j',&proSlots); - setAnchors(context,'k',&priSlots); - setAnchors(context,'l',&signals); - setAnchors(context,'m',&related); - setAnchors(context,'n',&friends); - setAnchors(context,'o',&pubAttribs); - setAnchors(context,'p',&proAttribs); - setAnchors(context,'q',&pacAttribs); - setAnchors(context,'r',&priAttribs); - setAnchors(context,'s',&pubStaticAttribs); - setAnchors(context,'t',&proStaticAttribs); - setAnchors(context,'u',&pacStaticAttribs); - setAnchors(context,'v',&priStaticAttribs); - setAnchors(context,'w',&pubTypes); - setAnchors(context,'x',&proTypes); - setAnchors(context,'y',&priTypes); - setAnchors(context,'z',&dcopMethods); - setAnchors(context,'0',&properties); - setAnchors(context,'1',&events); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->setAnchors(context); + setAnchors(context,'a',pubMethods); + setAnchors(context,'b',proMethods); + setAnchors(context,'c',pacMethods); + setAnchors(context,'d',priMethods); + setAnchors(context,'e',pubStaticMethods); + setAnchors(context,'f',proStaticMethods); + setAnchors(context,'g',pacStaticMethods); + setAnchors(context,'h',priStaticMethods); + setAnchors(context,'i',pubSlots); + setAnchors(context,'j',proSlots); + setAnchors(context,'k',priSlots); + setAnchors(context,'l',signals); + setAnchors(context,'m',related); + setAnchors(context,'n',friends); + setAnchors(context,'o',pubAttribs); + setAnchors(context,'p',proAttribs); + setAnchors(context,'q',pacAttribs); + setAnchors(context,'r',priAttribs); + setAnchors(context,'s',pubStaticAttribs); + setAnchors(context,'t',proStaticAttribs); + setAnchors(context,'u',pacStaticAttribs); + setAnchors(context,'v',priStaticAttribs); + setAnchors(context,'w',pubTypes); + setAnchors(context,'x',proTypes); + setAnchors(context,'y',priTypes); + setAnchors(context,'z',dcopMethods); + setAnchors(context,'0',properties); + setAnchors(context,'1',events); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->setAnchors(context); + } } } void ClassDef::distributeMemberGroupDocumentation() { - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - mg->distributeMemberGroupDocumentation(); + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->distributeMemberGroupDocumentation(); + } } } void ClassDef::findSectionsInDocumentation() { docFindSections(documentation(),this,0,docFile()); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->findSectionsInDocumentation(); - } - pubTypes.findSectionsInDocumentation(); - pubMethods.findSectionsInDocumentation(); - pubAttribs.findSectionsInDocumentation(); - pubSlots.findSectionsInDocumentation(); - signals.findSectionsInDocumentation(); - dcopMethods.findSectionsInDocumentation(); - pubStaticMethods.findSectionsInDocumentation(); - pubStaticAttribs.findSectionsInDocumentation(); - pacTypes.findSectionsInDocumentation(); - pacMethods.findSectionsInDocumentation(); - pacAttribs.findSectionsInDocumentation(); - pacStaticMethods.findSectionsInDocumentation(); - pacStaticAttribs.findSectionsInDocumentation(); - proTypes.findSectionsInDocumentation(); - proMethods.findSectionsInDocumentation(); - proAttribs.findSectionsInDocumentation(); - proSlots.findSectionsInDocumentation(); - proStaticMethods.findSectionsInDocumentation(); - proStaticAttribs.findSectionsInDocumentation(); - priTypes.findSectionsInDocumentation(); - priMethods.findSectionsInDocumentation(); - priAttribs.findSectionsInDocumentation(); - priSlots.findSectionsInDocumentation(); - priStaticMethods.findSectionsInDocumentation(); - priStaticAttribs.findSectionsInDocumentation(); - friends.findSectionsInDocumentation(); - related.findSectionsInDocumentation(); - properties.findSectionsInDocumentation(); - events.findSectionsInDocumentation(); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->findSectionsInDocumentation(); + } + } + if (pubTypes) pubTypes->findSectionsInDocumentation(); + if (pubMethods) pubMethods->findSectionsInDocumentation(); + if (pubAttribs) pubAttribs->findSectionsInDocumentation(); + if (pubSlots) pubSlots->findSectionsInDocumentation(); + if (signals) signals->findSectionsInDocumentation(); + if (dcopMethods) dcopMethods->findSectionsInDocumentation(); + if (pubStaticMethods) pubStaticMethods->findSectionsInDocumentation(); + if (pubStaticAttribs) pubStaticAttribs->findSectionsInDocumentation(); + if (pacTypes) pacTypes->findSectionsInDocumentation(); + if (pacMethods) pacMethods->findSectionsInDocumentation(); + if (pacAttribs) pacAttribs->findSectionsInDocumentation(); + if (pacStaticMethods) pacStaticMethods->findSectionsInDocumentation(); + if (pacStaticAttribs) pacStaticAttribs->findSectionsInDocumentation(); + if (proTypes) proTypes->findSectionsInDocumentation(); + if (proMethods) proMethods->findSectionsInDocumentation(); + if (proAttribs) proAttribs->findSectionsInDocumentation(); + if (proSlots) proSlots->findSectionsInDocumentation(); + if (proStaticMethods) proStaticMethods->findSectionsInDocumentation(); + if (proStaticAttribs) proStaticAttribs->findSectionsInDocumentation(); + if (priTypes) priTypes->findSectionsInDocumentation(); + if (priMethods) priMethods->findSectionsInDocumentation(); + if (priAttribs) priAttribs->findSectionsInDocumentation(); + if (priSlots) priSlots->findSectionsInDocumentation(); + if (priStaticMethods) priStaticMethods->findSectionsInDocumentation(); + if (priStaticAttribs) priStaticAttribs->findSectionsInDocumentation(); + if (friends) friends->findSectionsInDocumentation(); + if (related) related->findSectionsInDocumentation(); + if (properties) properties->findSectionsInDocumentation(); + if (events) events->findSectionsInDocumentation(); } @@ -920,7 +1022,7 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType ol.parseDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE); } // write examples - if (exampleFlag) + if (exampleFlag && m_exampleSDict) { ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": "); ol.writeDescItem(); @@ -1042,7 +1144,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.writeString(""); - if (m_inherits->count()>0) + if (m_inherits && m_inherits->count()>0) { BaseClassListIterator bli(*m_inherits); ol.writeString(" member %s of class %s!\n", rname.data(),cd->name().data()); - addMethodToClass(root,cd,rname,isFriend); + addMethodToClass(rootNav,cd,rname,isFriend); } - else if (root->parent && - !((root->parent->section & Entry::COMPOUND_MASK) - || root->parent->section==Entry::OBJCIMPL_SEC + else if (!((rootNav->parent()->section() & Entry::COMPOUND_MASK) + || rootNav->parent()->section()==Entry::OBJCIMPL_SEC ) && !isMember && (root->relates.isEmpty() || root->relatesDup) && @@ -2678,9 +2724,9 @@ static void buildFunctionList(Entry *root) { NamespaceDef *mnd = md->getNamespaceDef(); NamespaceDef *rnd = 0; - if (!root->parent->name.isEmpty()) + if (!rootNav->parent()->name().isEmpty()) { - rnd = getResolvedNamespace(root->parent->name); + rnd = getResolvedNamespace(rootNav->parent()->name()); } FileDef *mfd = md->getFileDef(); QCString nsName,rnsName; @@ -2792,7 +2838,7 @@ static void buildFunctionList(Entry *root) root->protection,root->virt,root->stat,FALSE, MemberDef::Function,tArgList,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); md->setDocumentation(root->doc,root->docFile,root->docLine); @@ -2802,8 +2848,7 @@ static void buildFunctionList(Entry *root) md->setDocsForDefinition(!root->proto); //md->setBody(root->body); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->addSectionsToDefinition(root->anchors); md->setMemberSpecifiers(root->memSpec); @@ -2811,9 +2856,9 @@ static void buildFunctionList(Entry *root) // see if the function is inside a namespace that was not part of // the name already (in that case nd should be non-zero already) - if (nd==0 && root->parent->section == Entry::NAMESPACE_SEC ) + if (nd==0 && rootNav->parent()->section() == Entry::NAMESPACE_SEC ) { - QCString nscope=removeAnonymousScopes(root->parent->name); + QCString nscope=removeAnonymousScopes(rootNav->parent()->name()); if (!nscope.isEmpty()) { nd = getResolvedNamespace(nscope); @@ -2860,7 +2905,7 @@ static void buildFunctionList(Entry *root) " `%s' `%s'::`%s' `%s' proto=%d\n" " def=`%s'\n", root->type.data(), - root->parent->name.data(), + rootNav->parent()->name().data(), rname.data(), root->args.data(), root->proto, @@ -2906,15 +2951,14 @@ static void buildFunctionList(Entry *root) if (!root->relatesDup) // if this is a relatesalso command, allow find // Member to pick it up { - root->section = Entry::EMPTY_SEC; // Otherwise we have finished - // with this entry. + rootNav->changeSection(Entry::EMPTY_SEC); // Otherwise we have finished + // with this entry. } } else { - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); if (fd) { // add member to the file (we do this even if we have already @@ -2933,13 +2977,10 @@ static void buildFunctionList(Entry *root) "Warning: Illegal member name found." ); } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildFunctionList(e); - } + RECURSE_ENTRYTREE(buildFunctionList,rootNav); } //---------------------------------------------------------------------- @@ -3404,7 +3445,7 @@ enum FindBaseClassRelation_Mode }; static bool findClassRelation( - Entry *root, + EntryNav *rootNav, Definition *context, ClassDef *cd, BaseInfo *bi, @@ -3415,7 +3456,7 @@ static bool findClassRelation( ); -static void findUsedClassesForClass(Entry *root, +static void findUsedClassesForClass(EntryNav *rootNav, Definition *context, ClassDef *masterCd, ClassDef *instanceCd, @@ -3426,141 +3467,144 @@ static void findUsedClassesForClass(Entry *root, { masterCd->visited=TRUE; ArgumentList *formalArgs = masterCd->templateArguments(); - MemberNameInfoSDict::Iterator mnili(*masterCd->memberNameInfoSDict()); - MemberNameInfo *mni; - for (;(mni=mnili.current());++mnili) - { - MemberNameInfoIterator mnii(*mni); - MemberInfo *mi; - for (mnii.toFirst();(mi=mnii.current());++mnii) - { - MemberDef *md=mi->memberDef; - if (md->isVariable()) // for each member variable in this class - { - //printf(" Found variable %s in class %s\n",md->name().data(),masterCd->name().data()); - QCString type=removeRedundantWhiteSpace(md->typeString()); - int pos=0; - QCString usedClassName; - QCString templSpec; - bool found=FALSE; - // the type can contain template variables, replace them if present - if (actualArgs) - { - type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs); - } - - //printf(" template substitution gives=%s\n",type.data()); - while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec)!=-1) + if (masterCd->memberNameInfoSDict()) + { + MemberNameInfoSDict::Iterator mnili(*masterCd->memberNameInfoSDict()); + MemberNameInfo *mni; + for (;(mni=mnili.current());++mnili) + { + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for (mnii.toFirst();(mi=mnii.current());++mnii) + { + MemberDef *md=mi->memberDef; + if (md->isVariable()) // for each member variable in this class { - // find the type (if any) that matches usedClassName - ClassDef *typeCd = getResolvedClass(masterCd, - masterCd->getFileDef(), - usedClassName, - 0,0, - FALSE,TRUE - ); - //printf("====> usedClassName=%s -> typeCd=%s\n", - // usedClassName.data(),typeCd?typeCd->name().data():""); - if (typeCd) - { - usedClassName = typeCd->name(); - } - - int sp=usedClassName.find('<'); - if (sp==-1) sp=0; - int si=usedClassName.findRev("::",sp); - if (si!=-1) + //printf(" Found variable %s in class %s\n",md->name().data(),masterCd->name().data()); + QCString type=removeRedundantWhiteSpace(md->typeString()); + int pos=0; + QCString usedClassName; + QCString templSpec; + bool found=FALSE; + // the type can contain template variables, replace them if present + if (actualArgs) { - // replace any namespace aliases - replaceNamespaceAliases(usedClassName,si); + type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs); } - // add any template arguments to the class - QCString usedName = removeRedundantWhiteSpace(usedClassName+templSpec); - //printf(" usedName=%s\n",usedName.data()); - bool delTempNames=FALSE; - if (templateNames==0) + //printf(" template substitution gives=%s\n",type.data()); + while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec)!=-1) { - templateNames = getTemplateArgumentsInName(formalArgs,usedName); - delTempNames=TRUE; - } - BaseInfo bi(usedName,Public,Normal); - findClassRelation(root,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial); + // find the type (if any) that matches usedClassName + ClassDef *typeCd = getResolvedClass(masterCd, + masterCd->getFileDef(), + usedClassName, + 0,0, + FALSE,TRUE + ); + //printf("====> usedClassName=%s -> typeCd=%s\n", + // usedClassName.data(),typeCd?typeCd->name().data():""); + if (typeCd) + { + usedClassName = typeCd->name(); + } - if (masterCd->templateArguments()) - { - ArgumentListIterator ali(*masterCd->templateArguments()); - Argument *arg; - int count=0; - for (ali.toFirst();(arg=ali.current());++ali,++count) + int sp=usedClassName.find('<'); + if (sp==-1) sp=0; + int si=usedClassName.findRev("::",sp); + if (si!=-1) + { + // replace any namespace aliases + replaceNamespaceAliases(usedClassName,si); + } + // add any template arguments to the class + QCString usedName = removeRedundantWhiteSpace(usedClassName+templSpec); + //printf(" usedName=%s\n",usedName.data()); + + bool delTempNames=FALSE; + if (templateNames==0) { - if (arg->name==usedName) // type is a template argument + templateNames = getTemplateArgumentsInName(formalArgs,usedName); + delTempNames=TRUE; + } + BaseInfo bi(usedName,Public,Normal); + findClassRelation(rootNav,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial); + + if (masterCd->templateArguments()) + { + ArgumentListIterator ali(*masterCd->templateArguments()); + Argument *arg; + int count=0; + for (ali.toFirst();(arg=ali.current());++ali,++count) { - found=TRUE; - Debug::print(Debug::Classes,0," New used class `%s'\n", usedName.data()); - - ClassDef *usedCd = Doxygen::hiddenClasses.find(usedName); - if (usedCd==0) - { - usedCd = new ClassDef( - masterCd->getDefFileName(),masterCd->getDefLine(), - usedName,ClassDef::Class); - //printf("making %s a template argument!!!\n",usedCd->name().data()); - usedCd->makeTemplateArgument(); - Doxygen::hiddenClasses.append(usedName,usedCd); - } - if (usedCd) + if (arg->name==usedName) // type is a template argument { - if (isArtificial) usedCd->setClassIsArtificial(); - Debug::print(Debug::Classes,0," Adding used class `%s' (1)\n", usedCd->name().data()); - instanceCd->addUsedClass(usedCd,md->name()); - usedCd->addUsedByClass(instanceCd,md->name()); + found=TRUE; + Debug::print(Debug::Classes,0," New used class `%s'\n", usedName.data()); + + ClassDef *usedCd = Doxygen::hiddenClasses.find(usedName); + if (usedCd==0) + { + usedCd = new ClassDef( + masterCd->getDefFileName(),masterCd->getDefLine(), + usedName,ClassDef::Class); + //printf("making %s a template argument!!!\n",usedCd->name().data()); + usedCd->makeTemplateArgument(); + Doxygen::hiddenClasses.append(usedName,usedCd); + } + if (usedCd) + { + if (isArtificial) usedCd->setClassIsArtificial(); + Debug::print(Debug::Classes,0," Adding used class `%s' (1)\n", usedCd->name().data()); + instanceCd->addUsedClass(usedCd,md->name()); + usedCd->addUsedByClass(instanceCd,md->name()); + } } } } - } - if (!found) - { - ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName); - //printf("Looking for used class %s: result=%s master=%s\n", - // usedName.data(),usedCd?usedCd->name().data():"",masterCd?masterCd->name().data():""); + if (!found) + { + ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName); + //printf("Looking for used class %s: result=%s master=%s\n", + // usedName.data(),usedCd?usedCd->name().data():"",masterCd?masterCd->name().data():""); - if (usedCd) + if (usedCd) + { + found=TRUE; + Debug::print(Debug::Classes,0," Adding used class `%s' (2)\n", usedCd->name().data()); + instanceCd->addUsedClass(usedCd,md->name()); // class exists + usedCd->addUsedByClass(instanceCd,md->name()); + } + } + if (delTempNames) { - found=TRUE; - Debug::print(Debug::Classes,0," Adding used class `%s' (2)\n", usedCd->name().data()); - instanceCd->addUsedClass(usedCd,md->name()); // class exists - usedCd->addUsedByClass(instanceCd,md->name()); + delete templateNames; + templateNames=0; } } - if (delTempNames) - { - delete templateNames; - templateNames=0; - } - } - if (!found && !type.isEmpty()) // used class is not documented in any scope - { - ClassDef *usedCd = Doxygen::hiddenClasses.find(type); - if (usedCd==0 && !Config_getBool("HIDE_UNDOC_RELATIONS")) - { - if (type.right(2)=="(*") // type is a function pointer - { - type+=md->argsString(); - } - Debug::print(Debug::Classes,0," New undocumented used class `%s'\n", type.data()); - usedCd = new ClassDef( - masterCd->getDefFileName(),masterCd->getDefLine(), - type,ClassDef::Class); - Doxygen::hiddenClasses.append(type,usedCd); - } - if (usedCd) + if (!found && !type.isEmpty()) // used class is not documented in any scope { - if (isArtificial) usedCd->setClassIsArtificial(); - Debug::print(Debug::Classes,0," Adding used class `%s' (3)\n", usedCd->name().data()); - instanceCd->addUsedClass(usedCd,md->name()); - usedCd->addUsedByClass(instanceCd,md->name()); + ClassDef *usedCd = Doxygen::hiddenClasses.find(type); + if (usedCd==0 && !Config_getBool("HIDE_UNDOC_RELATIONS")) + { + if (type.right(2)=="(*") // type is a function pointer + { + type+=md->argsString(); + } + Debug::print(Debug::Classes,0," New undocumented used class `%s'\n", type.data()); + usedCd = new ClassDef( + masterCd->getDefFileName(),masterCd->getDefLine(), + type,ClassDef::Class); + Doxygen::hiddenClasses.append(type,usedCd); + } + if (usedCd) + { + if (isArtificial) usedCd->setClassIsArtificial(); + Debug::print(Debug::Classes,0," Adding used class `%s' (3)\n", usedCd->name().data()); + instanceCd->addUsedClass(usedCd,md->name()); + usedCd->addUsedByClass(instanceCd,md->name()); + } } } } @@ -3569,7 +3613,7 @@ static void findUsedClassesForClass(Entry *root, } static void findBaseClassesForClass( - Entry *root, + EntryNav *rootNav, Definition *context, ClassDef *masterCd, ClassDef *instanceCd, @@ -3579,6 +3623,7 @@ static void findBaseClassesForClass( QDict *templateNames=0 ) { + Entry *root = rootNav->entry(); //if (masterCd->visited) return; masterCd->visited=TRUE; // The base class could ofcouse also be a non-nested class @@ -3605,18 +3650,18 @@ static void findBaseClassesForClass( if (mode==DocumentedOnly) { // find a documented base class in the correct scope - if (!findClassRelation(root,context,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial)) + if (!findClassRelation(rootNav,context,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial)) { if (!Config_getBool("HIDE_UNDOC_RELATIONS")) { // no documented base class -> try to find an undocumented one - findClassRelation(root,context,instanceCd,&tbi,templateNames,Undocumented,isArtificial); + findClassRelation(rootNav,context,instanceCd,&tbi,templateNames,Undocumented,isArtificial); } } } else if (mode==TemplateInstances) { - findClassRelation(root,context,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial); + findClassRelation(rootNav,context,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial); } if (delTempNames) { @@ -3666,19 +3711,24 @@ static bool findTemplateInstanceRelation(Entry *root, // search for new template instances caused by base classes of // instanceClass - Entry *templateRoot = classEntries.find(templateClass->name()); - if (templateRoot) + EntryNav *templateRootNav = classEntries.find(templateClass->name()); + if (templateRootNav) { + templateRootNav->loadEntry(g_storage); + Entry *templateRoot = templateRootNav->entry(); + Debug::print(Debug::Classes,0," template root found %s templSpec=%s!\n", templateRoot->name.data(),templSpec.data()); ArgumentList *templArgs = new ArgumentList; stringToArgumentList(templSpec,templArgs); - findBaseClassesForClass(templateRoot,context,templateClass,instanceClass, + findBaseClassesForClass(templateRootNav,context,templateClass,instanceClass, TemplateInstances,isArtificial,templArgs,templateNames); - findUsedClassesForClass(templateRoot,context,templateClass,instanceClass, + findUsedClassesForClass(templateRootNav,context,templateClass,instanceClass, isArtificial,templArgs,templateNames); delete templArgs; + + templateRootNav->releaseEntry(); } else { @@ -3788,7 +3838,7 @@ static int findEndOfTemplate(const QCString &s,int startPos) } static bool findClassRelation( - Entry *root, + EntryNav *rootNav, Definition *context, ClassDef *cd, BaseInfo *bi, @@ -3810,6 +3860,8 @@ static bool findClassRelation( //} //printf("\n"); + Entry *root = rootNav->entry(); + QCString biName=bi->name; bool explicitGlobalScope=FALSE; if (biName.left(2)=="::") // explicit global scope @@ -3819,12 +3871,12 @@ static bool findClassRelation( } //printf("biName=`%s'\n",biName.data()); - Entry *parentNode=root->parent; + EntryNav *parentNode=rootNav->parent(); bool lastParent=FALSE; do // for each parent scope, starting with the largest scope // (in case of nested classes) { - QCString scopeName= parentNode ? parentNode->name.data() : ""; + QCString scopeName= parentNode ? parentNode->name().data() : ""; int scopeOffset=explicitGlobalScope ? 0 : scopeName.length(); do // try all parent scope prefixes, starting with the largest scope { @@ -3861,12 +3913,12 @@ static bool findClassRelation( // ) // Check for base class with the same name. // // If found then look in the outer scope for a match // // and prevent recursion. - if (!isRecursiveBaseClass(root->name,baseClassName) || explicitGlobalScope) + if (!isRecursiveBaseClass(rootNav->name(),baseClassName) || explicitGlobalScope) { Debug::print( Debug::Classes,0," class relation %s inherited/used by %s found (%s and %s)\n", baseClassName.data(), - root->name.data(), + rootNav->name().data(), (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), (bi->virt==Normal)?"normal":"virtual" ); @@ -4037,7 +4089,7 @@ static bool findClassRelation( } else { - parentNode=parentNode->parent; + parentNode=parentNode->parent(); } } while (lastParent); @@ -4047,40 +4099,38 @@ static bool findClassRelation( //---------------------------------------------------------------------- // Computes the base and super classes for each class in the tree -static bool isClassSection(Entry *root) +static bool isClassSection(EntryNav *rootNav) { - return - ( - ( - ( - // is it a compound (class, struct, union, interface ...) - root->section & Entry::COMPOUND_MASK - ) - || - ( + if ( !rootNav->name().isEmpty() ) + { + if (rootNav->section() & Entry::COMPOUND_MASK) + // is it a compound (class, struct, union, interface ...) + { + return TRUE; + } + else if (rootNav->section() & Entry::COMPOUNDDOC_MASK) // is it a documentation block with inheritance info. - (root->section & Entry::COMPOUNDDOC_MASK) && root->extends->count()>0 - ) - ) - && !root->name.isEmpty() // sanity check - ); + { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + bool extends = root->extends->count()>0; + rootNav->releaseEntry(); + if (extends) return TRUE; + } + } + return FALSE; } /*! Builds a dictionary of all entry nodes in the tree starting with \a root */ -static void findClassEntries(Entry *root) +static void findClassEntries(EntryNav *rootNav) { - if (isClassSection(root)) + if (isClassSection(rootNav)) { - classEntries.insert(root->name,root); - } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findClassEntries(e); + classEntries.insert(rootNav->name(),rootNav); } + RECURSE_ENTRYTREE(findClassEntries,rootNav); } /*! Using the dictionary build by findClassEntries(), this @@ -4092,19 +4142,21 @@ static void findInheritedTemplateInstances() { ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { ClassDef *cd; // strip any annonymous scopes first - QCString bName=stripAnonymousNamespaceScope(root->name); + QCString bName=stripAnonymousNamespaceScope(rootNav->name()); bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { + rootNav->loadEntry(g_storage); //printf("Class %s %d\n",cd->name().data(),root->extends->count()); - findBaseClassesForClass(root,cd,cd,cd,TemplateInstances,FALSE); + findBaseClassesForClass(rootNav,cd,cd,cd,TemplateInstances,FALSE); + rootNav->releaseEntry(); } } } @@ -4113,18 +4165,20 @@ static void findUsedTemplateInstances() { ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { ClassDef *cd; // strip any annonymous scopes first - QCString bName=stripAnonymousNamespaceScope(root->name); + QCString bName=stripAnonymousNamespaceScope(rootNav->name()); bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { - findUsedClassesForClass(root,cd,cd,cd,TRUE); + rootNav->loadEntry(g_storage); + findUsedClassesForClass(rootNav,cd,cd,cd,TRUE); + rootNav->releaseEntry(); } } } @@ -4133,19 +4187,22 @@ static void computeClassRelations() { ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { ClassDef *cd; + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + // strip any annonymous scopes first - QCString bName=stripAnonymousNamespaceScope(root->name); + QCString bName=stripAnonymousNamespaceScope(rootNav->name()); bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { - findBaseClassesForClass(root,cd,cd,cd,DocumentedOnly,FALSE); + findBaseClassesForClass(rootNav,cd,cd,cd,DocumentedOnly,FALSE); } if ((cd==0 || (!cd->hasDocumentation() && !cd->isReference())) && bName.right(2)!="::") @@ -4162,15 +4219,20 @@ static void computeClassRelations() root->name.data() ); } + + rootNav->releaseEntry(); } } static void computeTemplateClassRelations() { - QDictIterator edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString bName=stripAnonymousNamespaceScope(root->name); bName=stripTemplateSpecifiersFromScope(bName); ClassDef *cd=getClass(bName); @@ -4224,10 +4286,10 @@ static void computeTemplateClassRelations() tbi.name = substituteTemplateArgumentsInString(bi->name,tl,templArgs); // find a documented base class in the correct scope - if (!findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE)) + if (!findClassRelation(rootNav,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE)) { // no documented base class -> try to find an undocumented one - findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,Undocumented,FALSE); + findClassRelation(rootNav,cd,tcd,&tbi,actualTemplateNames,Undocumented,FALSE); } delete actualTemplateNames; } @@ -4236,6 +4298,8 @@ static void computeTemplateClassRelations() delete templArgs; } // class has no base classes } + + rootNav->releaseEntry(); } } @@ -4350,13 +4414,14 @@ static void addListReferences() // set the function declaration of the member to `funcDecl'. If the boolean // over_load is set the standard overload text is added. -static void addMemberDocs(Entry *root, +static void addMemberDocs(EntryNav *rootNav, MemberDef *md, const char *funcDecl, ArgumentList *al, bool over_load, NamespaceSDict * ) { + Entry *root = rootNav->entry(); //printf("addMemberDocs: `%s'::`%s' `%s' funcDecl=`%s' memSpec=%d\n", // root->parent->name.data(),md->name().data(),md->argsString(),funcDecl,root->memSpec); QCString fDecl=funcDecl; @@ -4375,8 +4440,7 @@ static void addMemberDocs(Entry *root, if (!fullName.isEmpty()) fullName+="::"; fullName+=md->name(); - bool ambig; - FileDef *rfd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *rfd=rootNav->fileDef(); // TODO determine scope based on root not md Definition *rscope = md->getOuterScope(); @@ -4419,7 +4483,7 @@ static void addMemberDocs(Entry *root, if ( /* !md->isStatic() && !root->stat && do not replace doc of a static */ ( md->documentation().isEmpty() || /* no docs yet */ - (root->parent->name.isEmpty() && /* or overwrite prototype docs */ + (rootNav->parent()->name().isEmpty() && /* or overwrite prototype docs */ !root->proto && md->isPrototype() /* with member definition docs */ ) ) && !root->doc.isEmpty() @@ -4437,7 +4501,7 @@ static void addMemberDocs(Entry *root, if ( /* !md->isStatic() && !root->stat && do not replace doc of static */ ( md->briefDescription().isEmpty() || /* no docs yet */ - !root->parent->name.isEmpty() /* member of a class */ + !rootNav->parent()->name().isEmpty() /* member of a class */ ) && !root->brief.isEmpty() ) { @@ -4447,7 +4511,7 @@ static void addMemberDocs(Entry *root, if ( (md->inbodyDocumentation().isEmpty() || - !root->parent->name.isEmpty() + !rootNav->parent()->name().isEmpty() ) && !root->inbodyDocs.isEmpty() ) { @@ -4523,13 +4587,14 @@ static ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd, // with name `name' and argument list `args' (for overloading) and // function declaration `decl' to the corresponding member definition. -static bool findGlobalMember(Entry *root, +static bool findGlobalMember(EntryNav *rootNav, const QCString &namespaceName, const char *name, const char *tempArg, const char *, const char *decl) { + Entry *root = rootNav->entry(); Debug::print(Debug::FindMembers,0, "2. findGlobalMember(namespace=%s,name=%s,tempArg=%s,decl=%s)\n", namespaceName.data(),name,tempArg,decl); @@ -4550,13 +4615,12 @@ static bool findGlobalMember(Entry *root, bool found=FALSE; for (mni.toFirst();(md=mni.current()) && !found;++mni) { - bool ambig; NamespaceDef *nd=md->getNamespaceDef(); //printf("Namespace namespaceName=%s nd=%s\n", // namespaceName.data(),nd ? nd->name().data() : ""); - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); //printf("File %s\n",fd ? fd->name().data() : ""); NamespaceSDict *nl = fd ? fd->getUsedNamespaces() : 0; //SDict *cl = fd ? fd->getUsedClasses() : 0; @@ -4585,6 +4649,10 @@ static bool findGlobalMember(Entry *root, rnd ? rnd : Doxygen::globalScope,fd,root->argList, FALSE); + //printf("%s<->%s\n", + // argListToString(md->argumentList()).data(), + // argListToString(root->argList).data()); + // for static members we also check if the comment block was found in // the same file. This is needed because static members with the same // name can be in different files. Thus it would be wrong to just @@ -4599,7 +4667,7 @@ static bool findGlobalMember(Entry *root, if (matching) // add docs to the member { Debug::print(Debug::FindMembers,0,"5. Match found\n"); - addMemberDocs(root,md,decl,root->argList,FALSE); + addMemberDocs(rootNav,md,decl,root->argList,FALSE); found=TRUE; } } @@ -4627,7 +4695,7 @@ static bool findGlobalMember(Entry *root, root->type!="friend union") { warn(root->fileName,root->startLine, - "Warning: documented function `%s' was not defined.",decl + "Warning: documented function `%s' was not declared or defined.",decl ); } } @@ -4763,12 +4831,14 @@ static void substituteTemplatesInArgList( * The boolean \a isFunc is a hint that indicates that this is a function * instead of a variable or typedef. */ -static void findMember(Entry *root, +static void findMember(EntryNav *rootNav, QCString funcDecl, bool overloaded, bool isFunc ) { + Entry *root = rootNav->entry(); + Debug::print(Debug::FindMembers,0, "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d," "isFunc=%d mGrpId=%d tArgList=%p (#=%d) " @@ -4872,15 +4942,15 @@ static void findMember(Entry *root, if (getClass(root->relates)==0 && !scopeName.isEmpty()) scopeName= mergeScopes(scopeName,root->relates); else - scopeName = root->relates.copy(); + scopeName = root->relates; } - if (root->relates.isEmpty() && root->parent && - (root->parent->section&Entry::SCOPE_MASK) && - !root->parent->name.isEmpty()) // see if we can combine scopeName + if (root->relates.isEmpty() && rootNav->parent() && + (rootNav->parent()->section()&Entry::SCOPE_MASK) && + !rootNav->parent()->name().isEmpty()) // see if we can combine scopeName // with the scope in which it was found { - QCString joinedName = root->parent->name+"::"+scopeName; + QCString joinedName = rootNav->parent()->name()+"::"+scopeName; if (!scopeName.isEmpty() && (getClass(joinedName) || Doxygen::namespaceSDict[joinedName])) { @@ -4888,13 +4958,12 @@ static void findMember(Entry *root, } else { - scopeName = mergeScopes(root->parent->name,scopeName); + scopeName = mergeScopes(rootNav->parent()->name(),scopeName); } } else // see if we can prefix a namespace or class that is used from the file { - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); if (fd) { NamespaceSDict *fnl = fd->getUsedNamespaces(); @@ -5095,8 +5164,7 @@ static void findMember(Entry *root, md->argsString(), root->fileName.data()); //printf("Member %s (member scopeName=%s) (this scopeName=%s) classTempList=%s\n",md->name().data(),cd->name().data(),scopeName.data(),classTempList.data()); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); NamespaceDef *nd=0; if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName); @@ -5189,7 +5257,7 @@ static void findMember(Entry *root, // TODO: copy other aspects? root->protection=md->protection(); // copy protection level - addMethodToClass(root,cd,md->name(),isFriend); + addMethodToClass(rootNav,cd,md->name(),isFriend); return; } delete argList; @@ -5197,13 +5265,14 @@ static void findMember(Entry *root, } if (matching) { - addMemberDocs(root,md,funcDecl,0,overloaded,0/* TODO */); + addMemberDocs(rootNav,md,funcDecl,0,overloaded,0/* TODO */); count++; memFound=TRUE; } } } - if (count==0 && root->parent && root->parent->section==Entry::OBJCIMPL_SEC) + if (count==0 && rootNav->parent() && + rootNav->parent()->section()==Entry::OBJCIMPL_SEC) { goto localObjCMethod; } @@ -5222,7 +5291,7 @@ static void findMember(Entry *root, if (root->tArgLists && md->templateArguments() && root->tArgLists->getLast()->count()<=md->templateArguments()->count()) { - addMethodToClass(root,cd,md->name(),isFriend); + addMethodToClass(rootNav,cd,md->name(),isFriend); return; } candidates++; @@ -5285,7 +5354,7 @@ static void findMember(Entry *root, root->protection,root->virt,root->stat,FALSE, mtype,tArgList,root->argList); //printf("new specialized member %s args=`%s'\n",md->name().data(),funcArgs.data()); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); md->setTemplateSpecialization(TRUE); md->setDefinition(funcDecl); @@ -5297,8 +5366,7 @@ static void findMember(Entry *root, md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); @@ -5347,7 +5415,7 @@ static void findMember(Entry *root, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,TRUE, mtype,tArgList,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); @@ -5361,8 +5429,7 @@ static void findMember(Entry *root, md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); @@ -5374,7 +5441,7 @@ static void findMember(Entry *root, } else // unrelated function with the same name as a member { - if (!findGlobalMember(root,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) + if (!findGlobalMember(rootNav,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) { QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); @@ -5410,8 +5477,7 @@ static void findMember(Entry *root, } } - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); if ((mn=Doxygen::memberNameSDict[funcName])==0) { @@ -5434,7 +5500,7 @@ static void findMember(Entry *root, { //printf("addMemberDocs for related member %s\n",root->name.data()); //rmd->setMemberDefTemplateArguments(root->mtArgList); - addMemberDocs(root,rmd,funcDecl,0,overloaded); + addMemberDocs(rootNav,rmd,funcDecl,0,overloaded); } } @@ -5463,7 +5529,7 @@ static void findMember(Entry *root, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,TRUE, mtype,tArgList,funcArgs.isEmpty() ? 0 : root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); //printf("Related member name=`%s' decl=`%s' bodyLine=`%d'\n", // funcName.data(),funcDecl.data(),root->bodyLine); @@ -5537,7 +5603,7 @@ static void findMember(Entry *root, } if (root->relatesDup) { - if (!findGlobalMember(root,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) + if (!findGlobalMember(rootNav,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) { QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); @@ -5557,21 +5623,20 @@ static void findMember(Entry *root, ); } } - else if (root->parent && root->parent->section==Entry::OBJCIMPL_SEC) + else if (rootNav->parent() && rootNav->parent()->section()==Entry::OBJCIMPL_SEC) { localObjCMethod: ClassDef *cd; //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); if (Config_getBool("EXTRACT_LOCAL_METHODS") && (cd=getClass(scopeName))) { - bool ambig; //printf("Local objective C method `%s' of class `%s' found\n",root->name.data(),cd->name().data()); MemberDef *md=new MemberDef( root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,FALSE, MemberDef::Function,0,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->makeImplementationDetail(); md->setMemberClass(cd); md->setDefinition(funcDecl); @@ -5584,7 +5649,7 @@ localObjCMethod: md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBodySegment(root->bodyLine,root->endBodyLine); - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); @@ -5609,7 +5674,7 @@ localObjCMethod: } else // unrelated not overloaded member found { - bool globMem = findGlobalMember(root,namespaceName,funcName,funcTempList,funcArgs,funcDecl); + bool globMem = findGlobalMember(rootNav,namespaceName,funcName,funcTempList,funcArgs,funcDecl); if (className.isEmpty() && !globMem) { warn(root->fileName,root->startLine, @@ -5638,23 +5703,24 @@ localObjCMethod: // find the members corresponding to the different documentation blocks // that are extracted from the sources. -static void findMemberDocumentation(Entry *root) +static void filterMemberDocumentation(EntryNav *rootNav) { + Entry *root = rootNav->entry(); int i=-1,l; Debug::print(Debug::FindMembers,0, - "findMemberDocumentation(): root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n", - root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId - ); + "findMemberDocumentation(): root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n", + root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId + ); bool isFunc=TRUE; if (root->relatesDup && !root->relates.isEmpty()) { - QCString tmp = root->relates; - root->relates.resize(0); - findMemberDocumentation(root); - root->relates = tmp; + QCString tmp = root->relates; + root->relates.resize(0); + filterMemberDocumentation(rootNav); + root->relates = tmp; } - + if ( // detect func variable/typedef to func ptr (i=findFunctionPtr(root->type,&l))!=-1 ) @@ -5667,7 +5733,7 @@ static void findMemberDocumentation(Entry *root) isFunc=FALSE; } else if ((root->type.left(8)=="typedef " && root->args.find('(')!=-1)) - // detect function types marked as functions + // detect function types marked as functions { isFunc=FALSE; } @@ -5680,105 +5746,134 @@ static void findMemberDocumentation(Entry *root) //if (root->relates.length()) printf(" Relates %s\n",root->relates.data()); if (root->type.isEmpty()) { - findMember(root,root->name+root->args+root->exception,FALSE,isFunc); + findMember(rootNav,root->name+root->args+root->exception,FALSE,isFunc); } else { - findMember(root,root->type+" "+root->name+root->args+root->exception,FALSE,isFunc); + findMember(rootNav,root->type+" "+root->name+root->args+root->exception,FALSE,isFunc); } } else if (root->section==Entry::OVERLOADDOC_SEC) { //printf("Overloaded member %s found\n",root->name.data()); - findMember(root,root->name,TRUE,isFunc); + findMember(rootNav,root->name,TRUE,isFunc); } else if ((root->section==Entry::FUNCTION_SEC // function || (root->section==Entry::VARIABLE_SEC && // variable - !root->type.isEmpty() && // with a type - compoundKeywordDict.find(root->type)==0 // that is not a keyword - // (to skip forward declaration of class etc.) + !root->type.isEmpty() && // with a type + compoundKeywordDict.find(root->type)==0 // that is not a keyword + // (to skip forward declaration of class etc.) ) ) ) - { - //printf("Documentation for member `%s' found args=`%s' excp=`%s'\n", - // root->name.data(),root->args.data(),root->exception.data()); - //if (root->relates.length()) printf(" Relates %s\n",root->relates.data()); - //printf("Inside=%s\n Relates=%s\n",root->inside.data(),root->relates.data()); - if (root->type=="friend class" || root->type=="friend struct" || - root->type=="friend union") - { - findMember(root, - root->type+" "+ - root->name, - FALSE,FALSE); - - } - else if (!root->type.isEmpty()) - { - findMember(root, - root->type+" "+ - root->inside+ - root->name+ - root->args+ - root->exception, - FALSE,isFunc); - } - else { - findMember(root, - root->inside+ - root->name+ - root->args+ - root->exception, - FALSE,isFunc); + //printf("Documentation for member `%s' found args=`%s' excp=`%s'\n", + // root->name.data(),root->args.data(),root->exception.data()); + //if (root->relates.length()) printf(" Relates %s\n",root->relates.data()); + //printf("Inside=%s\n Relates=%s\n",root->inside.data(),root->relates.data()); + if (root->type=="friend class" || root->type=="friend struct" || + root->type=="friend union") + { + findMember(rootNav, + root->type+" "+ + root->name, + FALSE,FALSE); + + } + else if (!root->type.isEmpty()) + { + findMember(rootNav, + root->type+" "+ + root->inside+ + root->name+ + root->args+ + root->exception, + FALSE,isFunc); + } + else + { + findMember(rootNav, + root->inside+ + root->name+ + root->args+ + root->exception, + FALSE,isFunc); + } } - } else if (root->section==Entry::DEFINE_SEC && !root->relates.isEmpty()) { - findMember(root,root->name+root->args,FALSE,!root->args.isEmpty()); + findMember(rootNav,root->name+root->args,FALSE,!root->args.isEmpty()); } else if (root->section==Entry::VARIABLEDOC_SEC) { //printf("Documentation for variable %s found\n",root->name.data()); //if (!root->relates.isEmpty()) printf(" Relates %s\n",root->relates.data()); - findMember(root,root->name,FALSE,FALSE); + findMember(rootNav,root->name,FALSE,FALSE); } else { // skip section //printf("skip section\n"); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) +} + +static void findMemberDocumentation(EntryNav *rootNav) +{ + if (rootNav->section()==Entry::MEMBERDOC_SEC || + rootNav->section()==Entry::OVERLOADDOC_SEC || + rootNav->section()==Entry::FUNCTION_SEC || + rootNav->section()==Entry::VARIABLE_SEC || + rootNav->section()==Entry::VARIABLEDOC_SEC || + rootNav->section()==Entry::DEFINE_SEC + ) + { + rootNav->loadEntry(g_storage); + + filterMemberDocumentation(rootNav); + + rootNav->releaseEntry(); + } + if (rootNav->children()) { - if (e->section!=Entry::ENUM_SEC) findMemberDocumentation(e); + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) + { + if (e->section()!=Entry::ENUM_SEC) findMemberDocumentation(e); + } } } //---------------------------------------------------------------------- -static void findObjCMethodDefinitions(Entry *root) +static void findObjCMethodDefinitions(EntryNav *rootNav) { - EntryListIterator eli(*root->sublist); - Entry *objCImpl; - for (;(objCImpl=eli.current());++eli) + if (rootNav->children()) { - if (objCImpl->section==Entry::OBJCIMPL_SEC) + EntryNavListIterator eli(*rootNav->children()); + EntryNav *objCImplNav; + for (;(objCImplNav=eli.current());++eli) { - //printf("Found ObjC class implementation %s\n",objCImpl->name.data()); - EntryListIterator seli(*objCImpl->sublist); - Entry *objCMethod; - for (;(objCMethod=seli.current());++seli) + if (objCImplNav->section()==Entry::OBJCIMPL_SEC && objCImplNav->children()) { - if (objCMethod->section==Entry::FUNCTION_SEC) + EntryNavListIterator seli(*objCImplNav->children()); + EntryNav *objCMethodNav; + for (;(objCMethodNav=seli.current());++seli) { - //Printf(" Found ObjC method definition %s\n",objCMethod->name.data()); - findMember(objCMethod, objCMethod->type+" "+objCImpl->name+"::"+objCMethod->name+" "+objCMethod->args, FALSE,TRUE); - objCMethod->section=Entry::EMPTY_SEC; + if (objCMethodNav->section()==Entry::FUNCTION_SEC) + { + objCMethodNav->loadEntry(g_storage); + Entry *objCMethod = objCMethodNav->entry(); + + //Printf(" Found ObjC method definition %s\n",objCMethod->name.data()); + findMember(objCMethodNav, objCMethod->type+" "+objCImplNav->name()+"::"+ + objCMethod->name+" "+objCMethod->args, FALSE,TRUE); + objCMethod->section=Entry::EMPTY_SEC; + + objCMethodNav->releaseEntry(); + } } } } @@ -5788,11 +5883,14 @@ static void findObjCMethodDefinitions(Entry *root) //---------------------------------------------------------------------- // find and add the enumeration to their classes, namespaces or files -static void findEnums(Entry *root) +static void findEnums(EntryNav *rootNav) { - if (root->section==Entry::ENUM_SEC) + if (rootNav->section()==Entry::ENUM_SEC) // non anonymous enumeration { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + MemberDef *md=0; ClassDef *cd=0; FileDef *fd=0; @@ -5814,14 +5912,14 @@ static void findEnums(Entry *root) } else // no scope, check the scope in which the docs where found { - if (( root->parent->section & Entry::SCOPE_MASK ) - && !root->parent->name.isEmpty() + if (( rootNav->parent()->section() & Entry::SCOPE_MASK ) + && !rootNav->parent()->name().isEmpty() ) // found enum docs inside a compound { - scope=root->parent->name; + scope=rootNav->parent()->name(); if ((cd=getClass(scope))==0) nd=getResolvedNamespace(scope); } - name=root->name.copy(); + name=root->name; } if (!root->relates.isEmpty()) @@ -5848,8 +5946,7 @@ static void findEnums(Entry *root) } else // found a global enum { - bool ambig; - fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + fd=rootNav->fileDef(); mnsd=&Doxygen::functionNameSDict; isGlobal=TRUE; } @@ -5862,11 +5959,10 @@ static void findEnums(Entry *root) 0,name,0,0, root->protection,Normal,FALSE,isRelated,MemberDef::Enumeration, 0,0); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); //printf("Enum %s definition at line %d of %s: protection=%d\n", // root->name.data(),root->bodyLine,root->fileName.data(),root->protection); md->addSectionsToDefinition(root->anchors); @@ -5898,11 +5994,9 @@ static void findEnums(Entry *root) if (isGlobal) { if (!defSet) md->setDefinition(name); - if (fd==0 && root->parent) + if (fd==0 && rootNav->parent()) { - bool ambig; - QCString filePathName = root->parent->fileName; - fd=findFileDef(Doxygen::inputNameDict,filePathName,ambig); + fd=rootNav->parent()->fileDef(); } if (fd) { @@ -5945,89 +6039,92 @@ static void findEnums(Entry *root) } addMemberToGroups(root,md); - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) + if (rootNav->children()) { - //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated); - MemberName *fmn=0; - MemberNameSDict *emnsd = isRelated ? &Doxygen::functionNameSDict : mnsd; - if (!e->name.isEmpty() && (fmn=(*emnsd)[e->name])) - // get list of members with the same name as the field + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) { - MemberNameIterator fmni(*fmn); - MemberDef *fmd; - for (fmni.toFirst(); (fmd=fmni.current()) ; ++fmni) + //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated); + MemberName *fmn=0; + MemberNameSDict *emnsd = isRelated ? &Doxygen::functionNameSDict : mnsd; + if (!e->name().isEmpty() && (fmn=(*emnsd)[e->name()])) + // get list of members with the same name as the field { - if (fmd->isEnumValue()) + MemberNameIterator fmni(*fmn); + MemberDef *fmd; + for (fmni.toFirst(); (fmd=fmni.current()) ; ++fmni) { - //printf("found enum value with same name\n"); - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + if (fmd->isEnumValue()) { - NamespaceDef *fnd=fmd->getNamespaceDef(); - if (fnd==nd) // enum value is inside a namespace + //printf("found enum value with same name\n"); + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - md->insertEnumField(fmd); - fmd->setEnumScope(md); + NamespaceDef *fnd=fmd->getNamespaceDef(); + if (fnd==nd) // enum value is inside a namespace + { + md->insertEnumField(fmd); + fmd->setEnumScope(md); + } } - } - else if (isGlobal) - { - FileDef *ffd=fmd->getFileDef(); - if (ffd==fd) // enum value has file scope + else if (isGlobal) { - md->insertEnumField(fmd); - fmd->setEnumScope(md); + FileDef *ffd=fmd->getFileDef(); + if (ffd==fd) // enum value has file scope + { + md->insertEnumField(fmd); + fmd->setEnumScope(md); + } } - } - else if (isRelated && cd) // reparent enum value to - // match the enum's scope - { - md->insertEnumField(fmd); // add field def to list - fmd->setEnumScope(md); // cross ref with enum name - fmd->setEnumClassScope(cd); // cross ref with enum name - fmd->setOuterScope(cd); - fmd->makeRelated(); - cd->insertMember(fmd); - } - else - { - ClassDef *fcd=fmd->getClassDef(); - if (fcd==cd) // enum value is inside a class + else if (isRelated && cd) // reparent enum value to + // match the enum's scope { - //printf("Inserting enum field %s in enum scope %s\n", - // fmd->name().data(),md->name().data()); - md->insertEnumField(fmd); // add field def to list - fmd->setEnumScope(md); // cross ref with enum name + md->insertEnumField(fmd); // add field def to list + fmd->setEnumScope(md); // cross ref with enum name + fmd->setEnumClassScope(cd); // cross ref with enum name + fmd->setOuterScope(cd); + fmd->makeRelated(); + cd->insertMember(fmd); } - } - } + else + { + ClassDef *fcd=fmd->getClassDef(); + if (fcd==cd) // enum value is inside a class + { + //printf("Inserting enum field %s in enum scope %s\n", + // fmd->name().data(),md->name().data()); + md->insertEnumField(fmd); // add field def to list + fmd->setEnumScope(md); // cross ref with enum name + } + } + } + } } } } } + + rootNav->releaseEntry(); } else { - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findEnums(e); - } + RECURSE_ENTRYTREE(findEnums,rootNav); } } //---------------------------------------------------------------------- // find the documentation blocks for the enumerations -static void findEnumDocumentation(Entry *root) +static void findEnumDocumentation(EntryNav *rootNav) { - if (root->section==Entry::ENUMDOC_SEC - && !root->name.isEmpty() - && root->name[0]!='@' // skip anonymous enums + if (rootNav->section()==Entry::ENUMDOC_SEC + && !rootNav->name().isEmpty() + && rootNav->name().at(0)!='@' // skip anonymous enums ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + //printf("Found docs for enum with name `%s' in context %s\n", // root->name.data(),root->parent->name.data()); int i; @@ -6043,12 +6140,12 @@ static void findEnumDocumentation(Entry *root) { name=root->name; } - if (( root->parent->section & Entry::SCOPE_MASK ) - && !root->parent->name.isEmpty() + if (( rootNav->parent()->section() & Entry::SCOPE_MASK ) + && !rootNav->parent()->name().isEmpty() ) // found enum docs inside a compound { if (!scope.isEmpty()) scope.prepend("::"); - scope.prepend(root->parent->name); + scope.prepend(rootNav->parent()->name()); } ClassDef *cd=getClass(scope); @@ -6070,7 +6167,7 @@ static void findEnumDocumentation(Entry *root) if (cd && cd->name()==className && md->isEnumerate()) { // documentation outside a compound overrides the documentation inside it - if (!md->documentation() || root->parent->name.isEmpty()) + if (!md->documentation() || rootNav->parent()->name().isEmpty()) { md->setDocumentation(root->doc,root->docFile,root->docLine); md->setDocsForDefinition(!root->proto); @@ -6078,12 +6175,12 @@ static void findEnumDocumentation(Entry *root) // brief descriptions inside a compound override the documentation // outside it - if (!md->briefDescription() || !root->parent->name.isEmpty()) + if (!md->briefDescription() || !rootNav->parent()->name().isEmpty()) { md->setBriefDescription(root->brief,root->briefFile,root->briefLine); } - if (!md->inbodyDocumentation() || !root->parent->name.isEmpty()) + if (!md->inbodyDocumentation() || !rootNav->parent()->name().isEmpty()) { md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } @@ -6148,13 +6245,10 @@ static void findEnumDocumentation(Entry *root) ); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findEnumDocumentation(e); - } + RECURSE_ENTRYTREE(findEnumDocumentation,rootNav); } // seach for each enum (member or function) in mnl if it has documented @@ -6328,8 +6422,8 @@ static void buildCompleteMemberLists() for (cli.toFirst();(cd=cli.current());++cli) { if (// !cd->isReference() && // not an external class - cd->subClasses()->count()==0 && // is a root of the hierarchy - cd->baseClasses()->count()>0) // and has at least one base class + cd->subClasses()==0 && // is a root of the hierarchy + cd->baseClasses()) // and has at least one base class { //printf("*** merging members for %s\n",cd->name().data()); cd->mergeMembers(); @@ -6338,7 +6432,7 @@ static void buildCompleteMemberLists() // now sort the member list of all classes. for (cli.toFirst();(cd=cli.current());++cli) { - cd->memberNameInfoSDict()->sort(); + if (cd->memberNameInfoSDict()) cd->memberNameInfoSDict()->sort(); } } @@ -6792,26 +6886,26 @@ static void flushCachedTemplateRelations() //---------------------------------------------------------------------------- -static void findDefineDocumentation(Entry *root) +static void findDefineDocumentation(EntryNav *rootNav) { - if ((root->section==Entry::DEFINEDOC_SEC || - root->section==Entry::DEFINE_SEC) && !root->name.isEmpty() + if ((rootNav->section()==Entry::DEFINEDOC_SEC || + rootNav->section()==Entry::DEFINE_SEC) && !rootNav->name().isEmpty() ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + //printf("found define `%s' `%s' brief=`%s' doc=`%s'\n", // root->name.data(),root->args.data(),root->brief.data(),root->doc.data()); - if (root->tagInfo && !root->name.isEmpty()) // define read from a tag file + if (rootNav->tagInfo() && !root->name.isEmpty()) // define read from a tag file { MemberDef *md=new MemberDef("",1, "#define",root->name,root->args,0, Public,Normal,FALSE,FALSE,MemberDef::Define,0,0); - md->setTagInfo(root->tagInfo); - bool ambig; - QCString filePathName = root->parent->fileName; - FileDef *fd=findFileDef(Doxygen::inputNameDict,filePathName,ambig); + md->setTagInfo(rootNav->tagInfo()); //printf("Searching for `%s' fd=%p\n",filePathName.data(),fd); - md->setFileDef(fd); + md->setFileDef(rootNav->parent()->fileDef()); //printf("Adding member=%s\n",md->name().data()); MemberName *mn; if ((mn=Doxygen::functionNameSDict[root->name])) @@ -6858,8 +6952,7 @@ static void findDefineDocumentation(Entry *root) md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); md->addSectionsToDefinition(root->anchors); md->setMaxInitLines(root->initLines); md->setRefItems(root->sli); @@ -6901,8 +6994,7 @@ static void findDefineDocumentation(Entry *root) md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); md->addSectionsToDefinition(root->anchors); md->setRefItems(root->sli); if (root->mGrpId!=-1) md->setMemberGroupId(root->mGrpId); @@ -6936,21 +7028,21 @@ static void findDefineDocumentation(Entry *root) ); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findDefineDocumentation(e); - } + RECURSE_ENTRYTREE(findDefineDocumentation,rootNav); } //---------------------------------------------------------------------------- -static void findDirDocumentation(Entry *root) +static void findDirDocumentation(EntryNav *rootNav) { - if (root->section == Entry::DIRDOC_SEC) + if (rootNav->section() == Entry::DIRDOC_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString normalizedName = root->name; normalizedName = substitute(normalizedName,"\\","/"); if (normalizedName.at(normalizedName.length()-1)!='/') @@ -6991,50 +7083,54 @@ static void findDirDocumentation(Entry *root) warn(root->fileName,root->startLine,"Warning: No matching " "directory found for command \\dir %s\n",root->name.data()); } + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findDirDocumentation(e); - } + RECURSE_ENTRYTREE(findDirDocumentation,rootNav); } //---------------------------------------------------------------------------- // create a (sorted) list of separate documentation pages -static void buildPageList(Entry *root) +static void buildPageList(EntryNav *rootNav) { - if (root->section == Entry::PAGEDOC_SEC) + if (rootNav->section() == Entry::PAGEDOC_SEC) { //printf("buildPageList %s\n",root->name.data()); + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + if (!root->name.isEmpty()) { - addRelatedPage(root); + addRelatedPage(rootNav); } + + rootNav->releaseEntry(); } - else if (root->section == Entry::MAINPAGEDOC_SEC) + else if (rootNav->section() == Entry::MAINPAGEDOC_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString title=root->args.stripWhiteSpace(); if (title.isEmpty()) title=theTranslator->trMainPage(); addRefItem(root->sli,"page", Config_getBool("GENERATE_TREEVIEW")?"main":"index", title ); + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildPageList(e); - } + RECURSE_ENTRYTREE(buildPageList,rootNav); } -static void findMainPage(Entry *root) +static void findMainPage(EntryNav *rootNav) { - if (root->section == Entry::MAINPAGEDOC_SEC) + if (rootNav->section() == Entry::MAINPAGEDOC_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + if (Doxygen::mainPage==0) { //printf("Found main page! \n======\n%s\n=======\n",root->doc.data()); @@ -7044,7 +7140,7 @@ static void findMainPage(Entry *root) indexName, root->brief+root->doc,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->setFileName(indexName); - addPageToContext(Doxygen::mainPage,root); + addPageToContext(Doxygen::mainPage,rootNav); // a page name is a label as well! SectionInfo *si=new SectionInfo( @@ -7062,23 +7158,23 @@ static void findMainPage(Entry *root) "block." ); } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findMainPage(e); - } + RECURSE_ENTRYTREE(findMainPage,rootNav); } -static void computePageRelations(Entry *root) +static void computePageRelations(EntryNav *rootNav) { - if ((root->section==Entry::PAGEDOC_SEC || - root->section==Entry::MAINPAGEDOC_SEC + if ((rootNav->section()==Entry::PAGEDOC_SEC || + rootNav->section()==Entry::MAINPAGEDOC_SEC ) - && !root->name.isEmpty() + && !rootNav->name().isEmpty() ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + PageDef *pd = root->section==Entry::PAGEDOC_SEC ? Doxygen::pageSDict->find(root->name) : Doxygen::mainPage; @@ -7097,13 +7193,10 @@ static void computePageRelations(Entry *root) } } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - computePageRelations(e); - } + RECURSE_ENTRYTREE(computePageRelations,rootNav); } static void checkPageRelations() @@ -7219,40 +7312,37 @@ static void generatePageDocs() //---------------------------------------------------------------------------- // create a (sorted) list & dictionary of example pages -static void buildExampleList(Entry *root) +static void buildExampleList(EntryNav *rootNav) { - if (root->section == Entry::EXAMPLE_SEC) + if (rootNav->section()==Entry::EXAMPLE_SEC && !rootNav->name().isEmpty()) { - if (!root->name.isEmpty()) + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + + if (Doxygen::exampleSDict->find(root->name)) { - if (Doxygen::exampleSDict->find(root->name)) - { - warn(root->fileName,root->startLine, - "Warning: Example %s was already documented. Ignoring " - "documentation found here.", - root->name.data() - ); - } - else - { - PageDef *pd=new PageDef(root->fileName,root->startLine, - root->name,root->brief+root->doc,root->args); - pd->setFileName(convertNameToFile(pd->name()+"-example")); - pd->addSectionsToDefinition(root->anchors); - //pi->addSections(root->anchors); - - Doxygen::exampleSDict->inSort(root->name,pd); - //we don't add example to groups - //addExampleToGroups(root,pd); - } + warn(root->fileName,root->startLine, + "Warning: Example %s was already documented. Ignoring " + "documentation found here.", + root->name.data() + ); } + else + { + PageDef *pd=new PageDef(root->fileName,root->startLine, + root->name,root->brief+root->doc,root->args); + pd->setFileName(convertNameToFile(pd->name()+"-example")); + pd->addSectionsToDefinition(root->anchors); + //pi->addSections(root->anchors); + + Doxygen::exampleSDict->inSort(root->name,pd); + //we don't add example to groups + //addExampleToGroups(root,pd); + } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildExampleList(e); - } + RECURSE_ENTRYTREE(buildExampleList,rootNav); } //---------------------------------------------------------------------------- @@ -7605,6 +7695,7 @@ static void readTagFile(Entry *root,const char *tl) msg("Reading tag file `%s'...\n",fileName.data()); parseTagFile(root,fi.absFilePath(),fi.fileName()); + } //---------------------------------------------------------------------------- @@ -7739,9 +7830,8 @@ static void copyStyleSheet() } } -static void parseFiles(Entry *root) +static void parseFiles(Entry *root,EntryNav *rootNav) { - QCString *s=inputFiles.first(); while (s) { @@ -7771,16 +7861,26 @@ static void parseFiles(Entry *root) BufStr convBuf(bufPtr->curPos()+1024); + // convert multi-line C++ comments to C style comments convertCppComments(&preBuf,&convBuf,fileName); convBuf.addChar('\0'); + // use language parse to parse the file parser->parseInput(fileName,convBuf.data(),root); + // store the Entry tree in a file and create an index to + // navigate/load entries + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameDict,fileName,ambig); + ASSERT(fd!=0); + root->createNavigationIndex(rootNav,g_storage,fd); + s=inputFiles.next(); } } + //---------------------------------------------------------------------------- // Read all files matching at least one pattern in `patList' in the // directory represented by `fi'. @@ -7803,7 +7903,7 @@ static int readDir(QFileInfo *fi, QDir dir((const char *)fi->absFilePath()); dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); int totalSize=0; - //printf("readDir `%s'\n",fi->absFilePath().data()); + msg("Search for files in directory %s\n", fi->absFilePath().data()); //printf("killDict=%p count=%d\n",killDict,killDict->count()); const QFileInfoList *list = dir.entryInfoList(); @@ -8645,8 +8745,10 @@ void parseInput() if (path.at(l-1)=='\\' || path.at(l-1)=='/') path=path.left(l-1); inputSize+=readFileOrDirectory( - path,&Doxygen::inputNameList, - Doxygen::inputNameDict,&excludeNameDict, + path, + &Doxygen::inputNameList, + Doxygen::inputNameDict, + &excludeNameDict, &Config_getList("FILE_PATTERNS"), &Config_getList("EXCLUDE_PATTERNS"), &inputFiles,0, @@ -8673,21 +8775,6 @@ void parseInput() readAliases(); /************************************************************************** - * Handle Tag Files * - **************************************************************************/ - - Entry *root=new Entry; - msg("Reading and parsing tag files\n"); - - QStrList &tagFileList = Config_getList("TAGFILES"); - s=tagFileList.first(); - while (s) - { - readTagFile(root,s); - s=tagFileList.next(); - } - - /************************************************************************** * Check/create output directorties * **************************************************************************/ @@ -8706,7 +8793,6 @@ void parseInput() { err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not " "exist and cannot be created\n",outputDirectory.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8734,7 +8820,6 @@ void parseInput() if (generateHtml && !htmlDir.exists() && !htmlDir.mkdir(htmlOutput)) { err("Could not create output directory %s\n",htmlOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8753,7 +8838,6 @@ void parseInput() if (generateXml && !xmlDir.exists() && !xmlDir.mkdir(xmlOutput)) { err("Could not create output directory %s\n",xmlOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8772,7 +8856,6 @@ void parseInput() if (generateLatex && !latexDir.exists() && !latexDir.mkdir(latexOutput)) { err("Could not create output directory %s\n",latexOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8791,7 +8874,6 @@ void parseInput() if (generateRtf && !rtfDir.exists() && !rtfDir.mkdir(rtfOutput)) { err("Could not create output directory %s\n",rtfOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8810,7 +8892,6 @@ void parseInput() if (generateMan && !manDir.exists() && !manDir.mkdir(manOutput)) { err("Could not create output directory %s\n",manOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8822,44 +8903,81 @@ void parseInput() readFormulaRepository(); } - parseFiles(root); + /************************************************************************** + * Handle Tag Files * + **************************************************************************/ + + g_storage.setName(outputDirectory+"/doxygen_entrydb.tmp"); + if (!g_storage.open(IO_WriteOnly)) + { + err("Failed to create temporary storage file %s/doxygen_entrydb.tmp", + outputDirectory.data()); + exit(1); + } + Entry *root=new Entry; + EntryNav *rootNav = new EntryNav(0,root); + rootNav->setEntry(root); + msg("Reading and parsing tag files\n"); + + QStrList &tagFileList = Config_getList("TAGFILES"); + s=tagFileList.first(); + while (s) + { + readTagFile(root,s); + root->createNavigationIndex(rootNav,g_storage,0); + s=tagFileList.next(); + } + + /************************************************************************** + * Parse source files * + **************************************************************************/ + + parseFiles(root,rootNav); + g_storage.close(); + if (!g_storage.open(IO_ReadOnly)) + { + err("Failed to open temporary storage file %s/doxygen_entrydb.tmp for reading", + outputDirectory.data()); + exit(1); + } /************************************************************************** * Gather information * **************************************************************************/ msg("Building group list...\n"); - buildGroupList(root); - organizeSubGroups(root); + buildGroupList(rootNav); + organizeSubGroups(rootNav); msg("Building directory list...\n"); buildDirectories(); - findDirDocumentation(root); - + findDirDocumentation(rootNav); + if (Config_getBool("BUILTIN_STL_SUPPORT")) { - addSTLClasses(root); + addSTLClasses(rootNav); } msg("Building namespace list...\n"); - buildNamespaceList(root); - findUsingDirectives(root); + buildNamespaceList(rootNav); + findUsingDirectives(rootNav); + msg("Building file list...\n"); - buildFileList(root); + buildFileList(rootNav); //generateFileTree(); msg("Searching for included using directives...\n"); findIncludedUsingDirectives(); msg("Building class list...\n"); - buildClassList(root); + buildClassList(rootNav); msg("Associating documentation with classes...\n"); - buildClassDocList(root); + buildClassDocList(rootNav); // build list of using declarations here (global list) - buildListOfUsingDecls(root); + buildListOfUsingDecls(rootNav); msg("Computing nesting relations for classes...\n"); resolveClassNestingRelations(); @@ -8872,27 +8990,26 @@ void parseInput() g_usingDeclarations.clear(); msg("Searching for members imported via using declarations...\n"); - findUsingDeclImports(root); - - findUsingDeclarations(root); + findUsingDeclImports(rootNav); + findUsingDeclarations(rootNav); msg("Building example list...\n"); - buildExampleList(root); + buildExampleList(rootNav); msg("Searching for documented variables...\n"); - buildVarList(root); + buildVarList(rootNav); msg("Building member list...\n"); // using class info only ! - buildFunctionList(root); + buildFunctionList(rootNav); msg("Searching for friends...\n"); findFriends(); msg("Searching for documented defines...\n"); - findDefineDocumentation(root); + findDefineDocumentation(rootNav); msg("Computing template instances...\n"); - findClassEntries(root); + findClassEntries(rootNav); findInheritedTemplateInstances(); findUsedTemplateInstances(); @@ -8908,27 +9025,28 @@ void parseInput() classEntries.clear(); msg("Searching for enumerations...\n"); - findEnums(root); - findEnumDocumentation(root); + findEnums(rootNav); + findEnumDocumentation(rootNav); msg("Searching for member function documentation...\n"); - findObjCMethodDefinitions(root); - findMemberDocumentation(root); // may introduce new members ! + findObjCMethodDefinitions(rootNav); + findMemberDocumentation(rootNav); // may introduce new members ! + transferRelatedFunctionDocumentation(); transferFunctionDocumentation(); msg("Building page list...\n"); - buildPageList(root); + buildPageList(rootNav); msg("Search for main page...\n"); - findMainPage(root); + findMainPage(rootNav); msg("Computing page relations...\n"); - computePageRelations(root); + computePageRelations(rootNav); checkPageRelations(); msg("Determining the scope of groups...\n"); - findGroupScope(root); + findGroupScope(rootNav); msg("Sorting lists...\n"); Doxygen::memberNameSDict.sort(); @@ -8937,7 +9055,11 @@ void parseInput() Doxygen::classSDict.sort(); msg("Freeing entry tree\n"); - delete root; + delete rootNav; + g_storage.close(); + + QDir thisDir; + thisDir.remove(outputDirectory+"/doxygen_entrydb.tmp"); msg("Determining which enums are documented\n"); findDocumentedEnumValues(); diff --git a/src/doxygen.css b/src/doxygen.css index 2691c25..c7db1a8 100644 --- a/src/doxygen.css +++ b/src/doxygen.css @@ -341,6 +341,7 @@ HR { height: 1px; .paramname { color: #602020; font-style: italic; + white-space: nowrap; } /* End Styling for detailed member documentation */ diff --git a/src/doxygen_css.h b/src/doxygen_css.h index b9a0a8b..7679514 100644 --- a/src/doxygen_css.h +++ b/src/doxygen_css.h @@ -341,6 +341,7 @@ ".paramname {\n" " color: #602020;\n" " font-style: italic;\n" +" white-space: nowrap;\n" "}\n" "/* End Styling for detailed member documentation */\n" "\n" @@ -355,4 +356,3 @@ ".directory p { margin: 0px; white-space: nowrap; }\n" ".directory div { display: none; margin: 0px; }\n" ".directory img { vertical-align: -30%; }\n" -"\n" diff --git a/src/entry.cpp b/src/entry.cpp index 66d6d9f..61de661 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -15,6 +15,7 @@ * */ +#include #include "entry.h" #include "util.h" #include "section.h" @@ -24,10 +25,10 @@ int Entry::num=0; Entry::Entry() { num++; - parent=0; + m_parent=0; section = EMPTY_SEC; - sublist = new QList; - sublist->setAutoDelete(TRUE); + m_sublist = new QList; + m_sublist->setAutoDelete(TRUE); extends = new QList; extends->setAutoDelete(TRUE); groups = new QList; @@ -55,7 +56,7 @@ Entry::Entry(const Entry &e) stat = e.stat; explicitExternal = e.explicitExternal; virt = e.virt; - parent = e.parent; + m_parent = e.m_parent; type = e.type.copy(); name = e.name.copy(); args = e.args.copy(); @@ -91,8 +92,8 @@ Entry::Entry(const Entry &e) objc = e.objc; tagInfo = e.tagInfo; hidden = e.hidden; - sublist = new QList; - sublist->setAutoDelete(TRUE); + m_sublist = new QList; + m_sublist->setAutoDelete(TRUE); extends = new QList; extends->setAutoDelete(TRUE); groups = new QList; @@ -104,11 +105,11 @@ Entry::Entry(const Entry &e) groupDocType = e.groupDocType; // deep copy of the child entry list - QListIterator eli(*e.sublist); + QListIterator eli(*e.m_sublist); Entry *cur; for (;(cur=eli.current());++eli) { - sublist->append(new Entry(*cur)); + m_sublist->append(new Entry(*cur)); } // deep copy base class list @@ -172,7 +173,9 @@ Entry::~Entry() { //printf("Deleting entry %d name %s type %x children %d\n", // num,name.data(),section,sublist->count()); - delete sublist; + + //delete sublist; // each element is now own by a EntryNav so we do no longer own + // our children. delete extends; delete groups; delete anchors; @@ -191,8 +194,8 @@ void Entry::addSubEntry(Entry *current) // name.data(),section); //printf("Entry::addSubEntry(%s:%p) to %s\n",current->name.data(), // current,name.data()); - current->parent=this; - sublist->append(current); + current->m_parent=this; + m_sublist->append(current); } void Entry::reset() @@ -238,7 +241,7 @@ void Entry::reset() subGrouping = TRUE; protection = Public; groupDocType = GROUPDOC_NORMAL; - sublist->clear(); + m_sublist->clear(); extends->clear(); groups->clear(); anchors->clear(); @@ -255,6 +258,45 @@ int Entry::getSize() return sizeof(Entry); } +void Entry::createSubtreeIndex(EntryNav *nav,QFile &storage,FileDef *fd) +{ + EntryNav *childNav = new EntryNav(nav,this); + nav->addChild(childNav); + childNav->setFileDef(fd); + childNav->saveEntry(this,storage); + if (m_sublist) + { + //printf("saveEntry: %d children\n",node->sublist->count()); + QListIterator eli(*m_sublist); + Entry *childNode; + for (eli.toFirst();(childNode=eli.current());++eli) + { + childNode->createSubtreeIndex(childNav,storage,fd); + } + m_sublist->clear(); + } +} + +void Entry::createNavigationIndex(EntryNav *rootNav,QFile &storage,FileDef *fd) +{ + if (m_sublist) + { + //printf("saveEntries: %d children\n",root->sublist->count()); + // store all child entries of root, but keep the navigation info (=index) + QListIterator eli(*m_sublist); + Entry *e; + for (eli.toFirst();(e=eli.current());++eli) + { + createSubtreeIndex(rootNav,storage,fd); + } + // remove all entries from root + m_sublist->clear(); + } +} + + + + /*! the argument list is documented if one of its * arguments is documented */ @@ -283,3 +325,524 @@ void Entry::addSpecialListItem(const char *listName,int itemId) sli->append(ili); } +//------------------------------------------------------------------ + +#define NULL_LIST 0xffffffff + +void marshalInt(QFile &f,int v) +{ + uchar b[4]; + b[0]=((uint)v)>>24; + b[1]=(((uint)v)>>16)&0xff; + b[2]=(((uint)v)>>8)&0xff; + b[3]=v&0xff; + f.writeBlock((const char *)b,4); +} + +void marshalUInt(QFile &f,uint v) +{ + uchar b[4]; + b[0]=v>>24; + b[1]=(v>>16)&0xff; + b[2]=(v>>8)&0xff; + b[3]=v&0xff; + f.writeBlock((const char *)b,4); +} + +void marshalBool(QFile &f,bool b) +{ + char c = b; + f.writeBlock(&c,sizeof(char)); +} + +void marshalQCString(QFile &f,const QCString &s) +{ + uint l=s.length(); + marshalUInt(f,l); + if (l>0) f.writeBlock(s.data(),l); +} + +void marshalArgumentList(QFile &f,ArgumentList *argList) +{ + if (argList==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,argList->count()); + ArgumentListIterator ali(*argList); + Argument *a; + for (ali.toFirst();(a=ali.current());++ali) + { + marshalQCString(f,a->attrib); + marshalQCString(f,a->type); + marshalQCString(f,a->canType); + marshalQCString(f,a->name); + marshalQCString(f,a->array); + marshalQCString(f,a->defval); + marshalQCString(f,a->docs); + } + marshalBool(f,argList->constSpecifier); + marshalBool(f,argList->volatileSpecifier); + marshalBool(f,argList->pureSpecifier); + } +} + +void marshalArgumentLists(QFile &f,QList *argLists) +{ + if (argLists==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,argLists->count()); + QListIterator ali(*argLists); + ArgumentList *al; + for (ali.toFirst();(al=ali.current());++ali) + { + marshalArgumentList(f,al); + } + } +} + +void marshalBaseInfoList(QFile &f, QList *baseList) +{ + if (baseList==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,baseList->count()); + QListIterator bli(*baseList); + BaseInfo *bi; + for (bli.toFirst();(bi=bli.current());++bli) + { + marshalQCString(f,bi->name); + marshalInt(f,(int)bi->prot); + marshalInt(f,(int)bi->virt); + } + } +} + +void marshalGroupingList(QFile &f, QList *groups) +{ + if (groups==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,groups->count()); + QListIterator gli(*groups); + Grouping *g; + for (gli.toFirst();(g=gli.current());++gli) + { + marshalQCString(f,g->groupname); + marshalInt(f,(int)g->pri); + } + } +} + +void marshalSectionInfoList(QFile &f, QList *anchors) +{ + if (anchors==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,anchors->count()); + QListIterator sli(*anchors); + SectionInfo *si; + for (sli.toFirst();(si=sli.current());++sli) + { + marshalQCString(f,si->label); + marshalQCString(f,si->title); + marshalQCString(f,si->ref); + marshalInt(f,(int)si->type); + marshalQCString(f,si->fileName); + } + } +} + +void marshalItemInfoList(QFile &f, QList *sli) +{ + if (sli==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,sli->count()); + QListIterator liii(*sli); + ListItemInfo *lii; + for (liii.toFirst();(lii=liii.current());++liii) + { + marshalQCString(f,lii->type); + marshalInt(f,lii->itemId); + } + } +} + +//------------------------------------------------------------------ + +int unmarshalInt(QFile &f) +{ + uchar b[4]; + f.readBlock((char *)b,4); + int result=(int)((((uint)b[0])<<24)+((uint)b[1]<<16)+((uint)b[2]<<8)+(uint)b[3]); + //printf("unmarshalInt: %x %x %x %x: %x offset=%llx\n",b[0],b[1],b[2],b[3],result,f.pos()); + return result; +} + +uint unmarshalUInt(QFile &f) +{ + uchar b[4]; + f.readBlock((char *)b,4); + uint result=(((uint)b[0])<<24)+((uint)b[1]<<16)+((uint)b[2]<<8)+(uint)b[3]; + //printf("unmarshalUInt: %x %x %x %x: %x offset=%llx\n",b[0],b[1],b[2],b[3],result,f.pos()); + return result; +} + +bool unmarshalBool(QFile &f) +{ + char result; + f.readBlock(&result,sizeof(result)); + //printf("unmarshalBool: %x offset=%llx\n",result,f.pos()); + return result; +} + +QCString unmarshalQCString(QFile &f) +{ + uint len = unmarshalUInt(f); + //printf("unmarshalQCString: len=%d offset=%llx\n",len,f.pos()); + QCString result(len+1); + result.at(len)='\0'; + if (len>0) + { + f.readBlock(result.data(),len); + } + //printf("unmarshalQCString: result=%s\n",result.data()); + return result; +} + +ArgumentList *unmarshalArgumentList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + ArgumentList *result = new ArgumentList; + //printf("unmarshalArgumentList: %d\n",count); + for (i=0;iattrib = unmarshalQCString(f); + a->type = unmarshalQCString(f); + a->canType = unmarshalQCString(f); + a->name = unmarshalQCString(f); + a->array = unmarshalQCString(f); + a->defval = unmarshalQCString(f); + a->docs = unmarshalQCString(f); + result->append(a); + } + result->constSpecifier = unmarshalBool(f); + result->volatileSpecifier = unmarshalBool(f); + result->pureSpecifier = unmarshalBool(f); + return result; +} + +QList *unmarshalArgumentLists(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList *result = new QList; + //printf("unmarshalArgumentLists: %d\n",count); + for (i=0;iappend(unmarshalArgumentList(f)); + } + return result; +} + +QList *unmarshalBaseInfoList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList *result = new QList; + for (i=0;iappend(new BaseInfo(name,prot,virt)); + } + return result; +} + +QList *unmarshalGroupingList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList *result = new QList; + for (i=0;iappend(new Grouping(name,prio)); + } + return result; +} + +QList *unmarshalSectionInfoList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList *result = new QList; + for (i=0;iappend(new SectionInfo(fileName,label,title,type,ref)); + } + return result; +} + +QList *unmarshalItemInfoList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList *result = new QList; + for (i=0;itype = unmarshalQCString(f); + lii->itemId = unmarshalInt(f); + result->append(lii); + } + return result; +} + +//------------------------------------------------------------------ + +#define HEADER ('D'<<24)+('O'<<16)+('X'<<8)+'!' + +bool saveEntry(Entry *e,QFile &f) +{ + marshalUInt(f,HEADER); + marshalInt(f,(int)e->protection); + marshalInt(f,(int)e->mtype); + marshalInt(f,e->memSpec); + marshalInt(f,e->initLines); + marshalBool(f,e->stat); + marshalBool(f,e->explicitExternal); + marshalBool(f,e->proto); + marshalBool(f,e->subGrouping); + marshalBool(f,e->callGraph); + marshalBool(f,e->callerGraph); + marshalInt(f,(int)e->virt); + marshalQCString(f,e->args); + marshalQCString(f,e->bitfields); + marshalArgumentList(f,e->argList); + marshalArgumentLists(f,e->tArgLists); + marshalQCString(f,e->program); + marshalQCString(f,e->initializer); + marshalQCString(f,e->includeFile); + marshalQCString(f,e->includeName); + marshalQCString(f,e->doc); + marshalInt(f,e->docLine); + marshalQCString(f,e->docFile); + marshalQCString(f,e->brief); + marshalInt(f,e->briefLine); + marshalQCString(f,e->briefFile); + marshalQCString(f,e->inbodyDocs); + marshalInt(f,e->inbodyLine); + marshalQCString(f,e->inbodyFile); + marshalQCString(f,e->relates); + marshalBool(f,e->relatesDup); + marshalQCString(f,e->read); + marshalQCString(f,e->write); + marshalQCString(f,e->inside); + marshalQCString(f,e->exception); + marshalInt(f,e->bodyLine); + marshalInt(f,e->endBodyLine); + marshalInt(f,e->mGrpId); + marshalBaseInfoList(f,e->extends); + marshalGroupingList(f,e->groups); + marshalSectionInfoList(f,e->anchors); + marshalQCString(f,e->fileName); + marshalInt(f,e->startLine); + marshalItemInfoList(f,e->sli); + marshalBool(f,e->objc); + marshalBool(f,e->hidden); + marshalInt(f,(int)e->groupDocType); + return TRUE; +} + +bool loadEntry(Entry *e,QFile &f) +{ + uint header=unmarshalUInt(f); + if (header!=HEADER) + { + printf("Internal error: Invalid header for entry in storage file: %x. Disk full?\n",header); + exit(1); + } + e->protection = (Protection)unmarshalInt(f); + e->mtype = (MethodTypes)unmarshalInt(f); + e->memSpec = unmarshalInt(f); + e->initLines = unmarshalInt(f); + e->stat = unmarshalBool(f); + e->explicitExternal = unmarshalBool(f); + e->proto = unmarshalBool(f); + e->subGrouping = unmarshalBool(f); + e->callGraph = unmarshalBool(f); + e->callerGraph = unmarshalBool(f); + e->virt = (Specifier)unmarshalInt(f); + e->args = unmarshalQCString(f); + e->bitfields = unmarshalQCString(f); + e->argList = unmarshalArgumentList(f); + e->tArgLists = unmarshalArgumentLists(f); + e->program = unmarshalQCString(f); + e->initializer = unmarshalQCString(f); + e->includeFile = unmarshalQCString(f); + e->includeName = unmarshalQCString(f); + e->doc = unmarshalQCString(f); + e->docLine = unmarshalInt(f); + e->docFile = unmarshalQCString(f); + e->brief = unmarshalQCString(f); + e->briefLine = unmarshalInt(f); + e->briefFile = unmarshalQCString(f); + e->inbodyDocs = unmarshalQCString(f); + e->inbodyLine = unmarshalInt(f); + e->inbodyFile = unmarshalQCString(f); + e->relates = unmarshalQCString(f); + e->relatesDup = unmarshalBool(f); + e->read = unmarshalQCString(f); + e->write = unmarshalQCString(f); + e->inside = unmarshalQCString(f); + e->exception = unmarshalQCString(f); + e->bodyLine = unmarshalInt(f); + e->endBodyLine = unmarshalInt(f); + e->mGrpId = unmarshalInt(f); + e->extends = unmarshalBaseInfoList(f); + e->groups = unmarshalGroupingList(f); + e->anchors = unmarshalSectionInfoList(f); + e->fileName = unmarshalQCString(f); + e->startLine = unmarshalInt(f); + e->sli = unmarshalItemInfoList(f); + e->objc = unmarshalBool(f); + e->hidden = unmarshalBool(f); + e->groupDocType = (Entry::GroupDocType)unmarshalInt(f); + return TRUE; +} + +EntryNav::EntryNav(EntryNav *parent, Entry *e) + : m_parent(parent), m_subList(0), m_section(e->section), m_type(e->type), + m_name(e->name), m_fileDef(0), m_info(0), m_offset(-1), + m_noLoad(FALSE) +{ + if (e->tagInfo) + { + m_tagInfo = new TagInfo; + m_tagInfo->tagName = e->tagInfo->tagName; + m_tagInfo->fileName = e->tagInfo->fileName; + m_tagInfo->anchor = e->tagInfo->anchor; + if (e->tagInfo) + { + //printf("tagInfo %p: tagName=%s fileName=%s anchor=%s\n", + // e->tagInfo, + // e->tagInfo->tagName.data(), + // e->tagInfo->fileName.data(), + // e->tagInfo->anchor.data()); + } + } + else + { + m_tagInfo = 0; + } +} + +EntryNav::~EntryNav() +{ + delete m_subList; + delete m_info; + delete m_tagInfo; +} + +void EntryNav::addChild(EntryNav *e) +{ + if (m_subList==0) + { + m_subList = new QList; + m_subList->setAutoDelete(TRUE); + } + m_subList->append(e); +} + +bool EntryNav::loadEntry(QFile &storage) +{ + if (m_noLoad) + { + return TRUE; + } + if (m_offset==-1) + { + //printf("offset not set!\n"); + return FALSE; + } + //delete m_info; + if (m_info==0) m_info = new Entry; + //printf("EntryNav::loadEntry: new entry %p: %s\n",m_info,m_name.data()); + m_info->name = m_name; + m_info->type = m_type; + m_info->section = m_section; + //m_info->tagInfo = m_tagInfo; + //if (m_parent) + //{ + // m_info->parent = m_parent->m_info; + //} + //m_info->parent = 0; + //printf("load entry: seek to %llx\n",m_offset); + if (!storage.seek(m_offset)) + { + //printf("seek failed!\n"); + return FALSE; + } + return ::loadEntry(m_info,storage); +} + +bool EntryNav::saveEntry(Entry *e,QFile &storage) +{ + m_offset = storage.pos(); + //printf("EntryNav::saveEntry offset=%llx\n",m_offset); + return ::saveEntry(e,storage); +} + +void EntryNav::releaseEntry() +{ + if (!m_noLoad) + { + delete m_info; + //printf("EntryNav::releaseEntry %p\n",m_info); + m_info=0; + } +} + +void EntryNav::setEntry(Entry *e) +{ + delete m_info; + m_info = e; + //printf("EntryNav::setEntry %p\n",e); + m_noLoad=TRUE; +} + diff --git a/src/entry.h b/src/entry.h index c8c6dfd..7cf6615 100644 --- a/src/entry.h +++ b/src/entry.h @@ -22,6 +22,9 @@ #include struct SectionInfo; +class QFile; +class EntryNav; +class FileDef; enum Protection { Public, Protected, Private, Package } ; enum Specifier { Normal, Virtual, Pure } ; @@ -246,35 +249,53 @@ class Entry Final = 0x0080, Abstract = 0x0100, }; + enum GroupDocType + { + GROUPDOC_NORMAL, //!< defgroup + GROUPDOC_ADD, //!< addgroup + GROUPDOC_WEAK //!< weakgroup + }; //!< kind of group + Entry(); Entry(const Entry &); ~Entry(); int getSize(); void addSpecialListItem(const char *listName,int index); + void createNavigationIndex(EntryNav *rootNav,QFile &storage,FileDef *fd); + + // while parsing a file these function can be used to navigate/build the tree + void setParent(Entry *parent) { m_parent = parent; } + Entry *parent() const { return m_parent; } + const QList *children() const { return m_sublist; } /*! Adds entry \e as a child to this entry */ void addSubEntry (Entry* e) ; /*! Restore the state of this Entry to the default value it has * at construction time. */ - void reset(); + void reset(); + + public: + + // identification + int section; //!< entry type (see Sections); + QCString type; //!< member type + QCString name; //!< member name + TagInfo *tagInfo; //!< tag file info - int section; //!< entry type (see Sections); + // content Protection protection; //!< class protection MethodTypes mtype; //!< signal, slot, (dcop) method, or property? + int memSpec; //!< member specifiers + int initLines; //!< define/variable initializer lines to show bool stat; //!< static ? bool explicitExternal; //!< explicitly defined as external? bool proto; //!< prototype ? - int memSpec; //!< member specifiers - int initLines; //!< define/variable initializer lines to show bool subGrouping; //!< automatically group class members? bool callGraph; //!< do we need to draw the call graph? bool callerGraph; //!< do we need to draw the caller graph? Specifier virt; //!< virtualness of the entry - Entry *parent; //!< parent node in the tree - QCString type; //!< member type - QCString name; //!< member name QCString args; //!< member argument string QCString bitfields; //!< member's bit fields ArgumentList *argList; //!< member arguments as a list @@ -301,23 +322,18 @@ class Entry int bodyLine; //!< line number of the definition in the source int endBodyLine; //!< line number where the definition ends int mGrpId; //!< member group id - QList *sublist; //!< entries that are children of this one QList *extends; //!< list of base classes QList *groups; //!< list of groups this entry belongs to QList *anchors; //!< list of anchors defined in this entry QCString fileName; //!< file this entry was extracted from int startLine; //!< start line of entry in the source QList *sli; //!< special lists (test/todo/bug/deprecated/..) this entry is in - TagInfo *tagInfo; //!< tag file info - static int num; //!< counts the total number of entries bool objc; //!< Objective-C construct - bool hidden; //!< does this represent an entity this is hidden from the output - enum - { - GROUPDOC_NORMAL, //!< defgroup - GROUPDOC_ADD, //!< addgroup - GROUPDOC_WEAK //!< weakgroup - } groupDocType; //!< kind of group + bool hidden; //!< does this represent an entity that is hidden from the output + GroupDocType groupDocType; + + static int num; //!< counts the total number of entries + /// return the command name used to define GROUPDOC_SEC const char *groupDocCmd() const { @@ -343,11 +359,59 @@ class Entry default: return Grouping::GROUPING_LOWEST; } } - private: + + private: + void createSubtreeIndex(EntryNav *nav,QFile &storage,FileDef *fd); + Entry *m_parent; //!< parent node in the tree + QList *m_sublist; //!< entries that are children of this one Entry &operator=(const Entry &); -} ; +}; + +class EntryNav +{ + public: + EntryNav(EntryNav *parent,Entry *e); + ~EntryNav(); + void addChild(EntryNav *); + bool loadEntry(QFile &storage); + bool saveEntry(Entry *e,QFile &storage); + void setEntry(Entry *e); + void releaseEntry(); + void changeSection(int section) { m_section = section; } + void setFileDef(FileDef *fd) { m_fileDef = fd; } + + Entry *entry() const { return m_info; } + int section() const { return m_section; } + const QCString &type() const { return m_type; } + const QCString &name() const { return m_name; } + TagInfo *tagInfo() const { return m_tagInfo; } + const QList *children() const { return m_subList; } + EntryNav *parent() const { return m_parent; } + FileDef *fileDef() const { return m_fileDef; } + + private: + + // navigation + EntryNav *m_parent; //!< parent node in the tree + QList *m_subList; //!< entries that are children of this one + + // identification + int m_section; //!< entry type (see Sections); + QCString m_type; //!< member type + QCString m_name; //!< member name + TagInfo *m_tagInfo; //!< tag file info + FileDef *m_fileDef; + + Entry *m_info; + int64 m_offset; + bool m_noLoad; +}; + typedef QList EntryList; typedef QListIterator EntryListIterator; +typedef QList EntryNavList; +typedef QListIterator EntryNavListIterator; + #endif diff --git a/src/filedef.cpp b/src/filedef.cpp index ebc0b16..a830fba 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -73,39 +73,39 @@ FileDef::FileDef(const char *p,const char *nm, diskname=dn; if (diskname.isEmpty()) diskname=nm; setReference(lref); - //printf("new FileDef(path=%s,name=%s,ref=%s)\n",p,nm,lref); - classSDict = new ClassSDict(17); - includeList = new QList; - includeList->setAutoDelete(TRUE); - includeDict = new QDict(61); - includedByList = new QList; - includedByList->setAutoDelete(TRUE); - includedByDict = new QDict(61); - namespaceSDict = new NamespaceSDict; - srcDefDict = 0; - srcMemberDict = 0; - usingDirList = 0; - usingDeclList = 0; - package = 0; - isSource = FALSE; - docname = nm; - dir = 0; + classSDict = 0; + includeList = 0; + includeDict = 0; + includedByList = 0; + includedByDict = 0; + namespaceSDict = 0; + srcDefDict = 0; + srcMemberDict = 0; + usingDirList = 0; + usingDeclList = 0; + allMemberList = 0; + decDefineMembers = 0; + decProtoMembers = 0; + decTypedefMembers = 0; + decEnumMembers = 0; + decFuncMembers = 0; + decVarMembers = 0; + docDefineMembers = 0; + docProtoMembers = 0; + docTypedefMembers = 0; + docEnumMembers = 0; + docFuncMembers = 0; + docVarMembers = 0; + package = 0; + isSource = FALSE; + docname = nm; + dir = 0; if (Config_getBool("FULL_PATH_NAMES")) { docname.prepend(stripFromPath(path.copy())); } - memberGroupSDict = new MemberGroupSDict; - memberGroupSDict->setAutoDelete(TRUE); + memberGroupSDict = 0; acquireFileVersion(); - - // members in the detailed part of the documentation - docDefineMembers.setInFile(TRUE); - docProtoMembers.setInFile(TRUE); - docTypedefMembers.setInFile(TRUE); - docEnumMembers.setInFile(TRUE); - docFuncMembers.setInFile(TRUE); - docVarMembers.setInFile(TRUE); - } /*! destroy the file definition */ @@ -122,40 +122,59 @@ FileDef::~FileDef() delete usingDirList; delete usingDeclList; delete memberGroupSDict; + delete allMemberList; + delete decDefineMembers; + delete decProtoMembers; + delete decTypedefMembers; + delete decEnumMembers; + delete decFuncMembers; + delete decVarMembers; + delete docDefineMembers; + delete docProtoMembers; + delete docTypedefMembers; + delete docEnumMembers; + delete docFuncMembers; + delete docVarMembers; } /*! Compute the HTML anchor names for all members in the class */ void FileDef::computeAnchors() { - setAnchors(0,'a',&allMemberList); + if (allMemberList) setAnchors(0,'a',allMemberList); } void FileDef::distributeMemberGroupDocumentation() { //printf("FileDef::distributeMemberGroupDocumentation()\n"); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - mg->distributeMemberGroupDocumentation(); + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->distributeMemberGroupDocumentation(); + } } } void FileDef::findSectionsInDocumentation() { docFindSections(documentation(),this,0,docFile()); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->findSectionsInDocumentation(); - } - decDefineMembers.findSectionsInDocumentation(); - decProtoMembers.findSectionsInDocumentation(); - decTypedefMembers.findSectionsInDocumentation(); - decEnumMembers.findSectionsInDocumentation(); - decFuncMembers.findSectionsInDocumentation(); - decVarMembers.findSectionsInDocumentation(); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->findSectionsInDocumentation(); + } + } + if (decDefineMembers) decDefineMembers->findSectionsInDocumentation(); + if (decProtoMembers) decProtoMembers->findSectionsInDocumentation(); + if (decTypedefMembers) decTypedefMembers->findSectionsInDocumentation(); + if (decEnumMembers) decEnumMembers->findSectionsInDocumentation(); + if (decFuncMembers) decFuncMembers->findSectionsInDocumentation(); + if (decVarMembers) decVarMembers->findSectionsInDocumentation(); } void FileDef::writeDetailedDocumentation(OutputList &ol) @@ -313,7 +332,8 @@ void FileDef::writeDocumentation(OutputList &ol) } ol.writeSynopsis(); - if (Config_getBool("SHOW_INCLUDE_FILES") && includeList->count()>0) + if (Config_getBool("SHOW_INCLUDE_FILES") && includeList && + includeList->count()>0) { ol.startTextBlock(TRUE); QListIterator ili(*includeList); @@ -439,7 +459,7 @@ void FileDef::writeDocumentation(OutputList &ol) ol.startMemberSections(); - if (namespaceSDict->count()>0) + if (namespaceSDict && namespaceSDict->count()>0) { NamespaceSDict::Iterator ndi(*namespaceSDict); NamespaceDef *nd; @@ -483,26 +503,29 @@ void FileDef::writeDocumentation(OutputList &ol) if (found) ol.endMemberList(); } - classSDict->writeDeclaration(ol); + if (classSDict) classSDict->writeDeclaration(ol); /* write user defined member groups */ - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - if (mg->header()!="[NOHEADER]") + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) { - mg->writeDeclarations(ol,0,0,this,0); + if (mg->header()!="[NOHEADER]") + { + mg->writeDeclarations(ol,0,0,this,0); + } } } //allMemberList.writeDeclarations(ol,0,0,this,0,0,0); - decDefineMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trDefines(),0); - decProtoMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trFuncProtos(),0); - decTypedefMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trTypedefs(),0); - decEnumMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trEnumerations(),0); - decFuncMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trFunctions(),0); - decVarMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0); + if (decDefineMembers) decDefineMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trDefines(),0); + if (decProtoMembers) decProtoMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFuncProtos(),0); + if (decTypedefMembers) decTypedefMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trTypedefs(),0); + if (decEnumMembers) decEnumMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trEnumerations(),0); + if (decFuncMembers) decFuncMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFunctions(),0); + if (decVarMembers) decVarMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0); ol.endMemberSections(); if (!Config_getBool("DETAILS_AT_TOP")) @@ -530,7 +553,7 @@ void FileDef::writeDocumentation(OutputList &ol) if (Config_getBool("SEPARATE_MEMBER_PAGES")) { - allMemberList.sort(); + if (allMemberList) allMemberList->sort(); writeMemberPages(ol); } } @@ -541,24 +564,42 @@ void FileDef::writeMemberDocumentation(OutputList &ol) { ol.disable(OutputGenerator::Html); } - - docDefineMembers.writeDocumentation(ol,name(),this, - theTranslator->trDefineDocumentation()); - - docProtoMembers.writeDocumentation(ol,name(),this, - theTranslator->trFunctionPrototypeDocumentation()); - docTypedefMembers.writeDocumentation(ol,name(),this, - theTranslator->trTypedefDocumentation()); - - docEnumMembers.writeDocumentation(ol,name(),this, - theTranslator->trEnumerationTypeDocumentation()); + if (docDefineMembers) + { + docDefineMembers->writeDocumentation(ol,name(),this, + theTranslator->trDefineDocumentation()); + } - docFuncMembers.writeDocumentation(ol,name(),this, - theTranslator->trFunctionDocumentation()); - - docVarMembers.writeDocumentation(ol,name(),this, - theTranslator->trVariableDocumentation()); + if (docProtoMembers) + { + docProtoMembers->writeDocumentation(ol,name(),this, + theTranslator->trFunctionPrototypeDocumentation()); + } + + if (docTypedefMembers) + { + docTypedefMembers->writeDocumentation(ol,name(),this, + theTranslator->trTypedefDocumentation()); + } + + if (docEnumMembers) + { + docEnumMembers->writeDocumentation(ol,name(),this, + theTranslator->trEnumerationTypeDocumentation()); + } + + if (docFuncMembers) + { + docFuncMembers->writeDocumentation(ol,name(),this, + theTranslator->trFunctionDocumentation()); + } + + if (docVarMembers) + { + docVarMembers->writeDocumentation(ol,name(),this, + theTranslator->trVariableDocumentation()); + } if (Config_getBool("SEPARATE_MEMBER_PAGES")) { @@ -571,12 +612,12 @@ void FileDef::writeMemberPages(OutputList &ol) ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - docDefineMembers.writeDocumentationPage(ol,name(),this); - docProtoMembers.writeDocumentationPage(ol,name(),this); - docTypedefMembers.writeDocumentationPage(ol,name(),this); - docEnumMembers.writeDocumentationPage(ol,name(),this); - docFuncMembers.writeDocumentationPage(ol,name(),this); - docVarMembers.writeDocumentationPage(ol,name(),this); + if (docDefineMembers) docDefineMembers->writeDocumentationPage(ol,name(),this); + if (docProtoMembers) docProtoMembers->writeDocumentationPage(ol,name(),this); + if (docTypedefMembers) docTypedefMembers->writeDocumentationPage(ol,name(),this); + if (docEnumMembers) docEnumMembers->writeDocumentationPage(ol,name(),this); + if (docFuncMembers) docFuncMembers->writeDocumentationPage(ol,name(),this); + if (docVarMembers) docVarMembers->writeDocumentationPage(ol,name(),this); ol.popGeneratorState(); } @@ -588,31 +629,34 @@ void FileDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const ol.writeString("
\n"); ol.writeString(" \n"); - MemberListIterator mli(allMemberList); - MemberDef *md; - for (mli.toFirst();(md=mli.current());++mli) + if (allMemberList) { - if (md->getFileDef()==this && md->getNamespaceDef()==0 && md->isLinkable()) + MemberListIterator mli(*allMemberList); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) { - ol.writeString(" \n"); } - ol.writeString("\n"); } } @@ -681,12 +725,12 @@ void FileDef::parseSource() void FileDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&decDefineMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decProtoMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decTypedefMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decFuncMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decVarMembers,memberGroupSDict,this); + ::addMembersToMemberGroup(decDefineMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decProtoMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decTypedefMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decEnumMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decFuncMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decVarMembers, &memberGroupSDict,this); } /*! Adds member definition \a md to the list of all members of this file */ @@ -694,42 +738,64 @@ void FileDef::insertMember(MemberDef *md) { //printf("%s:FileDef::insertMember(%s (=%p) list has %d elements)\n", // name().data(),md->name().data(),md,allMemberList.count()); - if (allMemberList.findRef(md)!=-1) + if (allMemberList && allMemberList->findRef(md)!=-1) { return; } - allMemberList.append(md); + if (allMemberList==0) + { + allMemberList = new MemberList; + } + allMemberList->append(md); bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS"); bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS"); switch (md->memberType()) { case MemberDef::Variable: case MemberDef::Property: - if (sortBriefDocs) decVarMembers.inSort(md); else decVarMembers.append(md); - if (sortMemberDocs) docVarMembers.inSort(md); else docVarMembers.append(md); + if (decVarMembers==0) decVarMembers = new MemberList; + if (sortBriefDocs) decVarMembers->inSort(md); else decVarMembers->append(md); + if (docVarMembers==0) docVarMembers = new MemberList; + if (sortMemberDocs) docVarMembers->inSort(md); else docVarMembers->append(md); + docVarMembers->setInFile(TRUE); break; case MemberDef::Function: - if (sortBriefDocs) decFuncMembers.inSort(md); else decFuncMembers.append(md); - if (sortMemberDocs) docFuncMembers.inSort(md); else docFuncMembers.append(md); + if (decFuncMembers==0) decFuncMembers = new MemberList; + if (sortBriefDocs) decFuncMembers->inSort(md); else decFuncMembers->append(md); + if (docFuncMembers==0) docFuncMembers = new MemberList; + if (sortMemberDocs) docFuncMembers->inSort(md); else docFuncMembers->append(md); + docFuncMembers->setInFile(TRUE); break; case MemberDef::Typedef: - if (sortBriefDocs) decTypedefMembers.inSort(md); else decTypedefMembers.append(md); - if (sortMemberDocs) docTypedefMembers.inSort(md); else docTypedefMembers.append(md); + if (decTypedefMembers==0) decTypedefMembers = new MemberList; + if (sortBriefDocs) decTypedefMembers->inSort(md); else decTypedefMembers->append(md); + if (docTypedefMembers==0) docTypedefMembers = new MemberList; + if (sortMemberDocs) docTypedefMembers->inSort(md); else docTypedefMembers->append(md); + docTypedefMembers->setInFile(TRUE); break; case MemberDef::Enumeration: - if (sortBriefDocs) decEnumMembers.inSort(md); else decEnumMembers.append(md); - if (sortMemberDocs) docEnumMembers.inSort(md); else docEnumMembers.append(md); + if (decEnumMembers==0) decEnumMembers = new MemberList; + if (sortBriefDocs) decEnumMembers->inSort(md); else decEnumMembers->append(md); + if (docEnumMembers==0) docEnumMembers = new MemberList; + if (sortMemberDocs) docEnumMembers->inSort(md); else docEnumMembers->append(md); + docEnumMembers->setInFile(TRUE); break; case MemberDef::EnumValue: // enum values are shown inside their enums break; case MemberDef::Prototype: - if (sortBriefDocs) decProtoMembers.inSort(md); else decProtoMembers.append(md); - if (sortMemberDocs) docProtoMembers.inSort(md); else docProtoMembers.append(md); + if (decProtoMembers==0) decProtoMembers = new MemberList; + if (sortBriefDocs) decProtoMembers->inSort(md); else decProtoMembers->append(md); + if (docProtoMembers==0) docProtoMembers = new MemberList; + if (sortMemberDocs) docProtoMembers->inSort(md); else docProtoMembers->append(md); + docProtoMembers->setInFile(TRUE); break; case MemberDef::Define: - if (sortBriefDocs) decDefineMembers.inSort(md); else decDefineMembers.append(md); - if (sortMemberDocs) docDefineMembers.inSort(md); else docDefineMembers.append(md); + if (decDefineMembers==0) decDefineMembers = new MemberList; + if (sortBriefDocs) decDefineMembers->inSort(md); else decDefineMembers->append(md); + if (docDefineMembers==0) docDefineMembers = new MemberList; + if (sortMemberDocs) docDefineMembers->inSort(md); else docDefineMembers->append(md); + docDefineMembers->setInFile(TRUE); break; default: err("FileDef::insertMembers(): " @@ -744,6 +810,10 @@ void FileDef::insertMember(MemberDef *md) /*! Adds compound definition \a cd to the list of all compounds of this file */ void FileDef::insertClass(ClassDef *cd) { + if (classSDict==0) + { + classSDict = new ClassSDict(17); + } if (Config_getBool("SORT_BRIEF_DOCS")) classSDict->inSort(cd->name(),cd); else @@ -753,8 +823,13 @@ void FileDef::insertClass(ClassDef *cd) /*! Adds namespace definition \a nd to the list of all compounds of this file */ void FileDef::insertNamespace(NamespaceDef *nd) { - if (!nd->name().isEmpty() && namespaceSDict->find(nd->name())==0) + if (!nd->name().isEmpty() && + (namespaceSDict==0 || namespaceSDict->find(nd->name())==0)) { + if (namespaceSDict==0) + { + namespaceSDict = new NamespaceSDict; + } if (Config_getBool("SORT_BRIEF_DOCS")) namespaceSDict->inSort(nd->name(),nd); else @@ -826,8 +901,14 @@ void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local, { //printf("FileDef::addIncludeDependency(%p,%s,%d)\n",fd,incName,local); QCString iName = fd ? fd->absFilePath().data() : incName; - if (!iName.isEmpty() && includeDict->find(iName)==0) + if (!iName.isEmpty() && (!includeDict || includeDict->find(iName)==0)) { + if (includeDict==0) + { + includeDict = new QDict(61); + includeList = new QList; + includeList->setAutoDelete(TRUE); + } IncludeInfo *ii = new IncludeInfo; ii->fileDef = fd; ii->includeName = incName; @@ -894,8 +975,14 @@ void FileDef::addIncludedByDependency(FileDef *fd,const char *incName, { //printf("FileDef::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local); QCString iName = fd ? fd->absFilePath().data() : incName; - if (!iName.isEmpty() && includedByDict->find(iName)==0) + if (!iName.isEmpty() && (includedByDict==0 || includedByDict->find(iName)==0)) { + if (includedByDict==0) + { + includedByDict = new QDict(61); + includedByList = new QList; + includedByList->setAutoDelete(TRUE); + } IncludeInfo *ii = new IncludeInfo; ii->fileDef = fd; ii->includeName = incName; @@ -909,7 +996,7 @@ void FileDef::addIncludedByDependency(FileDef *fd,const char *incName, bool FileDef::isIncluded(const QCString &name) const { if (name.isEmpty()) return FALSE; - return includeDict->find(name)!=0; + return includeDict!=0 && includeDict->find(name)!=0; } bool FileDef::generateSourceFile() const @@ -929,18 +1016,21 @@ void FileDef::addListReferences() theTranslator->trFile(TRUE,TRUE), getOutputFileBase(),name() ); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->addListReferences(this); - } - docDefineMembers.addListReferences(this); - docProtoMembers.addListReferences(this); - docTypedefMembers.addListReferences(this); - docEnumMembers.addListReferences(this); - docFuncMembers.addListReferences(this); - docVarMembers.addListReferences(this); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->addListReferences(this); + } + } + if (docDefineMembers) docDefineMembers->addListReferences(this); + if (docProtoMembers) docProtoMembers->addListReferences(this); + if (docTypedefMembers) docTypedefMembers->addListReferences(this); + if (docEnumMembers) docEnumMembers->addListReferences(this); + if (docFuncMembers) docFuncMembers->addListReferences(this); + if (docVarMembers) docVarMembers->addListReferences(this); } //------------------------------------------------------------------- diff --git a/src/filedef.h b/src/filedef.h index 8c5cf33..831c0f9 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -79,6 +79,11 @@ class FileDef : public Definition else return Definition::name(); } + + QCString fileName() const + { + return filename; + } QCString getOutputFileBase() const { return convertNameToFile(diskname); } @@ -166,23 +171,23 @@ class FileDef : public Definition //void generateXML(QTextStream &t); //void generateXMLSection(QTextStream &t,MemberList *ml,const char *type); - MemberList allMemberList; + MemberList *allMemberList; // members in the declaration part of the documentation - MemberList decDefineMembers; - MemberList decProtoMembers; - MemberList decTypedefMembers; - MemberList decEnumMembers; - MemberList decFuncMembers; - MemberList decVarMembers; + MemberList *decDefineMembers; + MemberList *decProtoMembers; + MemberList *decTypedefMembers; + MemberList *decEnumMembers; + MemberList *decFuncMembers; + MemberList *decVarMembers; // members in the detailed part of the documentation - MemberList docDefineMembers; - MemberList docProtoMembers; - MemberList docTypedefMembers; - MemberList docEnumMembers; - MemberList docFuncMembers; - MemberList docVarMembers; + MemberList *docDefineMembers; + MemberList *docProtoMembers; + MemberList *docTypedefMembers; + MemberList *docEnumMembers; + MemberList *docFuncMembers; + MemberList *docVarMembers; /* user defined member groups */ MemberGroupSDict *memberGroupSDict; @@ -198,27 +203,24 @@ class FileDef : public Definition */ void acquireFileVersion(); - private: - - QDict *includeDict; - QList *includeList; - QDict *includedByDict; - QList *includedByList; - NamespaceSDict *usingDirList; - SDict *usingDeclList; - QCString path; - QCString filepath; - QCString diskname; - QCString filename; - QCString docname; + QDict *includeDict; + QList *includeList; + QDict *includedByDict; + QList *includedByList; + NamespaceSDict *usingDirList; + SDict *usingDeclList; + QCString path; + QCString filepath; + QCString diskname; + QCString filename; + QCString docname; QIntDict *srcDefDict; - QIntDict *srcMemberDict; - bool isSource; - QCString fileVersion; - - PackageDef *package; - DirDef *dir; + QIntDict *srcMemberDict; + bool isSource; + QCString fileVersion; + PackageDef *package; + DirDef *dir; }; @@ -283,6 +285,7 @@ class DirEntry protected: DirEntry *m_parent; QCString m_name; + private: EntryKind m_kind; FileDef *m_fd; diff --git a/src/groupdef.cpp b/src/groupdef.cpp index d0ce1cc..7aee5c0 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -183,13 +183,13 @@ void GroupDef::addExample(const PageDef *def) void GroupDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&decDefineMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decProtoMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decTypedefMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumValMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decFuncMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decVarMembers,memberGroupSDict,this); + ::addMembersToMemberGroup(&decDefineMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decProtoMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decTypedefMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decEnumMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decEnumValMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decFuncMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decVarMembers,&memberGroupSDict,this); //printf("GroupDef::addMembersToMemberGroup() memberGroupList=%d\n",memberGroupList->count()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); @@ -413,12 +413,12 @@ void GroupDef::removeMember(MemberDef *md) bool GroupDef::containsGroup(const GroupDef *def) { - return groupList->find(def) >= 0; + return this==def || groupList->find(def) >= 0; } void GroupDef::addGroup(const GroupDef *def) { - //printf("adding group `%s' to group `%s'\n",def->name().data(),name().data()); + printf("adding group `%s' to group `%s'\n",def->name().data(),name().data()); //if (Config_getBool("SORT_MEMBER_DOCS")) // groupList->inSort(def); //else @@ -427,7 +427,7 @@ void GroupDef::addGroup(const GroupDef *def) bool GroupDef::isASubGroup() const { - return m_partOfGroups && m_partOfGroups->count()!=0; + return partOfGroups() && partOfGroups()->count()!=0; } int GroupDef::countMembers() const @@ -872,6 +872,8 @@ void addDirToGroups(Entry *root,DirDef *dd) void addGroupToGroups(Entry *root,GroupDef *subGroup) { + printf("addGroupToGroups for %s groups=%d\n",root->name.data(), + root->groups?root->groups->count():-1); QListIterator gli(*root->groups); Grouping *g; for (;(g=gli.current());++gli) diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 8e9b723..7907c94 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1558,20 +1558,14 @@ void HtmlGenerator::printDoc(DocNode *n,const char *langExt) delete visitor; } +//---------------- helpers for index generation ----------------------------- + static void startQuickIndexList(QTextStream &t,bool compact) { - bool fancyTabs=TRUE; if (compact) { - if (fancyTabs) - { - t << "
\n"; - t << "
    \n"; - } - else - { - t << "
    "; - } + t << "
    \n"; + t << "
      \n"; } else { @@ -1581,13 +1575,9 @@ static void startQuickIndexList(QTextStream &t,bool compact) static void endQuickIndexList(QTextStream &t,bool compact) { - bool fancyTabs=TRUE; if (compact) { - if (fancyTabs) - { - t << "
    "; - } + t << "
"; t << "
\n"; } else @@ -1597,71 +1587,134 @@ static void endQuickIndexList(QTextStream &t,bool compact) } static void startQuickIndexItem(QTextStream &t,const char *l, - bool hl,bool compact,bool &first, + bool hl,bool /*compact*/, const QCString &relPath) { - bool fancyTabs=TRUE; - if (!first && compact && !fancyTabs) t << " | "; - first=FALSE; - if (fancyTabs) - { - t << " "; + t << ""; +} + +static void endQuickIndexItem(QTextStream &t) +{ + t << ""; + t << ""; + t << "\n"; +} + +static QCString fixSpaces(const QCString &s) +{ + return substitute(s," "," "); +} + +static void writeNamespaceSubIndex(QTextStream &t,bool compact, + HighlightedItem hli,const QCString &relPath + ) +{ + startQuickIndexList(t,compact); + if (documentedNamespaces>0) { - if (!compact) t << "
  • "; - if (hl && compact) + startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, + hli==HLI_Namespaces,compact,relPath); + if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) { - t << "trPackages()); } else { - t << "trNamespaceList(); } + endQuickIndexItem(t); } - t << "href=\"" << relPath << l << "\">"; - if (fancyTabs) + if (documentedNamespaceMembers[NMHL_All]>0) { - t << ""; + startQuickIndexItem(t,"namespacemembers"+Doxygen::htmlFileExtension, + hli==HLI_NamespaceMembers,compact,relPath); + if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) + { + t << fixSpaces(theTranslator->trPackageMembers()); + } + else + { + t << fixSpaces(theTranslator->trNamespaceMembers()); + } + endQuickIndexItem(t); } + endQuickIndexList(t,compact); } -static void endQuickIndexItem(QTextStream &t) +static void writeClassSubIndex(QTextStream &t,bool compact, + HighlightedItem hli,const QCString &relPath + ) { - bool fancyTabs=TRUE; - if (fancyTabs) t << ""; - t << ""; - if (fancyTabs) t << "
  • \n"; + startQuickIndexList(t,compact); + if (annotatedClasses>0) + { + if (Config_getBool("ALPHABETICAL_INDEX")) + { + startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, + hli==HLI_Classes,compact,relPath); + t << fixSpaces(theTranslator->trAlphabeticalList()); + endQuickIndexItem(t); + } + startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, + hli==HLI_Annotated,compact,relPath); + t << fixSpaces(theTranslator->trCompoundList()); + endQuickIndexItem(t); + } + if (hierarchyClasses>0) + { + startQuickIndexItem(t,"hierarchy"+Doxygen::htmlFileExtension, + hli==HLI_Hierarchy,compact,relPath); + t << fixSpaces(theTranslator->trClassHierarchy()); + endQuickIndexItem(t); + } + if (documentedClassMembers[CMHL_All]>0) + { + startQuickIndexItem(t,"functions"+Doxygen::htmlFileExtension, + hli==HLI_Functions,compact,relPath); + t << fixSpaces(theTranslator->trCompoundMembers()); + endQuickIndexItem(t); + } + endQuickIndexList(t,compact); } -static QCString fixSpaces(const QCString &s) +static void writeFileSubIndex(QTextStream &t,bool compact, + HighlightedItem hli,const QCString &relPath) { - return substitute(s," "," "); + startQuickIndexList(t,compact); + if (documentedHtmlFiles>0) + { + startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, + hli==HLI_Files,compact,relPath); + t << fixSpaces(theTranslator->trFileList()); + endQuickIndexItem(t); + } + if (documentedFileMembers[FMHL_All]>0) + { + startQuickIndexItem(t,"globals"+Doxygen::htmlFileExtension, + hli==HLI_Globals,compact,relPath); + t << fixSpaces(theTranslator->trFileMembers()); + endQuickIndexItem(t); + } + endQuickIndexList(t,compact); } static void writeDefaultQuickLinks(QTextStream &t,bool compact, HighlightedItem hli,const QCString &relPath) { - bool first=TRUE; - bool fancyTabs=TRUE; startQuickIndexList(t,compact); - if (Config_getBool("SEARCHENGINE") && !fancyTabs) - { - t << "
    \n"; - } - if (Config_getBool("GENERATE_TREEVIEW")) { startQuickIndexItem(t,"main"+Doxygen::htmlFileExtension, - hli==HLI_Main,compact,first,relPath); + hli==HLI_Main,compact,relPath); } else { startQuickIndexItem(t,"index"+Doxygen::htmlFileExtension, - hli==HLI_Main,compact,first,relPath); + hli==HLI_Main,compact,relPath); } t << fixSpaces(theTranslator->trMainPage()); endQuickIndexItem(t); @@ -1669,7 +1722,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, if (documentedGroups>0) { startQuickIndexItem(t,"modules"+Doxygen::htmlFileExtension, - hli==HLI_Modules,compact,first,relPath); + hli==HLI_Modules,compact,relPath); t << fixSpaces(theTranslator->trModules()); endQuickIndexItem(t); } @@ -1680,7 +1733,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, { startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, hli==HLI_Namespaces || hli==HLI_NamespaceMembers || hli==HLI_NamespaceVisible, - compact,first,relPath); + compact,relPath); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) { t << fixSpaces(theTranslator->trPackages()); @@ -1690,6 +1743,10 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, t << theTranslator->trNamespaces(); } endQuickIndexItem(t); + if (!compact) + { + writeNamespaceSubIndex(t,compact,hli,relPath); + } } @@ -1702,10 +1759,14 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, startQuickIndexItem(t,QCString(alphaIndex?"classes":"annotated")+Doxygen::htmlFileExtension, hli==HLI_Hierarchy || hli==HLI_Classes || hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible, - compact,first,relPath); + compact,relPath); } t << fixSpaces(theTranslator->trClasses()); endQuickIndexItem(t); + if (!compact) + { + writeClassSubIndex(t,compact,hli,relPath); + } } @@ -1715,72 +1776,63 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, { startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, hli==HLI_Files || hli==HLI_Globals || hli==HLI_FileVisible, - compact,first,relPath); + compact,relPath); t << fixSpaces(theTranslator->trFile(TRUE,FALSE)); endQuickIndexItem(t); + if (!compact) + { + writeFileSubIndex(t,compact,hli,relPath); + } } - // ------------------------------------------------ + // -------------- Directories if (Config_getBool("SHOW_DIRECTORIES") && documentedDirs>0) { startQuickIndexItem(t,"dirs"+Doxygen::htmlFileExtension, - hli==HLI_Directories,compact,first,relPath); + hli==HLI_Directories,compact,relPath); t << fixSpaces(theTranslator->trDirectories()); endQuickIndexItem(t); } + + // -------------- Related pages + if (indexedPages>0) { startQuickIndexItem(t,"pages"+Doxygen::htmlFileExtension, - hli==HLI_Pages,compact,first,relPath); + hli==HLI_Pages,compact,relPath); t << fixSpaces(theTranslator->trRelatedPages()); endQuickIndexItem(t); } + + // -------------- Examples + if (Doxygen::exampleSDict->count()>0) { startQuickIndexItem(t,"examples"+Doxygen::htmlFileExtension, - hli==HLI_Examples,compact,first,relPath); + hli==HLI_Examples,compact,relPath); t << fixSpaces(theTranslator->trExamples()); endQuickIndexItem(t); } + + // -------------- Search field + if (Config_getBool("SEARCHENGINE")) { QCString searchFor = fixSpaces(theTranslator->trSearchForIndex()); if (searchFor.at(0)=='S') searchFor="S"+searchFor.mid(1); - if (fancyTabs) - { - t << "
  • \n"; - t << " \n"; - t << "
  • "); - if (md->isLinkableInProject()) + if (md->getFileDef()==this && md->getNamespaceDef()==0 && md->isLinkable()) { - if (md==currentMd) // selected item => highlight - { - ol.writeString(""); + if (md->isLinkableInProject()) { - ol.writeString(" highlight + { + ol.writeString("getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->localName()); + ol.writeString(""); } - ol.writeString("href=\""); - if (createSubDirs) ol.writeString("../../"); - ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); - ol.writeString("\">"); - ol.writeString(md->localName()); - ol.writeString(""); + ol.writeString("
    \n"; - t << " \n"; - t << " \n"; - if (hli!=HLI_Search) - { - t << " \n"; - t << " \n"; - t << "
    \n"; - t << " \n"; - t << " \n"; - } - } - else + t << "
  • \n"; + t << "
    \n"; + t << " \n"; + t << " \n"; + t << " \n"; + if (hli!=HLI_Search) { - if (compact) - { - t << " | "; - } - else - { - t << "
  • "; - } - t << "" << searchFor << " "; - if (hli!=HLI_Search) - { - t << "" - ""; - } + t << "
  • \n"; + t << " \n"; + t << "
    \n"; + t << " \n"; + t << "
  • \n"; } } if (hli!=HLI_Search) // on the search page the page will be ended by the @@ -1790,7 +1842,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, } //------------------------------------------------------------------------- - // write sub indices + // write sub indices in compact mode if ((hli==HLI_Namespaces || hli==HLI_NamespaceMembers || hli==HLI_NamespaceVisible @@ -1798,94 +1850,22 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, documentedNamespaces>0 && documentedNamespaceMembers[NMHL_All]>0) { - startQuickIndexList(t,compact); - if (documentedNamespaces>0) - { - startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, - hli==HLI_Namespaces,compact,first,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackages()); - } - else - { - t << theTranslator->trNamespaceList(); - } - endQuickIndexItem(t); - } - if (documentedNamespaceMembers[NMHL_All]>0) - { - startQuickIndexItem(t,"namespacemembers"+Doxygen::htmlFileExtension, - hli==HLI_NamespaceMembers,compact,first,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackageMembers()); - } - else - { - t << fixSpaces(theTranslator->trNamespaceMembers()); - } - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); + writeNamespaceSubIndex(t,compact,hli,relPath); } else if ((hli==HLI_Hierarchy || hli==HLI_Classes || hli==HLI_Annotated || hli==HLI_Functions || - hli==HLI_ClassVisible + hli==HLI_ClassVisible || !compact ) && annotatedClasses>0 ) { - startQuickIndexList(t,compact); - if (annotatedClasses>0) - { - if (Config_getBool("ALPHABETICAL_INDEX")) - { - startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, - hli==HLI_Classes,compact,first,relPath); - t << fixSpaces(theTranslator->trAlphabeticalList()); - endQuickIndexItem(t); - } - startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, - hli==HLI_Annotated,compact,first,relPath); - t << fixSpaces(theTranslator->trCompoundList()); - endQuickIndexItem(t); - } - if (hierarchyClasses>0) - { - startQuickIndexItem(t,"hierarchy"+Doxygen::htmlFileExtension, - hli==HLI_Hierarchy,compact,first,relPath); - t << fixSpaces(theTranslator->trClassHierarchy()); - endQuickIndexItem(t); - } - if (documentedClassMembers[CMHL_All]>0) - { - startQuickIndexItem(t,"functions"+Doxygen::htmlFileExtension, - hli==HLI_Functions,compact,first,relPath); - t << fixSpaces(theTranslator->trCompoundMembers()); - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); + writeClassSubIndex(t,compact,hli,relPath); } - else if ((hli==HLI_Files || hli==HLI_Globals || hli==HLI_FileVisible) && - documentedHtmlFiles>0 && documentedFileMembers[FMHL_All]>0 + else if ((hli==HLI_Files || hli==HLI_Globals || + hli==HLI_FileVisible || !compact + ) && documentedHtmlFiles>0 && documentedFileMembers[FMHL_All]>0 ) { - startQuickIndexList(t,compact); - if (documentedHtmlFiles>0) - { - startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, - hli==HLI_Files,compact,first,relPath); - t << fixSpaces(theTranslator->trFileList()); - endQuickIndexItem(t); - } - if (documentedFileMembers[FMHL_All]>0) - { - startQuickIndexItem(t,"globals"+Doxygen::htmlFileExtension, - hli==HLI_Globals,compact,first,relPath); - t << fixSpaces(theTranslator->trFileMembers()); - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); + writeFileSubIndex(t,compact,hli,relPath); } } diff --git a/src/index.cpp b/src/index.cpp index 0c8394c..324b42b 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -280,7 +280,7 @@ void endFile(OutputList &ol,bool) static bool classHasVisibleChildren(ClassDef *cd) { - if (cd->subClasses()->count()==0) return FALSE; + if (cd->subClasses()==0) return FALSE; BaseClassList *bcl=cd->subClasses(); BaseClassListIterator bcli(*bcl); for ( ; bcli.current() ; ++bcli) @@ -295,6 +295,7 @@ static bool classHasVisibleChildren(ClassDef *cd) void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) { + if (bcl==0) return; HtmlHelp *htmlHelp=0; FTVHelp *ftvHelp=0; bool &generateHtml = Config_getBool("GENERATE_HTML") ; @@ -379,6 +380,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) void writeClassTree(BaseClassList *cl,int level) { + if (cl==0) return; HtmlHelp *htmlHelp=0; FTVHelp *ftvHelp=0; bool &generateHtml = Config_getBool("GENERATE_HTML") ; @@ -468,6 +470,7 @@ void writeClassTreeNode(ClassDef *cd,bool hasHtmlHelp,bool hasFtvHelp,bool &star void writeClassTree(ClassList *cl,int level) { + if (cl==0) return; bool &generateHtml = Config_getBool("GENERATE_HTML") ; bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); @@ -485,6 +488,7 @@ void writeClassTree(ClassList *cl,int level) void writeClassTree(ClassSDict *d,int level) { + if (d==0) return; bool &generateHtml = Config_getBool("GENERATE_HTML") ; bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); @@ -625,7 +629,7 @@ static int countClassesInTreeList(const ClassSDict &cl) { if (cd->isVisibleInHierarchy()) // should it be visible { - if (cd->subClasses()->count()>0) // should have sub classes + if (cd->subClasses()) // should have sub classes { count++; } diff --git a/src/lang_cfg.h b/src/lang_cfg.h index d99d747..8b6efc6 100644 --- a/src/lang_cfg.h +++ b/src/lang_cfg.h @@ -30,3 +30,5 @@ #define LANG_CA #define LANG_LT #define LANG_ZA +#define LANG_AR +#define LANG_FA diff --git a/src/language.cpp b/src/language.cpp index fad615d..58655d8 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -121,7 +121,13 @@ #ifdef LANG_ZA #include "translator_za.h" #endif +#ifdef LANG_AR +#include "translator_ar.h" #endif +#ifdef LANG_FA +#include "translator_fa.h" +#endif +#endif // !ENGLISH_ONLY #define L_EQUAL(a) !stricmp(langName,a) @@ -338,6 +344,18 @@ bool setTranslator(const char *langName) theTranslator=new TranslatorAfrikaans; } #endif +#ifdef LANG_AR + else if (L_EQUAL("arabic")) + { + theTranslator=new TranslatorArabic; + } +#endif +#ifdef LANG_FA + else if (L_EQUAL("persian")) + { + theTranslator=new TranslatorPersian; + } +#endif #endif // ENGLISH_ONLY else // use the default language (i.e. english) { diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 318b18d..f2d086b 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -232,7 +232,7 @@ void LatexDocVisitor::visit(DocStyleChange *s) if (s->enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} "; break; case DocStyleChange::Small: - if (s->enable()) m_t << "\\footnotesize "; else m_t << "\\normalsize "; + if (s->enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize "; break; case DocStyleChange::Preformatted: if (s->enable()) @@ -243,7 +243,7 @@ void LatexDocVisitor::visit(DocStyleChange *s) else { m_insidePre=FALSE; - m_t << "\\end{alltt}\\normalsize " << endl; + m_t << "\\end{alltt}\n\\normalsize " << endl; } break; case DocStyleChange::Div: /* HTML only */ break; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 753e353..a34aa67 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -431,7 +431,7 @@ MemberDef::MemberDef(const char *df,int dl, m_hasDocumentedParams = FALSE; m_hasDocumentedReturnType = FALSE; m_docProvider = 0; - m_isDMember = m_defFileName.right(2).lower()==".d"; + m_isDMember = getDefFileName().right(2).lower()==".d"; } /*! Destroys the member definition. */ @@ -541,7 +541,7 @@ QCString MemberDef::getOutputFileBase() const if (baseName.isEmpty()) { - warn(m_defFileName,m_defLine, + warn(getDefFileName(),getDefLine(), "Warning: Internal inconsistency: member %s does not belong to any" " container!",name().data() ); @@ -874,6 +874,10 @@ void MemberDef::writeDeclaration(OutputList &ol, { //printf("%s MemberDef::writeDeclaration() inGroup=%d\n",name().data(),inGroup); + // hide enum value, since they appear already as part of the enum, unless they + // are explicitly grouped. + if (!inGroup && mtype==EnumValue) return; + // hide members whose brief section should not be visible //if (!isBriefSectionVisible()) return; @@ -2040,7 +2044,7 @@ void MemberDef::warnIfUndocumented() (prot!=Private || Config_getBool("EXTRACT_PRIVATE")) ) { - warn_undoc(m_defFileName,m_defLine,"Warning: Member %s%s (%s) of %s %s is not documented.", + warn_undoc(getDefFileName(),getDefLine(),"Warning: Member %s%s (%s) of %s %s is not documented.", name().data(),argsString()?argsString():"",memberTypeName().data(),t,d->name().data()); } } diff --git a/src/memberdef.h b/src/memberdef.h index d7da3db..819671f 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -314,85 +314,75 @@ class MemberDef : public Definition bool visited; private: + // disable copying of member defs + MemberDef(const MemberDef &); + MemberDef &operator=(const MemberDef &); + void writeLink(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, bool onlyText=FALSE); - ClassDef *classDef; // member of or related to - FileDef *fileDef; // member of file definition + ClassDef *classDef; // member of or related to + FileDef *fileDef; // member of file definition + NamespaceDef *nspace; // the namespace this member is in. + MemberDef *enumScope; // the enclosing scope, if this is an enum field MemberDef *annEnumType; // the annonymous enum that is the type of this member + MemberList *enumFields; // enumeration fields + OutputList *enumDeclList; // stored piece of documentation for enumeration. + MemberDef *redefines; // the members that this member redefines MemberList *redefinedBy; // the list of members that redefine this one + MemberDef *memDef; // member definition for this declaration MemberDef *memDec; // member declaration for this definition ClassDef *m_relatedAlso; // points to class marked by relatedAlso ExampleSDict *exampleSDict; // a dictionary of all examples for quick access - MemberList *enumFields; // enumeration fields - OutputList *enumDeclList; // stored piece of documentation for enumeration. - NamespaceDef *nspace; // the namespace this member is in. QCString type; // return type QCString args; // function arguments/variable array specifiers + QCString def; // member definition in code (fully qualified name) + QCString anc; // HTML anchor name + Specifier virt; // normal/virtual/pure virtual + Protection prot; // protection type [Public/Protected/Private] + QCString decl; // member declaration in class: TODO: can be generated + QCString bitfields; // struct member bitfields QCString read; // property read accessor QCString write; // property write accessor QCString exception; // exceptions that can be thrown QCString init; // initializer int initLines; // number of lines in the initializer - QCString decl; // member declaration in class - QCString def; // member definition in code (fully qualified name) - QCString anc; // HTML anchor name - MemberDef *groupAlias; // Member containing the definition - Specifier virt; // normal/virtual/pure virtual - Protection prot; // protection type [Public/Protected/Private] + int memSpec; // The specifiers present for this member MemberType mtype; // returns the kind of member - bool related; // is this a member that is only related to a class - bool stat; // is it a static function? - bool proto; // is it a prototype; - bool docEnumValues; // is an enum with documented enum values. - bool annScope; // member is part of an annoymous scope - bool annUsed; - bool annShown; - bool m_hasCallGraph; - bool m_hasCallerGraph; int maxInitLines; // when the initializer will be displayed int userInitLines; // result of explicit \hideinitializer or \showinitializer MemberList *section; // declation list containing this member MemberDef *annMemb; + ArgumentList *defArgList; // argument list of this member definition ArgumentList *declArgList; // argument list of this member declaration + ArgumentList *tArgList; // template argument list of function template + MemberDef *m_templateMaster; QList *m_defTmpArgLists; - int grpId; // group id - MemberGroup *memberGroup; // group's member definition - - GroupDef *group; // group in which this member is in - bool explExt; // member was explicitly declared external - bool tspec; // member is a template specialization ClassDef *cachedAnonymousType; // if the member has an anonymous compound // as its type then this is computed by // getClassDefOfAnonymousType() and // cached here. + SDict *classSectionSDict; + + MemberDef *groupAlias; // Member containing the definition + int grpId; // group id + MemberGroup *memberGroup; // group's member definition + GroupDef *group; // group in which this member is in Grouping::GroupPri_t grouppri; // priority of this definition QCString groupFileName; // file where this grouping was defined int groupStartLine; // line " " " " " - bool groupHasDocs; // true if the entry that caused the grouping was documented MemberDef *groupMember; - MemberDef *m_templateMaster; - SDict *classSectionSDict; - bool docsForDefinition; // TRUE => documentation block is put before - // definition. - // FALSE => block is put before declaration. - - - // disable copying of member defs - MemberDef(const MemberDef &); - MemberDef &operator=(const MemberDef &); - static int s_indentLevel; bool m_isTypedefValCached; ClassDef *m_cachedTypedefValue; @@ -403,20 +393,36 @@ class MemberDef : public Definition QCString m_inbodyFile; QCString m_inbodyDocs; - // objective-c - bool m_implOnly; // function found in implementation but not - // in the interface - - bool m_hasDocumentedParams; - bool m_hasDocumentedReturnType; - // documentation inheritance MemberDef *m_docProvider; // to store the output file base from tag files QCString explicitOutputFileBase; + // objective-c + bool m_implOnly; // function found in implementation but not + // in the interface + bool m_hasDocumentedParams; + bool m_hasDocumentedReturnType; bool m_isDMember; + bool related; // is this a member that is only related to a class + bool stat; // is it a static function? + bool proto; // is it a prototype; + bool docEnumValues; // is an enum with documented enum values. + bool annScope; // member is part of an annoymous scope + bool annUsed; + bool annShown; + bool m_hasCallGraph; + bool m_hasCallerGraph; + bool explExt; // member was explicitly declared external + bool tspec; // member is a template specialization + bool groupHasDocs; // true if the entry that caused the grouping was documented + bool docsForDefinition; // TRUE => documentation block is put before + // definition. + // FALSE => block is put before declaration. + + static int s_indentLevel; + }; #endif diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 4a1297b..3ead6af 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -139,12 +139,12 @@ void NamespaceDef::insertNamespace(NamespaceDef *nd) void NamespaceDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&decDefineMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decProtoMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decTypedefMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decFuncMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decVarMembers,memberGroupSDict,this); + ::addMembersToMemberGroup(&decDefineMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decProtoMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decTypedefMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decEnumMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decFuncMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decVarMembers,&memberGroupSDict,this); } void NamespaceDef::insertMember(MemberDef *md) diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 23e1766..c9c8962 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1552,7 +1552,7 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) void PerlModGenerator::generatePerlModSection(Definition *d, MemberList *ml,const char *name,const char *header) { - if (ml->count()==0) return; // empty list + if (ml==0) return; // empty list m_output.openHash(name); @@ -1573,29 +1573,32 @@ void PerlModGenerator::generatePerlModSection(Definition *d, void PerlModGenerator::addListOfAllMembers(ClassDef *cd) { m_output.openList("all_members"); - MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); - MemberNameInfo *mni; - for (mnii.toFirst();(mni=mnii.current());++mnii) + if (cd->memberNameInfoSDict()) { - MemberNameInfoIterator mii(*mni); - MemberInfo *mi; - for (mii.toFirst();(mi=mii.current());++mii) + MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); + MemberNameInfo *mni; + for (mnii.toFirst();(mni=mnii.current());++mnii) { - MemberDef *md=mi->memberDef; - ClassDef *cd=md->getClassDef(); - Definition *d=md->getGroupDef(); - if (d==0) d = cd; + MemberNameInfoIterator mii(*mni); + MemberInfo *mi; + for (mii.toFirst();(mi=mii.current());++mii) + { + MemberDef *md=mi->memberDef; + ClassDef *cd=md->getClassDef(); + Definition *d=md->getGroupDef(); + if (d==0) d = cd; - m_output.openHash() - .addFieldQuotedString("name", md->name()) - .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) - .addFieldQuotedString("protection", getProtectionName(mi->prot)); + m_output.openHash() + .addFieldQuotedString("name", md->name()) + .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) + .addFieldQuotedString("protection", getProtectionName(mi->prot)); - if (!mi->ambiguityResolutionScope.isEmpty()) - m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); + if (!mi->ambiguityResolutionScope.isEmpty()) + m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); - m_output.addFieldQuotedString("scope", cd->name()) - .closeHash(); + m_output.addFieldQuotedString("scope", cd->name()) + .closeHash(); + } } } m_output.closeList(); @@ -1626,7 +1629,7 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) m_output.openHash() .addFieldQuotedString("name", cd->name()); - if (cd->baseClasses()->count()>0) + if (cd->baseClasses()) { m_output.openList("base"); BaseClassListIterator bcli(*cd->baseClasses()); @@ -1640,10 +1643,10 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) m_output.closeList(); } - if (cd->subClasses()->count()>0) + if (cd->subClasses()) { m_output.openList("derived"); - BaseClassListIterator bcli(*cd->baseClasses()); + BaseClassListIterator bcli(*cd->subClasses()); BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) m_output.openHash() @@ -1692,29 +1695,29 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) for (;(mg=mgli.current());++mgli) generatePerlModSection(cd,mg->members(),"user_defined",mg->header()); - generatePerlModSection(cd,&cd->pubTypes,"public_typedefs"); - generatePerlModSection(cd,&cd->pubMethods,"public_methods"); - generatePerlModSection(cd,&cd->pubAttribs,"public_members"); - generatePerlModSection(cd,&cd->pubSlots,"public_slots"); - generatePerlModSection(cd,&cd->signals,"signals"); - generatePerlModSection(cd,&cd->dcopMethods,"dcop_methods"); - generatePerlModSection(cd,&cd->properties,"properties"); - generatePerlModSection(cd,&cd->pubStaticMethods,"public_static_methods"); - generatePerlModSection(cd,&cd->pubStaticAttribs,"public_static_members"); - generatePerlModSection(cd,&cd->proTypes,"protected_typedefs"); - generatePerlModSection(cd,&cd->proMethods,"protected_methods"); - generatePerlModSection(cd,&cd->proAttribs,"protected_members"); - generatePerlModSection(cd,&cd->proSlots,"protected_slots"); - generatePerlModSection(cd,&cd->proStaticMethods,"protected_static_methods"); - generatePerlModSection(cd,&cd->proStaticAttribs,"protected_static_members"); - generatePerlModSection(cd,&cd->priTypes,"private_typedefs"); - generatePerlModSection(cd,&cd->priMethods,"private_methods"); - generatePerlModSection(cd,&cd->priAttribs,"private_members"); - generatePerlModSection(cd,&cd->priSlots,"private_slots"); - generatePerlModSection(cd,&cd->priStaticMethods,"private_static_methods"); - generatePerlModSection(cd,&cd->priStaticAttribs,"private_static_members"); - generatePerlModSection(cd,&cd->friends,"friend_methods"); - generatePerlModSection(cd,&cd->related,"related_methods"); + generatePerlModSection(cd,cd->pubTypes,"public_typedefs"); + generatePerlModSection(cd,cd->pubMethods,"public_methods"); + generatePerlModSection(cd,cd->pubAttribs,"public_members"); + generatePerlModSection(cd,cd->pubSlots,"public_slots"); + generatePerlModSection(cd,cd->signals,"signals"); + generatePerlModSection(cd,cd->dcopMethods,"dcop_methods"); + generatePerlModSection(cd,cd->properties,"properties"); + generatePerlModSection(cd,cd->pubStaticMethods,"public_static_methods"); + generatePerlModSection(cd,cd->pubStaticAttribs,"public_static_members"); + generatePerlModSection(cd,cd->proTypes,"protected_typedefs"); + generatePerlModSection(cd,cd->proMethods,"protected_methods"); + generatePerlModSection(cd,cd->proAttribs,"protected_members"); + generatePerlModSection(cd,cd->proSlots,"protected_slots"); + generatePerlModSection(cd,cd->proStaticMethods,"protected_static_methods"); + generatePerlModSection(cd,cd->proStaticAttribs,"protected_static_members"); + generatePerlModSection(cd,cd->priTypes,"private_typedefs"); + generatePerlModSection(cd,cd->priMethods,"private_methods"); + generatePerlModSection(cd,cd->priAttribs,"private_members"); + generatePerlModSection(cd,cd->priSlots,"private_slots"); + generatePerlModSection(cd,cd->priStaticMethods,"private_static_methods"); + generatePerlModSection(cd,cd->priStaticAttribs,"private_static_members"); + generatePerlModSection(cd,cd->friends,"friend_methods"); + generatePerlModSection(cd,cd->related,"related_methods"); addPerlModDocBlock(m_output,"brief",cd->getDefFileName(),cd->getDefLine(),cd,0,cd->briefDescription()); addPerlModDocBlock(m_output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd,0,cd->documentation()); @@ -1829,41 +1832,47 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd) m_output.openHash() .addFieldQuotedString("name", fd->name()); - QListIterator ili1(*fd->includeFileList()); IncludeInfo *inc; m_output.openList("includes"); - for (ili1.toFirst();(inc=ili1.current());++ili1) + if (fd->includeFileList()) { - m_output.openHash() - .addFieldQuotedString("name", inc->includeName); - if (inc->fileDef && !inc->fileDef->isReference()) + QListIterator ili1(*fd->includeFileList()); + for (ili1.toFirst();(inc=ili1.current());++ili1) { - m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + m_output.openHash() + .addFieldQuotedString("name", inc->includeName); + if (inc->fileDef && !inc->fileDef->isReference()) + { + m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + } + m_output.closeHash(); } - m_output.closeHash(); } m_output.closeList(); - QListIterator ili2(*fd->includedByFileList()); m_output.openList("included_by"); - for (ili2.toFirst();(inc=ili2.current());++ili2) + if (fd->includedByFileList()) { - m_output.openHash() - .addFieldQuotedString("name", inc->includeName); - if (inc->fileDef && !inc->fileDef->isReference()) + QListIterator ili2(*fd->includedByFileList()); + for (ili2.toFirst();(inc=ili2.current());++ili2) { - m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + m_output.openHash() + .addFieldQuotedString("name", inc->includeName); + if (inc->fileDef && !inc->fileDef->isReference()) + { + m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + } + m_output.closeHash(); } - m_output.closeHash(); } m_output.closeList(); - generatePerlModSection(fd,&fd->decDefineMembers,"defines"); - generatePerlModSection(fd,&fd->decProtoMembers,"prototypes"); - generatePerlModSection(fd,&fd->decTypedefMembers,"typedefs"); - generatePerlModSection(fd,&fd->decEnumMembers,"enums"); - generatePerlModSection(fd,&fd->decFuncMembers,"functions"); - generatePerlModSection(fd,&fd->decVarMembers,"variables"); + generatePerlModSection(fd,fd->decDefineMembers,"defines"); + generatePerlModSection(fd,fd->decProtoMembers,"prototypes"); + generatePerlModSection(fd,fd->decTypedefMembers,"typedefs"); + generatePerlModSection(fd,fd->decEnumMembers,"enums"); + generatePerlModSection(fd,fd->decFuncMembers,"functions"); + generatePerlModSection(fd,fd->decVarMembers,"variables"); addPerlModDocBlock(m_output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); addPerlModDocBlock(m_output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); diff --git a/src/pycode.l b/src/pycode.l index ae3c543..306a042 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -696,12 +696,15 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) if (!locScope.isEmpty() && (ccd=g_codeClassSDict[locScope])) { //printf("using classScope %s\n",g_classScope.data()); - BaseClassListIterator bcli(*ccd->baseClasses()); - for ( ; bcli.current() ; ++bcli) + if (ccd->baseClasses()) { - if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) + BaseClassListIterator bcli(*ccd->baseClasses()); + for ( ; bcli.current() ; ++bcli) { - return; + if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) + { + return; + } } } } diff --git a/src/pyscanner.l b/src/pyscanner.l index 6420e40..63d6fd4 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -129,7 +129,7 @@ static void initEntry() current->virt = virt; current->stat = gstat; current->objc = FALSE; //insideObjC; - current->parent = current_root; + current->setParent(current_root); initGroupInfo(current); } @@ -950,6 +950,7 @@ STARTDOCSYMS ^{B}"##"/[^#] [^ \t\n#'"]+ { // non-special stuff current->program+=yytext; g_specialBlock = FALSE; + g_hideClassDocs = FALSE; } {NEWLINE} { current->program+=*yytext; @@ -1059,6 +1060,7 @@ STARTDOCSYMS ^{B}"##"/[^#] { "=" { // the assignment operator + printf("====== VariableDec at line %d\n",yyLineNr); } {B} { // spaces } @@ -1128,6 +1130,9 @@ STARTDOCSYMS ^{B}"##"/[^#] "#".* { // comment BEGIN( VariableEnd ); } + {IDENTIFIER} { + current->initializer+=yytext; + } . { current->initializer+=*yytext; } @@ -1378,7 +1383,7 @@ STARTDOCSYMS ^{B}"##"/[^#] static void parseCompounds(Entry *rt) { //printf("parseCompounds(%s)\n",rt->name.data()); - EntryListIterator eli(*rt->sublist); + EntryListIterator eli(*rt->children()); Entry *ce; for (;(ce=eli.current());++eli) { @@ -1395,9 +1400,9 @@ static void parseCompounds(Entry *rt) current_root = ce ; BEGIN( Search ); } - else if (ce->parent) + else if (ce->parent()) { - current_root = ce->parent; + current_root = ce->parent(); //printf("Searching for member variables in %s parent=%s\n", // ce->name.data(),ce->parent->name.data()); BEGIN( SearchMemVars ); diff --git a/src/scanner.l b/src/scanner.l index d16c50f..84f7395 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -63,7 +63,6 @@ static int lastStringContext; static int lastCurlyContext; static int lastRoundContext; static int lastSquareContext; -//static int lastAfterDocContext; static int lastInitializerContext; static int lastClassTemplSpecContext; static int lastPreLineCtrlContext; @@ -92,9 +91,6 @@ static bool removeSlashes; static Specifier virt; static Specifier baseVirt; static QCString msType,msName,msArgs; -//static int memberGroupId = DOX_NOGROUP; -//static QCString memberGroupHeader; -//static QCString memberGroupDocs; static bool isTypedef; static int tmpDocType; static QCString sectionLabel; @@ -181,9 +177,6 @@ static void initParser() sharpCount = 0; roundCount = 0; curlyCount = 0; - //memberGroupId = DOX_NOGROUP; - //memberGroupRelates.resize(0); - //memberGroupInside.resize(0); mtype = Method; gstat = FALSE; virt = Normal; @@ -207,9 +200,6 @@ static void initEntry() current->mtype = mtype; current->virt = virt; current->stat = gstat; - //current->mGrpId = memberGroupId; - //current->relates = memberGroupRelates; - //current->inside = memberGroupInside; current->objc = insideObjC; //if (!autoGroupStack.isEmpty()) //{ @@ -2133,7 +2123,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) *pCopyCurlyString+=*yytext; } ":" { - if (current->type.isEmpty()) // bit pad field + if (current->type.isEmpty()) // anonymous padding field, e.g. "int :7;" { addType(current); current->name.sprintf("__pad%d__",padCount++); @@ -2192,13 +2182,20 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) { current = new Entry ; } + else if (current->groups) + { + current->groups->clear(); + } initEntry(); } BEGIN( FindMembers ) ; } "[" { - if (current->name.isEmpty() || current->name=="typedef") // IDL function property + if (!insideCS && + current->name.isEmpty() || + current->name=="typedef" + ) // IDL function property { squareCount=1; lastSquareContext = YY_START; @@ -2340,7 +2337,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current_root->addSubEntry(current); current = new Entry(*current); // add to the scope surrounding the enum (copy!) - current_root->parent->addSubEntry(current); + current_root->parent()->addSubEntry(current); current = new Entry ; initEntry(); } @@ -2588,7 +2585,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } } //p=p->parent; - if (p==current) p=current_root; else p=p->parent; + if (p==current) p=current_root; else p=p->parent(); } } //printf("msName=%s current->name=%s\n",msName.data(),current->name.data()); @@ -3801,7 +3798,9 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) if (current_root && // not a nested struct inside an @interface section current_root->section!=Entry::INTERFACE_SEC && (current->section==Entry::INTERFACE_SEC || - current->section==Entry::OBJCIMPL_SEC) && + current->section==Entry::OBJCIMPL_SEC || + current->section==Entry::PROTOCOL_SEC || + current->section==Entry::CATEGORY_SEC) && insideObjC ) { // ObjC body that ends with @end @@ -4418,20 +4417,6 @@ static void handleCommentBlock(const QCString &doc,bool brief) int position=0; bool needsEntry=FALSE; if (docBlockInBody && hideInBodyDocs) return; -#if 0 - if (docBlockInBody) - { - if (previous==0) - { - ASSERT(previous!=0); // shouldn't happen - goto exit; - } - if (!previous->doc.isEmpty()) - { // start a new paragraph for the next piece of text found in the body - previous->doc=previous->doc.stripWhiteSpace()+"\n\n"; - } - } -#endif //printf("parseCommentBlock [%s]\n",doc.data()); while (parseCommentBlock( g_thisParser, @@ -4456,9 +4441,6 @@ static void handleCommentBlock(const QCString &doc,bool brief) newEntry(); } -#if 0 -exit: -#endif if (docBlockTerm) { unput(docBlockTerm); @@ -4525,90 +4507,11 @@ static void handleParametersCommentBlocks() //---------------------------------------------------------------------------- -//static void startGroupInDoc() -//{ -// if (current->section==Entry::GROUPDOC_SEC ) /* scope for a non-member group: @defgroup */ -// { -// autoGroupStack.push(new Grouping(current->name, -// current->groupingPri() -// )); -// } -// else /* if (current->section == Entry::MEMBERGRP_SEC) scope for a member group: @name */ -// { -// if (memberGroupId!=DOX_NOGROUP) -// { -// warn(yyFileName,yyLineNr,"Warning: member groups cannot be nested. Ending current group!\n"); -// endGroup(); -// } -// memberGroupId = newMemberGroupId(); -// MemberGroupInfo *info = new MemberGroupInfo; -// if (current->section == Entry::MEMBERGRP_SEC) -// { -// info->header = memberGroupHeader.stripWhiteSpace(); -// } -// Doxygen::memGrpInfoDict.insert(memberGroupId,info); -// memberGroupRelates = current->relates; -// memberGroupInside = current->inside; -// current->mGrpId = memberGroupId; -// } -//} -// -////---------------------------------------------------------------------------- -// -//static void endGroup() -//{ -// if (memberGroupId!=DOX_NOGROUP) // end of member group -// { -// //Doxygen::memberDocDict.insert(memberGroupId, -// // new QCString(memberGroupDocs) -// // ); -// MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(memberGroupId); -// if (info) -// { -// info->doc = memberGroupDocs; -// info->docFile = yyFileName; -// } -// memberGroupId=DOX_NOGROUP; -// memberGroupRelates.resize(0); -// memberGroupInside.resize(0); -// if (YY_START!=ReadInitializer) -// { -// current->mGrpId=DOX_NOGROUP; -// current->relates.resize(0); -// } -// memberGroupDocs.resize(0); -// } -// else if (!autoGroupStack.isEmpty()) // end of group -// { -// Grouping *current = autoGroupStack.pop(); -// Grouping *parent = autoGroupStack.top(); -// if( parent ) { -// setCurrentGroup( &parent->groupname, parent->pri ); -// } else { -// setCurrentGroup( 0, Grouping::GROUPING_LOWEST ); -// } -// delete current; -// } -//} -// -////---------------------------------------------------------------------------- -// -//static void forceEndGroup() -//{ -// while (memberGroupId!=DOX_NOGROUP || !autoGroupStack.isEmpty()) -// { -// //printf("forceEndGroup ends group %d\n",memberGroupId); -// endGroup(); -// } -//} - -//---------------------------------------------------------------------------- - static void parseCompounds(Entry *rt) { //printf("parseCompounds(%s)\n",rt->name.data()); g_inputFromFile = FALSE; - EntryListIterator eli(*rt->sublist); + EntryListIterator eli(*rt->children()); Entry *ce; for (;(ce=eli.current());++eli) { diff --git a/src/translator_ar.h b/src/translator_ar.h new file mode 100644 index 0000000..7ce9c0a --- /dev/null +++ b/src/translator_ar.h @@ -0,0 +1,1615 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2005 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +/* + * Arabic translation for Doxygen + * + * Please send your comments on this translation to moazreyad@yahoo.com + * + * Note : consider this file as Beta version for testing Arabic output with Doxygen. + * + * Revision history : + * + * 6/2006 : Created initial version of Arabic translation. + */ + +#ifndef TRANSLATOR_AR_H +#define TRANSLATOR_AR_H + +class TranslatorArabic : public TranslatorAdapter_1_4_6 +{ + protected: + friend class TranslatorAdapterBase; + virtual ~TranslatorArabic() {} + + public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in English using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ + virtual QCString idLanguage() + { return "arabic"; } + + /*! Used to get the LaTeX command(s) for the language support. + * This method should return string with commands that switch + * LaTeX to the desired language. For example + *
    "\\usepackage[german]{babel}\n"
    +     *  
    + * or + *
    "\\usepackage{polski}\n"
    +     *  "\\usepackage[latin2]{inputenc}\n"
    +     *  "\\usepackage[T1]{fontenc}\n"
    +     *  
    + * + * The English LaTeX does not use such commands. Because of this + * the empty string is returned in this implementation. + */ + virtual QCString latexLanguageSupportCommand() + { + return ""; + } + + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() + { + return "cp 1256"; + } + + // --- Language translation methods ------------------- + + /*! used in the compound documentation before a list of related functions. */ + virtual QCString trRelatedFunctions() + { return " "; } + + /*! subscript for the related functions. */ + virtual QCString trRelatedSubscript() + { return "( )"; } + + /*! header that is put before the detailed description of files, classes and namespaces. */ + virtual QCString trDetailedDescription() + { return " "; } + + /*! header that is put before the list of typedefs. */ + virtual QCString trMemberTypedefDocumentation() + { return " "; } + + /*! header that is put before the list of enumerations. */ + virtual QCString trMemberEnumerationDocumentation() + { return " "; } + + /*! header that is put before the list of member functions. */ + virtual QCString trMemberFunctionDocumentation() + { return " "; } + + /*! header that is put before the list of member attributes. */ + virtual QCString trMemberDataDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! this is the text of a link put after brief descriptions. */ + virtual QCString trMore() + { return " ..."; } + + /*! put in the class documentation */ + virtual QCString trListOfAllMembers() + { return " "; } + + /*! used as the title of the "list of all members" page of a class */ + virtual QCString trMemberList() + { return " "; } + + /*! this is the first part of a sentence that is followed by a class name */ + virtual QCString trThisIsTheListOfAllMembers() + { return " "; } + + /*! this is the remainder of the sentence after the class name */ + virtual QCString trIncludingInheritedMembers() + { return ", "; } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ + virtual QCString trGeneratedAutomatically(const char *s) + { QCString result=" Doxygen"; + if (s) result+=(QCString)" "+s; + result+=" ."; + return result; + } + + /*! put after an enum name in the list of all members */ + virtual QCString trEnumName() + { return " "; } + + /*! put after an enum value in the list of all members */ + virtual QCString trEnumValue() + { return " "; } + + /*! put after an undocumented member in the list of all members */ + virtual QCString trDefinedIn() + { return " "; } + + // quick reference sections + + /*! This is put above each page as a link to the list of all groups of + * compounds or files (see the \\group command). + */ + virtual QCString trModules() + { return ""; } + + /*! This is put above each page as a link to the class hierarchy */ + virtual QCString trClassHierarchy() + { return " "; } + + /*! This is put above each page as a link to the list of annotated classes */ + virtual QCString trCompoundList() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is put above each page as a link to the list of documented files */ + virtual QCString trFileList() + { return " "; } + + /*! This is put above each page as a link to the list of all verbatim headers */ + virtual QCString trHeaderFiles() + { return " "; } + + /*! This is put above each page as a link to all members of compounds. */ + virtual QCString trCompoundMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is put above each page as a link to all members of files. */ + virtual QCString trFileMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return ""; + } + else + { + return " "; + } + } + + /*! This is put above each page as a link to all related pages. */ + virtual QCString trRelatedPages() + { return " "; } + + /*! This is put above each page as a link to all examples. */ + virtual QCString trExamples() + { return ""; } + + /*! This is put above each page as a link to the search engine. */ + virtual QCString trSearch() + { return ""; } + + /*! This is an introduction to the class hierarchy. */ + virtual QCString trClassHierarchyDescription() + { return " " + " :"; + } + + /*! This is an introduction to the list with all files. */ + virtual QCString trFileListDescription(bool extractAll) + { + QCString result=" "; + if (!extractAll) result+=" "; + result+=" :"; + return result; + } + + /*! This is an introduction to the annotated compound list. */ + virtual QCString trCompoundListDescription() + { + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " :"; + } + else + { + return " " + " :"; + } + } + + /*! This is an introduction to the page with all class members. */ + virtual QCString trCompoundMembersDescription(bool extractAll) + { + QCString result=" "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+=" "; + } + else + { + result+=" "; + } + if (!extractAll) + { + result+=" "; + } + result+=" "; + if (!extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+=" / :"; + } + else + { + result+=" :"; + } + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="/ :"; + } + else + { + result+=" :"; + } + } + return result; + } + + /*! This is an introduction to the page with all file members. */ + virtual QCString trFileMembersDescription(bool extractAll) + { + QCString result="Here is a list of all "; + if (!extractAll) result+="documented "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="functions, variables, defines, enums, and typedefs"; + } + else + { + result+="file members"; + } + result+=" with links to "; + if (extractAll) + result+="the files they belong to:"; + else + result+="the documentation:"; + return result; + } + + /*! This is an introduction to the page with the list of all header files. */ + virtual QCString trHeaderFilesDescription() + { return "Here are the header files that make up the API:"; } + + /*! This is an introduction to the page with the list of all examples */ + virtual QCString trExamplesDescription() + { return " :"; } + + /*! This is an introduction to the page with the list of related pages */ + virtual QCString trRelatedPagesDescription() + { return " :"; } + + /*! This is an introduction to the page with the list of class/file groups */ + virtual QCString trModulesDescription() + { return " :"; } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ + virtual QCString trNoDescriptionAvailable() + { return " "; } + + // index titles (the project name is prepended for these) + + + /*! This is used in HTML as the title of index.html. */ + virtual QCString trDocumentation() + { return ""; } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ + virtual QCString trModuleIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ + virtual QCString trHierarchicalIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ + virtual QCString trCompoundIndex() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ + virtual QCString trFileIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ + virtual QCString trModuleDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ + virtual QCString trClassDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ + virtual QCString trFileDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ + virtual QCString trExampleDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ + virtual QCString trPageDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the document */ + virtual QCString trReferenceManual() + { return " "; } + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ + virtual QCString trDefines() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ + virtual QCString trFuncProtos() + { return "Function Prototypes"; } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ + virtual QCString trTypedefs() + { return "Typedefs"; } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ + virtual QCString trEnumerations() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ + virtual QCString trFunctions() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trVariables() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trEnumerationValues() + { return "Enumerator"; } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ + virtual QCString trDefineDocumentation() + { return "Define Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ + virtual QCString trFunctionPrototypeDocumentation() + { return "Function Prototype Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ + virtual QCString trTypedefDocumentation() + { return "Typedef Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ + virtual QCString trEnumerationTypeDocumentation() + { return "Enumeration Type Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Enumerator Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ + virtual QCString trFunctionDocumentation() + { return " "; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ + virtual QCString trVariableDocumentation() + { return " "; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ + virtual QCString trCompounds() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return ""; + } + } + + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ + virtual QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Generated on "+date; + if (projName) result+=(QCString)" for "+projName; + result+=(QCString)" by"; + return result; + } + /*! This is part of the sentence used in the standard footer of each page. + */ + virtual QCString trWrittenBy() + { + return " "; + } + + /*! this text is put before a class diagram */ + virtual QCString trClassDiagram(const char *clName) + { + return (QCString)"Inheritance diagram for "+clName+":"; + } + + /*! this text is generated when the \\internal command is used. */ + virtual QCString trForInternalUseOnly() + { return " ."; } + + /*! this text is generated when the \\reimp command is used. */ + virtual QCString trReimplementedForInternalReasons() + { return "Reimplemented for internal reasons; the API is not affected."; } + + /*! this text is generated when the \\warning command is used. */ + virtual QCString trWarning() + { return ""; } + + /*! this text is generated when the \\bug command is used. */ + virtual QCString trBugsAndLimitations() + { return "Bugs and limitations"; } + + /*! this text is generated when the \\version command is used. */ + virtual QCString trVersion() + { return ""; } + + /*! this text is generated when the \\date command is used. */ + virtual QCString trDate() + { return ""; } + + /*! this text is generated when the \\return command is used. */ + virtual QCString trReturns() + { return "Returns"; } + + /*! this text is generated when the \\sa command is used. */ + virtual QCString trSeeAlso() + { return " "; } + + /*! this text is generated when the \\param command is used. */ + virtual QCString trParameters() + { return "Parameters"; } + + /*! this text is generated when the \\exception command is used. */ + virtual QCString trExceptions() + { return ""; } + + /*! this text is used in the title page of a LaTeX document. */ + virtual QCString trGeneratedBy() + { return " "; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of page containing all the index of all namespaces. */ + virtual QCString trNamespaceList() + { return " "; } + + /*! used as an introduction to the namespace list */ + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Here is a list of all "; + if (!extractAll) result+="documented "; + result+="namespaces with brief descriptions:"; + return result; + } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ + virtual QCString trFriends() + { return "Friends"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + /*! used in the class documentation as a header before the list of all + * related classes + */ + virtual QCString trRelatedFunctionDocumentation() + { return "Friends And Related Function Documentation"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of the HTML page of a class/struct/union */ + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { + QCString result=(QCString)clName; + switch(compType) + { + case ClassDef::Class: result+=" Class"; break; + case ClassDef::Struct: result+=" Struct"; break; + case ClassDef::Union: result+=" Union"; break; + case ClassDef::Interface: result+=" Interface"; break; + case ClassDef::Protocol: result+=" Protocol"; break; + case ClassDef::Category: result+=" Category"; break; + case ClassDef::Exception: result+=" Exception"; break; + } + if (isTemplate) result+=" Template"; + result+=" Reference"; + return result; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + QCString result=fileName; + result+=" File Reference"; + return result; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result=namespaceName; + result+=" Namespace Reference"; + return result; + } + + virtual QCString trPublicMembers() + { return "Public Member Functions"; } + virtual QCString trPublicSlots() + { return "Public Slots"; } + virtual QCString trSignals() + { return "Signals"; } + virtual QCString trStaticPublicMembers() + { return "Static Public Member Functions"; } + virtual QCString trProtectedMembers() + { return "Protected Member Functions"; } + virtual QCString trProtectedSlots() + { return "Protected Slots"; } + virtual QCString trStaticProtectedMembers() + { return "Static Protected Member Functions"; } + virtual QCString trPrivateMembers() + { return "Private Member Functions"; } + virtual QCString trPrivateSlots() + { return "Private Slots"; } + virtual QCString trStaticPrivateMembers() + { return "Static Private Member Functions"; } + + /*! this function is used to produce a comma-separated list of items. + * use generateMarker(i) to indicate where item i should be put. + */ + virtual QCString trWriteList(int numEntries) + { + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i