From c6b7c8e7b6760ebfafa40a71eea48d1b46dec477 Mon Sep 17 00:00:00 2001 From: dimitri Date: Sun, 4 Jun 2000 17:46:13 +0000 Subject: Release-1.1.4 --- INSTALL | 8 +- README | 4 +- VERSION | 2 +- addon/configgen/README | 13 + addon/configgen/config_templ.l | 50 +++- addon/configgen/configgen.cpp | 17 +- doc/commands.doc | 32 +++ doc/config.doc | 132 +++++++---- doc/starting.doc | 6 +- examples/memgrp.cpp | 14 +- packages/rpm/doxygen.spec | 2 +- src/classdef.cpp | 107 ++++++--- src/classdef.h | 5 +- src/code.l | 8 +- src/config.h | 1 + src/config.l | 65 ++++- src/dot.cpp | 36 +-- src/doxygen.cpp | 522 +++++++++++++++++++++++------------------ src/entry.cpp | 6 +- src/entry.h | 11 +- src/filedef.cpp | 78 ++++-- src/filedef.h | 7 +- src/groupdef.cpp | 51 ++-- src/groupdef.h | 8 +- src/htmlgen.cpp | 21 +- src/htmlgen.h | 2 +- src/index.cpp | 15 +- src/latexgen.cpp | 76 +++--- src/latexgen.h | 2 +- src/mangen.cpp | 2 +- src/mangen.h | 2 +- src/memberdef.cpp | 52 ++-- src/memberdef.h | 32 +-- src/membergroup.cpp | 8 +- src/membergroup.h | 2 +- src/memberlist.cpp | 51 ++-- src/memberlist.h | 2 +- src/namespacedef.cpp | 44 ++-- src/namespacedef.h | 21 +- src/outputgen.h | 2 +- src/outputlist.h | 4 +- src/pre.l | 5 +- src/rtfgen.cpp | 57 +++-- src/rtfgen.h | 2 +- src/scanner.l | 44 ++-- src/tag.l | 6 +- src/util.cpp | 16 +- 47 files changed, 1035 insertions(+), 618 deletions(-) create mode 100644 addon/configgen/README diff --git a/INSTALL b/INSTALL index b347d12..67ae21c 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ -DOXYGEN Version 1.1.3-20000528 +DOXYGEN Version 1.1.4 CONTENTS -------- @@ -15,8 +15,8 @@ INSTALLATION INSTRUCTIONS FOR UNIX: 1. Unpack the archive, unless you already have: - gunzip doxygen-1.1.3-20000528.src.tar.gz # uncompress the archive - tar xf doxygen-1.1.3-20000528.src.tar # unpack it + gunzip doxygen-1.1.4.src.tar.gz # uncompress the archive + tar xf doxygen-1.1.4.src.tar # unpack it 2. Run the configure script: @@ -252,4 +252,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (28 May 2000) +Dimitri van Heesch (04 June 2000) diff --git a/README b/README index 7e91368..87e5c0b 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.1.3-20000528 +DOXYGEN Version 1.1.4 Please read INSTALL for compilation instructions. @@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (28 May 2000) +Dimitri van Heesch (04 June 2000) diff --git a/VERSION b/VERSION index 35ab29c..65087b4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.3-20000528 +1.1.4 diff --git a/addon/configgen/README b/addon/configgen/README new file mode 100644 index 0000000..717ca2e --- /dev/null +++ b/addon/configgen/README @@ -0,0 +1,13 @@ +The configgen tool is used to: +- generate the parser for the configuration file based on + the templates config_templ.h and config_templ.l +- generate the GUI frontend "doxywizard" for creating a configuration + file based on the templates doxywizard_templ.h and doxywizard_templ.cpp + +If you want to add a new configuration option to doxygen, +then you should add a new entry the init() function in configgen.cpp + +After that you can do a "make install" in this directory to update +the config.l and config.h in doxygen's source directory. + +-Dimitri diff --git a/addon/configgen/config_templ.l b/addon/configgen/config_templ.l index 006bdc6..561e54b 100644 --- a/addon/configgen/config_templ.l +++ b/addon/configgen/config_templ.l @@ -622,6 +622,39 @@ void checkConfig() #endif s=Config::includePath.next(); } + + // check dot path + if (!Config::dotPath.isEmpty()) + { + if (Config::dotPath.find('\\')!=-1) + { + if (Config::dotPath.at(Config::dotPath.length()-1)!='\\') + { + Config::dotPath+='\\'; + } + } + else if (Config::dotPath.find('/')!=-1) + { + if (Config::dotPath.at(Config::dotPath.length()-1)!='/') + { + Config::dotPath+='/'; + } + } +#if defined(_WIN32) + QFileInfo dp(Config::dotPath+"dot.exe"); +#else + QFileInfo dp(Config::dotPath+"dot"); +#endif + if (!dp.exists() || !dp.isFile()) + { + err("Warning: the dot tool could not be found at %s\n",Config::dotPath.data()); + } + } + else // make sure the string is empty but not null! + { + Config::dotPath=""; + } + // check input if (Config::inputSources.count()==0) { @@ -646,13 +679,13 @@ void checkConfig() // add default pattern if needed if (Config::filePatternList.isEmpty()) { - Config::filePatternList="*"; + Config::filePatternList.append("*"); } // add default pattern if needed if (Config::examplePatternList.isEmpty()) { - Config::examplePatternList="*"; + Config::examplePatternList.append("*"); } // add default pattern if needed @@ -676,18 +709,23 @@ void checkConfig() err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); exit(1); } - else if (Config::cgiURL.left(7)!="http://") + else if (Config::cgiURL.left(7)!="http://" && + Config::cgiURL.left(8)!="https://" + ) { err("Error: tag CGI_URL: URL to cgi directory is invalid (must " - "start with http://).\n"); + "start with http:// or https://).\n"); exit(1); } // check documentation URL if (Config::docURL.isEmpty()) { - Config::docURL = Config::outputDir.copy().prepend("file://")+"html"; + Config::docURL = Config::outputDir.copy().prepend("file://").append("html"); } - else if (Config::docURL.left(7)!="http://" && Config::docURL.left(7)!="file://") + else if (Config::docURL.left(7)!="http://" && + Config::docURL.left(8)!="https://" && + Config::docURL.left(7)!="file://" + ) { err("Error: tag DOC_URL: URL to documentation is invalid or " "not absolute.\n"); diff --git a/addon/configgen/configgen.cpp b/addon/configgen/configgen.cpp index cc51c4c..557f70d 100644 --- a/addon/configgen/configgen.cpp +++ b/addon/configgen/configgen.cpp @@ -1486,6 +1486,15 @@ void init() "will graphical hierarchy of all classes instead of a textual one. \n" ); addDependency("gfxHierarchyFlag","haveDotFlag"); + ConfigString::add("dotPath", + "DOT_PATH", + "", + "path to the dot tool", + "This tag can be used to specify the path where the dot tool can be found. \n" + "If left blank, it is assumed the dot tool can be found on the path. \n", + ConfigString::Dir + ); + addDependency("dotPath","haveDotFlag"); //----------------------------------------------------------------------------------------------- ConfigInfo::add( "Search","Configuration::addtions related to the search engine "); @@ -1555,12 +1564,4 @@ void init() addDependency("extDocPathList","searchEngineFlag"); // The IMAGE_PATTERNS tag is now officially obsolete. - //----------------------------------------------------------------------------------------------- - //ConfigInfo::add("not used"); - //----------------------------------------------------------------------------------------------- - //ConfigList::add("imagePatternList", - // "IMAGE_PATTERNS", - // "", - // "list of image paths", - // "donīt know\n"); } diff --git a/doc/commands.doc b/doc/commands.doc index c715160..4618000 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -74,6 +74,7 @@ documentation:
  • \refitem cmdfbrclose \f]
  • \refitem cmdfile \file
  • \refitem cmdfn \fn +
  • \refitem cmdhideinitializer \hideinitializer
  • \refitem cmdhtmlonly \htmlonly
  • \refitem cmdif \if
  • \refitem cmdimage \image @@ -100,11 +101,13 @@ documentation:
  • \refitem cmdretval \retval
  • \refitem cmdsa \sa
  • \refitem cmdsection \section +
  • \refitem cmdshowinitializer \showinitializer
  • \refitem cmdskip \skip
  • \refitem cmdskipline \skipline
  • \refitem cmdstruct \struct
  • \refitem cmdsubsection \subsection
  • \refitem cmdthrow \throw +
  • \refitem cmdtodo \todo
  • \refitem cmdtypedef \typedef
  • \refitem cmdunion \union
  • \refitem cmduntil \until @@ -301,6 +304,17 @@ Doxygen. Unrecognized commands are treated as normal text. \sa section \ref cmdvar "\\var" and \ref cmdtypedef "\\typedef".
    +\subsection cmdhideinitializer \hideinitializer + + \addindex \hideinitializer + By default the value of a define and the initializer of a variable + are displayed unless they are longer than 30 lines. By putting + this command in a comment block of a define or variable, the + initializer always hidden. + + \sa section \ref cmdshowinitializer "\\showinitializer". + +
    \subsection cmdingroup \ingroup ( [ ]) \addindex \ingroup @@ -453,6 +467,17 @@ Public/Protected/Private/... section. \endhtmlonly
    +\subsection cmdshowinitializer \showinitializer + + \addindex \showinitializer + By default the value of a define and the initializer of a variable + are only displayed if they are less than 30 lines long. By putting + this command in a comment block of a define or variable, the + initializer is shown unconditionally. + + \sa section \ref cmdhideinitializer "\\hideinitializer". + +
    \subsection cmdstruct \struct [] [] \addindex \struct @@ -758,6 +783,13 @@ Public/Protected/Private/... section. the tag \\throws is a synonym for this tag.
    +\subsection cmdtodo \todo ( one line todo description ) + + \addindex \todo + Adds a TODO item to the documentation. The item will also be added + to a TODO list. Both instances of the item will be cross-referenced. + +
    \subsection cmdversion \version { version number } \addindex \version diff --git a/doc/config.doc b/doc/config.doc index cfd41d9..d539807 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -137,6 +137,8 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_tagfiles TAGFILES
  • \refitem cfg_verbatim_headers VERBATIM_HEADERS
  • \refitem cfg_warnings WARNINGS +
  • \refitem cfg_warn_format WARN_FORMAT +
  • \refitem cfg_warn_if_undocumented WARN_IF_UNDOCUMENTED \htmlonly @@ -182,23 +184,6 @@ followed by the descriptions of the tags grouped by category. The default language is English, other supported languages are: Dutch, French, Italian, Czech, Swedish, German and Japanese. -\anchor cfg_quiet -
    \c QUIET
    - \addindex QUIET - The \c QUIET tag can be used to turn on/off the messages that are generated - to standard output by doxygen. Possible values are \c YES and \c NO, - where \c YES implies that the messages are off. - If left blank \c NO is used. - -\anchor cfg_warnings -
    \c WARNINGS
    - \addindex WARNINGS - The \c WARNINGS tag can be used to turn on/off the warning messages that are - generated to standard error by doxygen. Possible values are \c YES and \c NO, - where \c YES implies that the warnings are on. If left blank \c NO is used. - - \b Tip: Turn warnings on while writing the documentation. - \anchor cfg_disable_index
    \c DISABLE_INDEX
    \addindex DISABLE_INDEX @@ -248,14 +233,6 @@ followed by the descriptions of the tags grouped by category. the file and class documentation (similar to JavaDoc). Set to NO to disable this. -\anchor cfg_internal_docs -
    \c INTERNAL_DOCS
    - \addindex INTERNAL_DOCS - The \c INTERNAL_DOCS tag determines if documentation - that is typed after a \\internal command is included. If the tag is set - to \c NO (the default) then the documentation will be excluded. - Set it to \c YES to include the internal documentation. - \anchor cfg_repeat_brief
    \c REPEAT_BRIEF
    \addindex REPEAT_BRIEF @@ -288,6 +265,14 @@ followed by the descriptions of the tags grouped by category. only done if one of the specified strings matches the left-hand part of the path. +\anchor cfg_internal_docs +
    \c INTERNAL_DOCS
    + \addindex INTERNAL_DOCS + The \c INTERNAL_DOCS tag determines if documentation + that is typed after a \\internal command is included. If the tag is set + to \c NO (the default) then the documentation will be excluded. + Set it to \c YES to include the internal documentation. + \anchor cfg_class_diagrams
    \c CLASS_DIAGRAMS
    \addindex CLASS_DIAGRAMS @@ -382,6 +367,43 @@ followed by the descriptions of the tags grouped by category. +\subsection messages_input Options related to warning and progress messages +\anchor cfg_quiet +
    + +
    \c QUIET
    + \addindex QUIET + The \c QUIET tag can be used to turn on/off the messages that are generated + to standard output by doxygen. Possible values are \c YES and \c NO, + where \c YES implies that the messages are off. + If left blank \c NO is used. + +\anchor cfg_warnings +
    \c WARNINGS
    + \addindex WARNINGS + The \c WARNINGS tag can be used to turn on/off the warning messages that are + generated to standard error by doxygen. Possible values are \c YES and \c NO, + where \c YES implies that the warnings are on. If left blank \c NO is used. + + \b Tip: Turn warnings on while writing the documentation. + +\anchor cfg_warn_if_undocumented +
    \c WARN_IF_UNDOCUMENTED
    + \addindex WARN_IF_UNDOCUMENTED + If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings + for undocumented members. If EXTRACT_ALL is set to YES then this flag will + automatically be disabled. + +\anchor cfg_warn_format +
    \c WARN_FORMAT
    + \addindex WARN_FORMAT + The WARN_FORMAT tag determines the format of the warning messages that + doxygen can produce. The string should contain the $file, $line, and $text + tags, which will be replaced by the file and line number from which the + warning originated and the warning text. + +
    + \subsection config_input Input related options \anchor cfg_input
    @@ -464,6 +486,33 @@ followed by the descriptions of the tags grouped by category.
    +\subsection alphabetical_index Alphabetical index options +\anchor cfg_alphabetical_index +
    + +
    \c ALPHABETICAL_INDEX
    + \addindex ALPHABETICAL_INDEX + If the \c ALPHABETICAL_INDEX tag is set to \c YES, an alphabetical index + of all compounds will be generated. Enable this if the project contains + a lot of classes, structs, unions or interfaces. + +\anchor cfg_cols_in_alpha_index +
    \c COLS_IN_ALPHA_INDEX
    + \addindex COLS_IN_ALPHA_INDEX + If the alphabetical index is enabled + (see \c ALPHABETICAL_INDEX) then the \c COLS_IN_ALPHA_INDEX tag can be + used to specify the number of columns in which this list will be split (can be a number in the range [1..20]) + +\anchor cfg_ignore_prefix +
    \c IGNORE_PREFIX
    + \addindex IGNORE_PREFIX + In case all classes in a project start with a common prefix, all classes will + be put under the same header in the alphabetical index. + The \c IGNORE_PREFIX tag can be used to specify a prefix + (or a list of prefixes) that should be ignored while generating the index + headers. + +
    \subsection html_output HTML related options \anchor cfg_generate_html
    @@ -596,33 +645,6 @@ FONT.charliteral { color: #008080 } The HTML workshop also contains a viewer for compressed HTML files.
    -\subsection alphabetical_index Alphabetical index options -\anchor cfg_alphabetical_index -
    - -
    \c ALPHABETICAL_INDEX
    - \addindex ALPHABETICAL_INDEX - If the \c ALPHABETICAL_INDEX tag is set to \c YES, an alphabetical index - of all compounds will be generated. Enable this if the project contains - a lot of classes, structs, unions or interfaces. - -\anchor cfg_cols_in_alpha_index -
    \c COLS_IN_ALPHA_INDEX
    - \addindex COLS_IN_ALPHA_INDEX - If the alphabetical index is enabled - (see \c ALPHABETICAL_INDEX) then the \c COLS_IN_ALPHA_INDEX tag can be - used to specify the number of columns in which this list will be split (can be a number in the range [1..20]) - -\anchor cfg_ignore_prefix -
    \c IGNORE_PREFIX
    - \addindex IGNORE_PREFIX - In case all classes in a project start with a common prefix, all classes will - be put under the same header in the alphabetical index. - The \c IGNORE_PREFIX tag can be used to specify a prefix - (or a list of prefixes) that should be ignored while generating the index - headers. - -
    \subsection latex_output LaTeX related options \anchor cfg_generate_latex
    @@ -940,6 +962,12 @@ TAGFILES = file1=loc1 "file2 = loc2" ... If the \c GRAPHICAL_HIERARCHY and \c HAVE_DOT tags are set to \c YES then doxygen will graphical hierarchy of all classes instead of a textual one. +\anchor cfg_dot_path +
    \c DOT_PATH
    + \addindex DOT_PATH + This tag can be used to specify the path where the dot tool can be found. + If left blank, it is assumed the dot tool can be found on the path. +
    \subsection config_search Search engine options \anchor cfg_searchengine diff --git a/doc/starting.doc b/doc/starting.doc index e3e67e1..aad8dc0 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -485,10 +485,10 @@ block if you prefer C style comments. Note that the members of the group should be physcially inside the member group's body. -Before the opening marker of a block a separate comment block should be +Before the opening marker of a block a separate comment block may be placed. This block should contain the \ref cmdname "@name" (or \ref cmdname "\name") command and is used to specify the header -of the group. Optionally, the comment block may contain more +of the group. Optionally, the comment block may also contain more detailed information about the group. Nesting of member groups is not allowed. @@ -866,6 +866,8 @@ PREDEFINED = DECLARE_REGISTRY_RESOURCEID=// \ "STDMETHOD(a)=HRESULT a" \ "ATL_NO_VTABLE= "\ "__declspec(a)= "\ + BEGIN_CONNECTION_POINT_MAP=/* \ + END_CONNECTION_POINT_MAP=*/// \endverbatim As you can see doxygen's preprocessor is quite powerful, but if you want diff --git a/examples/memgrp.cpp b/examples/memgrp.cpp index 5501d71..a365e74 100644 --- a/examples/memgrp.cpp +++ b/examples/memgrp.cpp @@ -2,10 +2,8 @@ class Test { public: - /** @name Group1 - */ //@{ - /** Function 1 in group 1. Details. */ + /** Same documentation for both members. Details */ void func1InGroup1(); void func2InGroup1(); //@} @@ -30,3 +28,13 @@ void Test::func2InGroup2() {} void Test::func1InGroup2() {} //@} +/*! \file + * docs for this file + */ + +//@{ +//! one description for all members of this group +#define A 1 +#define B 2 +void glob_func(); +//@} diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index b30cca8..41d8d41 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,5 +1,5 @@ Name: doxygen -Version: 1.1.3-20000528 +Version: 1.1.4 Summary: documentation system for C, C++ and IDL Release: 1 Source0: doxygen-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index 7d35be4..326592c 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -131,29 +131,60 @@ void ClassDef::insertSuperClass(ClassDef *cd,Protection p, inheritedBy->inSort(new BaseClassDef(cd,p,s,t)); } -void ClassDef::addMemberToGroup(MemberDef *md,int groupId) +void ClassDef::addMemberListToGroup(MemberList *ml) { - if (groupId!=-1) + MemberListIterator mli(*ml); + MemberDef *md; + for (;(md=mli.current());++mli) { - QCString *pGrpHeader = memberHeaderDict[groupId]; - QCString *pDocs = memberDocDict[groupId]; - if (pGrpHeader) + int groupId=md->getMemberGroupId(); + if (groupId!=-1) { - MemberGroup *mg = memberGroupDict->find(groupId); - if (mg==0) + QCString *pGrpHeader = memberHeaderDict[groupId]; + QCString *pDocs = memberDocDict[groupId]; + if (pGrpHeader) { - mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); - memberGroupDict->insert(groupId,mg); - memberGroupList->append(mg); + MemberGroup *mg = memberGroupDict->find(groupId); + if (mg==0) + { + mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); + memberGroupDict->insert(groupId,mg); + memberGroupList->append(mg); + } + mg->insertMember(md); + md->setMemberGroup(mg); } - mg->insertMember(md); - md->setMemberGroup(mg); } } } +void ClassDef::addMembersToMemberGroup() +{ + addMemberListToGroup(&pubTypes); + addMemberListToGroup(&pubMembers); + addMemberListToGroup(&pubAttribs); + addMemberListToGroup(&pubSlots); + addMemberListToGroup(&signals); + addMemberListToGroup(&pubStaticMembers); + addMemberListToGroup(&pubStaticAttribs); + addMemberListToGroup(&proTypes); + addMemberListToGroup(&proMembers); + addMemberListToGroup(&proAttribs); + addMemberListToGroup(&proSlots); + addMemberListToGroup(&proStaticMembers); + addMemberListToGroup(&proStaticAttribs); + addMemberListToGroup(&priTypes); + addMemberListToGroup(&priMembers); + addMemberListToGroup(&priAttribs); + addMemberListToGroup(&priSlots); + addMemberListToGroup(&priStaticMembers); + addMemberListToGroup(&priStaticAttribs); + addMemberListToGroup(&friends); + addMemberListToGroup(&related); +} + // adds new member definition to the class -void ClassDef::insertMember(MemberDef *md,int groupId) +void ClassDef::insertMember(MemberDef *md) { //printf("adding %s::%s\n",name().data(),md->name().data()); if (!isReference()) @@ -402,7 +433,7 @@ void ClassDef::insertMember(MemberDef *md,int groupId) /*************************************************/ // Note: this must be done AFTER inserting the member in the // regular groups - addMemberToGroup(md,groupId); + //addMemberToGroup(md,groupId); } @@ -422,26 +453,26 @@ void ClassDef::insertMember(MemberDef *md,int groupId) } -void ClassDef::computeMemberGroups() -{ - MemberNameInfoListIterator mnili(*allMemberNameInfoList); - MemberNameInfo *mni; - for (;(mni=mnili.current());++mnili) - { - MemberNameInfoIterator mnii(*mni); - MemberInfo *mi; - for (mnii.toFirst();(mi=mnii.current());++mnii) - { - MemberDef *md=mi->memberDef; - MemberGroup *mg = md->getMemberGroup(); - if (mg && memberGroupDict->find(mg->groupId())==0) - { - memberGroupDict->insert(mg->groupId(),mg); - memberGroupList->append(mg); - } - } - } -} +//void ClassDef::computeMemberGroups() +//{ +// MemberNameInfoListIterator mnili(*allMemberNameInfoList); +// MemberNameInfo *mni; +// for (;(mni=mnili.current());++mnili) +// { +// MemberNameInfoIterator mnii(*mni); +// MemberInfo *mi; +// for (mnii.toFirst();(mi=mnii.current());++mnii) +// { +// MemberDef *md=mi->memberDef; +// MemberGroup *mg = md->getMemberGroup(); +// if (mg && memberGroupDict->find(mg->groupId())==0) +// { +// memberGroupDict->insert(mg->groupId(),mg); +// memberGroupList->append(mg); +// } +// } +// } +//} // compute the anchors for all members void ClassDef::computeAnchors() @@ -539,8 +570,6 @@ void ClassDef::writeDocumentation(OutputList &ol) pageTitle+=pageType+" Reference"; startFile(ol,fileName,pageTitle); startTitle(ol,getOutputFileBase()); - //ol.docify(name()+" "+pageType.right(pageType.length()-1)+" "); - //parseText(ol,theTranslator->trReference()); parseText(ol,theTranslator->trCompoundReference(name(),compType)); endTitle(ol,getOutputFileBase(),name()); @@ -1131,8 +1160,8 @@ void ClassDef::writeMemberList(OutputList &ol) memberWritten=TRUE; } if ((protect!=Public || md->isStatic() || virt!=Normal || - md->isFriend() || md->isRelated() || - (md->isInline() && Config::inlineInfoFlag) + md->isFriend() || md->isRelated() || + md->getMemberSpecifiers()!=0 ) && memberWritten) { @@ -1145,6 +1174,8 @@ void ClassDef::writeMemberList(OutputList &ol) { if (Config::inlineInfoFlag && md->isInline()) sl.append("inline"); + if (md->isExplicit()) sl.append("explicit"); + if (md->isMutable()) sl.append("mutable"); if (protect==Protected) sl.append("protected"); else if (protect==Private) sl.append("private"); if (virt==Virtual) sl.append("virtual"); diff --git a/src/classdef.h b/src/classdef.h index 96e6c7f..b17f775 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -68,8 +68,7 @@ class ClassDef : public Definition //void setIncludeName(const char *n_) { incName=n_; } MemberNameInfoList *memberNameInfoList() { return allMemberNameInfoList; } MemberNameInfoDict *memberNameInfoDict() { return allMemberNameInfoDict; } - void insertMember(MemberDef *,int grpId); - void addMemberToGroup(MemberDef *,int grpId); + void insertMember(MemberDef *); void insertUsedFile(const char *); void computeAnchors(); void computeMemberGroups(); @@ -121,10 +120,12 @@ class ClassDef : public Definition bool visited; + void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); protected: void addUsedInterfaceClasses(MemberDef *md,const char *typeStr); + void addMemberListToGroup(MemberList *); private: QCString fileName; // HTML containing the class docs diff --git a/src/code.l b/src/code.l index 660b361..04cefa8 100644 --- a/src/code.l +++ b/src/code.l @@ -1002,10 +1002,10 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" . { g_code->codify(yytext); } -"*/"{B}*\n({B}*\n)*({B}*"//@"[{}]{B}*\n)?{B}*"/*"[*!]/[^/*] { +"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)?{B}*"/*"[*!]/[^/*] { g_yyLineNr+=QCString(yytext).contains('\n'); } -"*/"{B}*\n({B}*\n)*({B}*"//@"[{}]{B}*\n)? { +"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)? { g_yyLineNr+=QCString(yytext).contains('\n'); g_code->endCodeLine(); if (g_yyLineNr\n({B}*"//@"[{}]{B}*\n) { // remove one-line group marker +<*>\n({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n) { // remove one-line group marker if (Config::stripCommentsFlag) { g_yyLineNr+=((QCString)yytext).contains('\n'); @@ -1063,7 +1063,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" endFontClass(); } } -<*>^{B}*"//@"[{}]{B}*\n { // remove one-line group marker +<*>^{B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n { // remove one-line group marker if (Config::stripCommentsFlag) { g_yyLineNr++; diff --git a/src/config.h b/src/config.h index 3ac0bed..2b3e386 100644 --- a/src/config.h +++ b/src/config.h @@ -112,6 +112,7 @@ struct Config static bool collGraphFlag; // collaboration graph static bool includeGraphFlag; // include graph static bool gfxHierarchyFlag; // flag to enable graphical hierarchy + static QCString dotPath; // path to the dot tool static bool searchEngineFlag; // generate search engine flag static QCString cgiName; // the name of the CGI binary static QCString cgiURL; // the absolute URL to the CGI binary diff --git a/src/config.l b/src/config.l index 4a3804d..fd54ba9 100644 --- a/src/config.l +++ b/src/config.l @@ -147,6 +147,7 @@ bool Config::classGraphFlag = TRUE; bool Config::collGraphFlag = TRUE; bool Config::includeGraphFlag = TRUE; bool Config::gfxHierarchyFlag = TRUE; +QCString Config::dotPath; bool Config::searchEngineFlag = FALSE; QCString Config::cgiName = "search.cgi"; QCString Config::cgiURL; @@ -287,6 +288,7 @@ static int yyread(char *buf,int max_size) "COLLABORATION_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::collGraphFlag; } "INCLUDE_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::includeGraphFlag; } "GRAPHICAL_HIERARCHY"[ \t]*"=" { BEGIN(GetBool); b=&Config::gfxHierarchyFlag; } +"DOT_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::dotPath; s->resize(0); } "SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchEngineFlag; } "CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiName; s->resize(0); } "CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiURL; s->resize(0); } @@ -573,6 +575,7 @@ void dumpConfig() printf("collGraphFlag=`%d'\n",Config::collGraphFlag); printf("includeGraphFlag=`%d'\n",Config::includeGraphFlag); printf("gfxHierarchyFlag=`%d'\n",Config::gfxHierarchyFlag); + printf("dotPath=`%s'\n",Config::dotPath.data()); printf("# Configuration::addtions related to the search engine \n"); printf("searchEngineFlag=`%d'\n",Config::searchEngineFlag); printf("cgiName=`%s'\n",Config::cgiName.data()); @@ -673,6 +676,7 @@ void Config::init() Config::collGraphFlag = TRUE; Config::includeGraphFlag = TRUE; Config::gfxHierarchyFlag = TRUE; + Config::dotPath.resize(0); Config::searchEngineFlag = FALSE; Config::cgiName = "search.cgi"; Config::cgiURL.resize(0); @@ -1726,6 +1730,16 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# This tag can be used to specify the path where the dot tool can be found. \n"; + t << "# If left blank, it is assumed the dot tool can be found on the path. \n"; + t << "\n"; + } + t << "DOT_PATH = "; + writeStringValue(t,Config::dotPath); + t << "\n"; + if (!sl) + { + t << "\n"; } t << "#---------------------------------------------------------------------------\n"; t << "# Configuration::addtions related to the search engine \n"; @@ -1978,6 +1992,7 @@ void substituteEnvironmentVars() substEnvVarsInStrList( Config::tagFileList ); substEnvVarsInString( Config::genTagFile ); substEnvVarsInString( Config::perlPath ); + substEnvVarsInString( Config::dotPath ); substEnvVarsInString( Config::cgiName ); substEnvVarsInString( Config::cgiURL ); substEnvVarsInString( Config::docURL ); @@ -2187,6 +2202,39 @@ void checkConfig() #endif s=Config::includePath.next(); } + + // check dot path + if (!Config::dotPath.isEmpty()) + { + if (Config::dotPath.find('\\')!=-1) + { + if (Config::dotPath.at(Config::dotPath.length()-1)!='\\') + { + Config::dotPath+='\\'; + } + } + else if (Config::dotPath.find('/')!=-1) + { + if (Config::dotPath.at(Config::dotPath.length()-1)!='/') + { + Config::dotPath+='/'; + } + } +#if defined(_WIN32) + QFileInfo dp(Config::dotPath+"dot.exe"); +#else + QFileInfo dp(Config::dotPath+"dot"); +#endif + if (!dp.exists() || !dp.isFile()) + { + err("Warning: the dot tool could not be found at %s\n",Config::dotPath.data()); + } + } + else // make sure the string is empty but not null! + { + Config::dotPath=""; + } + // check input if (Config::inputSources.count()==0) { @@ -2211,13 +2259,13 @@ void checkConfig() // add default pattern if needed if (Config::filePatternList.isEmpty()) { - Config::filePatternList="*"; + Config::filePatternList.append("*"); } // add default pattern if needed if (Config::examplePatternList.isEmpty()) { - Config::examplePatternList="*"; + Config::examplePatternList.append("*"); } // add default pattern if needed @@ -2241,18 +2289,23 @@ void checkConfig() err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); exit(1); } - else if (Config::cgiURL.left(7)!="http://") + else if (Config::cgiURL.left(7)!="http://" && + Config::cgiURL.left(8)!="https://" + ) { err("Error: tag CGI_URL: URL to cgi directory is invalid (must " - "start with http://).\n"); + "start with http:// or https://).\n"); exit(1); } // check documentation URL if (Config::docURL.isEmpty()) { - Config::docURL = Config::outputDir.copy().prepend("file://")+"html"; + Config::docURL = Config::outputDir.copy().prepend("file://").append("html"); } - else if (Config::docURL.left(7)!="http://" && Config::docURL.left(7)!="file://") + else if (Config::docURL.left(7)!="http://" && + Config::docURL.left(8)!="https://" && + Config::docURL.left(7)!="file://" + ) { err("Error: tag DOC_URL: URL to documentation is invalid or " "not absolute.\n"); diff --git a/src/dot.cpp b/src/dot.cpp index 83ac1b8..4a96987 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -22,6 +22,7 @@ #include "doxygen.h" #include "message.h" #include "util.h" +#include "config.h" #include #include @@ -32,7 +33,6 @@ const int maxImageWidth=1024; const int maxImageHeight=1024; - /*! mapping from protection levels to color names */ static char *edgeColorMap[] = { @@ -575,8 +575,9 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) t << "}" << endl; f.close(); - QCString dotCmd; - dotCmd.sprintf("dot -Tgif \"%s\" -o \"%s\"",dotName.data(),gifName.data()); + QCString dotCmd(4096); + dotCmd.sprintf("%sdot -Tgif \"%s\" -o \"%s\"", + Config::dotPath.data(),dotName.data(),gifName.data()); //printf("Running: dot -Tgif %s -o %s\n",dotName.data(),gifName.data()); if (system(dotCmd)!=0) { @@ -584,7 +585,8 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) out << "" << endl; return; } - dotCmd.sprintf("dot -Timap \"%s\" -o \"%s\"",dotName.data(),mapName.data()); + dotCmd.sprintf("%sdot -Timap \"%s\" -o \"%s\"", + Config::dotPath.data(),dotName.data(),mapName.data()); //printf("Running: dot -Timap %s -o %s\n",dotName.data(),mapName.data()); if (system(dotCmd)!=0) { @@ -975,9 +977,10 @@ static void findMaximalDotGraph(DotNode *root, { writeDotGraph(root,format,baseName,lrRank,renderParents,curDistance); - QCString dotCmd; + QCString dotCmd(4096); // create annotated dot file - dotCmd.sprintf("dot -Tdot \"%s.dot\" -o \"%s_tmp.dot\"",baseName.data(),baseName.data()); + dotCmd.sprintf("%sdot -Tdot \"%s.dot\" -o \"%s_tmp.dot\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Problems running dot. Check your installation!\n"); @@ -1066,15 +1069,17 @@ void DotClassGraph::writeGraph(QTextStream &out, if (format==GIF) // run dot to create a .gif image { - QCString dotCmd; - dotCmd.sprintf("dot -Tgif \"%s.dot\" -o \"%s.gif\"",baseName.data(),baseName.data()); + QCString dotCmd(4096); + dotCmd.sprintf("%sdot -Tgif \"%s.dot\" -o \"%s.gif\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Error: Problems running dot. Check your installation!\n"); return; } // run dot again to create an image map - dotCmd.sprintf("dot -Timap \"%s.dot\" -o \"%s.map\"",baseName.data(),baseName.data()); + dotCmd.sprintf("%sdot -Timap \"%s.dot\" -o \"%s.map\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Error: Problems running dot. Check your installation!\n"); @@ -1090,7 +1095,8 @@ void DotClassGraph::writeGraph(QTextStream &out, else if (format==EPS) // run dot to create a .eps image { QCString dotCmd; - dotCmd.sprintf("dot -Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data()); + dotCmd.sprintf("%sdot -Tps \"%s.dot\" -o \"%s.eps\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Error: Problems running dot. Check your installation!\n"); @@ -1221,16 +1227,17 @@ void DotInclDepGraph::writeGraph(QTextStream &out, { // run dot to create a .gif image QCString dotCmd; - dotCmd.sprintf("dot -Tgif \"%s.dot\" -o \"%s.gif\"",baseName.data(),baseName.data()); + dotCmd.sprintf("%sdot -Tgif \"%s.dot\" -o \"%s.gif\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Problems running dot. Check your installation!\n"); return; } - //printf("dot -Tgif %s.dot -o %s.gif",baseName.data(),baseName.data()); // run dot again to create an image map - dotCmd.sprintf("dot -Timap \"%s.dot\" -o \"%s.map\"",baseName.data(),baseName.data()); + dotCmd.sprintf("%sdot -Timap \"%s.dot\" -o \"%s.map\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Problems running dot. Check your installation!\n"); @@ -1249,7 +1256,8 @@ void DotInclDepGraph::writeGraph(QTextStream &out, // run dot to create a .eps image QCString dotCmd; - dotCmd.sprintf("dot -Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data()); + dotCmd.sprintf("%sdot -Tps \"%s.dot\" -o \"%s.eps\"", + Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) { err("Problems running dot. Check your installation!\n"); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 482e4bd..ef9ec5b 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -85,7 +85,6 @@ StringDict excludeNameDict(1009); // sections FileNameDict includeNameDict(1009); // include names FileNameDict exampleNameDict(1009); // examples FileNameDict imageNameDict(257); // images -//DefineDict defineDict(10007); // all defines StringDict typedefDict(1009); // all typedefs GroupDict groupDict(257); // all groups FormulaDict formulaDict(1009); // all formulas @@ -125,7 +124,6 @@ void clearAll() includeNameDict.clear(); exampleNameDict.clear(); imageNameDict.clear(); - //defineDict.clear(); typedefDict.clear(); groupDict.clear(); formulaDict.clear(); @@ -153,7 +151,7 @@ int documentedIncludeFiles; QTextStream tagFile; -void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, +static void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, ArgumentList *al,bool over_load,NamespaceList *nl=0); const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*"; @@ -173,7 +171,7 @@ const char *getOverloadDocs() //---------------------------------------------------------------------------- -void buildGroupList(Entry *root) +static void buildGroupList(Entry *root) { if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty()) { @@ -240,7 +238,7 @@ void buildGroupList(Entry *root) //---------------------------------------------------------------------- -void buildFileList(Entry *root) +static void buildFileList(Entry *root) { if (((root->section==Entry::FILEDOC_SEC) || ((root->section & Entry::FILE_MASK) && Config::extractAllFlag)) && @@ -419,7 +417,7 @@ static bool addNamespace(Entry *root,ClassDef *cd) //---------------------------------------------------------------------- // build a list of all classes mentioned in the documentation // and all classes that have a documentation block before their definition. -void buildClassList(Entry *root) +static void buildClassList(Entry *root) { if ( ((root->section & Entry::COMPOUNDDOC_MASK) || @@ -605,7 +603,7 @@ void buildClassList(Entry *root) //---------------------------------------------------------------------- // build a list of all namespaces mentioned in the documentation // and all namespaces that have a documentation block before their definition. -void buildNamespaceList(Entry *root) +static void buildNamespaceList(Entry *root) { if ( (root->section==Entry::NAMESPACE_SEC) || @@ -698,7 +696,7 @@ void buildNamespaceList(Entry *root) //---------------------------------------------------------------------- -void findUsingDirectives(Entry *root) +static void findUsingDirectives(Entry *root) { if (root->section==Entry::USINGDIR_SEC) { @@ -964,6 +962,8 @@ static MemberDef *addVariableToClass( md->setIndentDepth(indentDepth); md->setBodySegment(root->bodyLine,root->endBodyLine); md->setInitializer(root->initializer); + md->setMaxInitLines(root->initLines); + md->setMemberGroupId(root->mGrpId); //if (root->mGrpId!=-1) //{ // printf("memberdef %s in memberGroup %d\n",name.data(),root->mGrpId); @@ -986,7 +986,7 @@ static MemberDef *addVariableToClass( memberNameList.inSort(mn); // add the member to the class } - cd->insertMember(md,root->mGrpId); + cd->insertMember(md); //TODO: insert FileDef instead of filename strings. cd->insertUsedFile(root->fileName); @@ -1030,6 +1030,8 @@ static MemberDef *addVariableToFile( md->setIndentDepth(indentDepth); md->setBodySegment(root->bodyLine,root->endBodyLine); md->setInitializer(root->initializer); + md->setMaxInitLines(root->initLines); + md->setMemberGroupId(root->mGrpId); bool ambig; FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); md->setBodyDef(fd); @@ -1050,7 +1052,7 @@ static MemberDef *addVariableToFile( } if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - nd->insertMember(md,root->mGrpId); + nd->insertMember(md); md->setNamespace(nd); } else @@ -1058,7 +1060,7 @@ static MemberDef *addVariableToFile( // find file definition if (fd) { - fd->insertMember(md,root->mGrpId); + fd->insertMember(md); md->setFileDef(fd); } } @@ -1290,13 +1292,13 @@ nextMember: // Searches the Entry tree for Function sections. // If found they are stored in their class or in the global list. -void buildMemberList(Entry *root) +static void buildMemberList(Entry *root) { if (root->section==Entry::FUNCTION_SEC) { Debug::print(Debug::Functions,0, "FUNCTION_SEC:\n" - " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' line=`%d' bodyLine=`%d' #targs=%d #mtargs=%d mGrpId=%d\n", + " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' line=`%d' bodyLine=`%d' #targs=%d #mtargs=%d mGrpId=%d memSpec=%d\n", root->type.data(), root->parent->name.data(), root->name.data(), @@ -1307,7 +1309,8 @@ void buildMemberList(Entry *root) root->bodyLine, root->tArgList ? (int)root->tArgList->count() : -1, root->mtArgList ? (int)root->mtArgList->count() : -1, - root->mGrpId + root->mGrpId, + root->memSpec ); bool isFriend=root->type.find("friend ")!=-1; @@ -1376,7 +1379,8 @@ void buildMemberList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->setBodySegment(root->bodyLine,root->endBodyLine); - md->setInline(root->inLine); + md->setMemberSpecifiers(root->memSpec); + md->setMemberGroupId(root->mGrpId); bool ambig; md->setBodyDef(findFileDef(&inputNameDict,root->fileName,ambig)); //md->setScopeTemplateArguments(root->tArgList); @@ -1463,7 +1467,7 @@ void buildMemberList(Entry *root) } // add member to the class cd - cd->insertMember(md,root->mGrpId); + cd->insertMember(md); // add file to list of used files cd->insertUsedFile(root->fileName); @@ -1487,6 +1491,7 @@ void buildMemberList(Entry *root) //MemberDef *fmd; if ((mn=functionNameDict[root->name])) { + //printf("--> function %s already found!\n",root->name.data()); MemberDef *md=mn->first(); while (md && !found) { @@ -1494,13 +1499,14 @@ void buildMemberList(Entry *root) FileDef *fd = md->getFileDef(); QCString nsName = nd ? nd->name().data() : ""; //printf("namespace `%s'\n",nsName.data()); - if ((nd || (fd && fd->absFilePath()==root->fileName)) && + if ( matchArguments(md->argumentList(),root->argList,0,nsName) ) { // function already found in the same file, one is probably // a prototype. - found=TRUE; + found=nd || fd->absFilePath()==root->fileName; + mergeArguments(root->argList,md->argumentList()); if (!md->documentation() && !root->doc.isEmpty()) { md->setDocumentation(root->doc); @@ -1515,11 +1521,6 @@ void buildMemberList(Entry *root) bool ambig; md->setBodyDef(findFileDef(&inputNameDict,root->fileName,ambig)); } - //if (root->mGrpId!=-1 && md->getMemberGroup()==0) - //{ - // md->setMemberGroup(memberGroupDict[root->mGrpId]); - //} - md->addSectionsToDefinition(root->anchors); } md=mn->next(); @@ -1548,7 +1549,8 @@ void buildMemberList(Entry *root) FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); md->setBodyDef(fd); md->addSectionsToDefinition(root->anchors); - md->setInline(root->inLine); + md->setMemberSpecifiers(root->memSpec); + md->setMemberGroupId(root->mGrpId); QCString def; if (!root->type.isEmpty()) { @@ -1602,7 +1604,7 @@ void buildMemberList(Entry *root) if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - nd->insertMember(md,root->mGrpId); + nd->insertMember(md); md->setNamespace(nd); } else @@ -1616,7 +1618,7 @@ void buildMemberList(Entry *root) if (fd) { // add member to the file - fd->insertMember(md,root->mGrpId); + fd->insertMember(md); md->setFileDef(fd); } } @@ -1662,7 +1664,7 @@ void buildMemberList(Entry *root) //---------------------------------------------------------------------- -void findFriends() +static void findFriends() { //printf("findFriends()\n"); MemberNameListIterator fnli(functionNameList); @@ -1723,7 +1725,7 @@ void findFriends() //---------------------------------------------------------------------- -void transferFunctionDocumentation() +static void transferFunctionDocumentation() { //printf("transferFunctionDocumentation()\n"); @@ -1774,11 +1776,15 @@ void transferFunctionDocumentation() mdec->setBodySegment(mdef->getStartBodyLine(),mdef->getEndBodyLine()); mdec->setBodyDef(mdef->getFileDef()); } + mdec->mergeMemberSpecifiers(mdef->getMemberSpecifiers()); + mdef->mergeMemberSpecifiers(mdec->getMemberSpecifiers()); } } } -void transferRelatedFunctionDocumentation() +//---------------------------------------------------------------------- + +static void transferRelatedFunctionDocumentation() { // find match between function declaration and definition for // related functions @@ -1976,7 +1982,7 @@ static bool findBaseClassRelation(Entry *root,ClassDef *cd, //---------------------------------------------------------------------- // Computes the base and super classes for each class in the tree -void computeClassRelations(Entry *root) +static void computeClassRelations(Entry *root) { if ( ( @@ -2040,7 +2046,7 @@ void computeClassRelations(Entry *root) //----------------------------------------------------------------------- // compute the references (anchors in HTML) for each function in the file -void computeMemberReferences() +static void computeMemberReferences() { ClassDef *cd=classList.first(); while (cd) @@ -2080,15 +2086,15 @@ void computeMemberReferences() // set the function declaration of the member to `funcDecl'. If the boolean // over_load is set the standard overload text is added. -void addMemberDocs(Entry *root, +static void addMemberDocs(Entry *root, MemberDef *md, const char *funcDecl, ArgumentList *al, bool over_load, NamespaceList *nl ) { - //printf("addMemberDocs: `%s'::`%s' `%s' funcDecl=`%s'\n", - // root->parent->name.data(),md->name().data(),md->argsString(),funcDecl); + //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; // strip extern specifier if (fDecl.left(7)=="extern ") fDecl=fDecl.right(fDecl.length()-7); @@ -2152,6 +2158,7 @@ void addMemberDocs(Entry *root, if (md->initializer().isEmpty() && !root->initializer.isEmpty()) { md->setInitializer(root->initializer); + md->setMaxInitLines(root->initLines); } //if (md->bodyCode().isEmpty() && !root->body.isEmpty()) /* no body yet */ @@ -2168,15 +2175,15 @@ void addMemberDocs(Entry *root, } //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); - if (root->inLine && !md->isInline()) md->setInline(TRUE); + md->mergeMemberSpecifiers(root->memSpec); md->addSectionsToDefinition(root->anchors); addMemberToGroups(root,md); if (cd) cd->insertUsedFile(root->fileName); if (root->mGrpId!=-1) { - if (md->getMemberGroup()) + if (md->getMemberGroupId()!=-1) { - if (md->getMemberGroup()->groupId()!=root->mGrpId) + if (md->getMemberGroupId()!=root->mGrpId) { warn( root->fileName,root->startLine, @@ -2188,21 +2195,23 @@ void addMemberDocs(Entry *root, } else // set group id { - //md->setMemberGroup(memberGroupDict[root->mGrpId]); - if (cd) - cd->addMemberToGroup(md,root->mGrpId); - else if (nd) - nd->addMemberToGroup(md,root->mGrpId); - else - { - bool ambig; - FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); - if (fd) - { - fd->addMemberToGroup(md,root->mGrpId); - } - } + md->setMemberGroupId(root->mGrpId); } + //md->setMemberGroup(memberGroupDict[root->mGrpId]); + // if (cd) + // cd->addMemberToGroup(md,root->mGrpId); + // else if (nd) + // nd->addMemberToGroup(md,root->mGrpId); + // else + // { + // bool ambig; + // FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); + // if (fd) + // { + // //fd->addMemberToGroup(md,root->mGrpId); + // } + // } + //} } } @@ -2336,8 +2345,8 @@ static bool findUnrelatedFunction(Entry *root, bool viaUsingDirective = nl && nd && nl->find(nd)!=-1; if ((namespaceName.isEmpty() && nd==0) || // not in a namespace - (nd && nd->name()==namespaceName) || // or in the same namespace - viaUsingDirective // member in `using' namespace + (nd && nd->name()==namespaceName) || // or in the same namespace + viaUsingDirective // member in `using' namespace ) { Debug::print(Debug::FindMembers,0,"4. Try to add member `%s' to scope `%s'\n", @@ -2360,8 +2369,20 @@ static bool findUnrelatedFunction(Entry *root, } if (!found) // no match { + QCString fullFuncDecl=decl; + if (root->argList) fullFuncDecl+=argListToString(root->argList); warn(root->fileName,root->startLine, - "Warning: no matching member found for \n%s",decl); + "Warning: no matching file member found for \n%s",fullFuncDecl.data()); + if (mn->count()>0) + { + warn_cont("Possible candidates:\n"); + md=mn->first(); + while (md) + { + warn_cont(" %s\n",md->declaration()); + md=mn->next(); + } + } } } else // got docs for an undefined member! @@ -2373,7 +2394,7 @@ static bool findUnrelatedFunction(Entry *root, return TRUE; } -void substituteTemplateArgNames(ArgumentList *src, +static void substituteTemplateArgNames(ArgumentList *src, const QCString &s, ArgumentList *tempArgs, ArgumentList *dst) @@ -2468,16 +2489,16 @@ void substituteTemplateArgNames(ArgumentList *src, // The boolean overloaded is used to specify whether or not a standard // overload documentation line should be generated. -void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, +static void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, bool isFunc) { Debug::print(Debug::FindMembers,0, "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d," "isFunc=%d mGrpId=%d tArgList=%p=\"%s\" scopeSpec=%s " - "memberSpec=%s inLine=%d\n", + "memberSpec=%s memSpec=%d\n", root,funcDecl.data(),related.data(),overloaded,isFunc,root->mGrpId, root->tArgList,tempArgListToString(root->tArgList).data(), - root->scopeSpec.data(),root->memberSpec.data(),root->inLine + root->scopeSpec.data(),root->memberSpec.data(),root->memSpec ); //if (Config::includeSourceFlag && !root->body.isEmpty()) //{ @@ -2496,22 +2517,40 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, QCString exceptions; bool isRelated=FALSE; bool isFriend=FALSE; - - if (funcDecl.left(7)=="friend ") // treat friends as related members - { - funcDecl=funcDecl.right(funcDecl.length()-7); - isFriend=TRUE; - } - if (funcDecl.left(7)=="inline ") - { - funcDecl=funcDecl.right(funcDecl.length()-7); - root->inLine=TRUE; - } - if (funcDecl.left(8)=="virtual ") + bool done; + do { - funcDecl=funcDecl.right(funcDecl.length()-7); - root->inLine=TRUE; - } + done=TRUE; + if (funcDecl.left(7)=="friend ") // treat friends as related members + { + funcDecl=funcDecl.right(funcDecl.length()-7); + isFriend=TRUE; + done=FALSE; + } + if (funcDecl.left(7)=="inline ") + { + funcDecl=funcDecl.right(funcDecl.length()-7); + root->memSpec|=Entry::Inline; + done=FALSE; + } + if (funcDecl.left(9)=="explicit ") + { + funcDecl=funcDecl.right(funcDecl.length()-9); + root->memSpec|=Entry::Explicit; + done=FALSE; + } + if (funcDecl.left(8)=="mutable ") + { + funcDecl=funcDecl.right(funcDecl.length()-8); + root->memSpec|=Entry::Mutable; + done=FALSE; + } + if (funcDecl.left(8)=="virtual ") + { + funcDecl=funcDecl.right(funcDecl.length()-7); + done=FALSE; + } + } while (!done); // delete any ; from the function declaration int sep; @@ -2747,6 +2786,9 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList); + + if (funcType=="template class" && !funcTempList.isEmpty()) + return; // ignore explicit template instantiations Debug::print(Debug::FindMembers,0, "findMember() Parse results:\n" @@ -2924,37 +2966,24 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, } } if (count==0 && !(isFriend && funcType=="class")) + { warn(root->fileName,root->startLine, - "Warning: no matching member found for \n%s", + "Warning: no matching class member found for \n %s", fullFuncDecl.data() ); -#if 0 - else if (count>1) - { - warn("Warning: multiple matching members for\n%s\n",funcDecl.data()); - int matchCount=0; - MemberDef *md=mn->first(); - while (md) + if (mn->count()>0) { - if (md->memberClass() && className==md->memberClass()->name()) - matchCount++; - md=mn->next(); - } - if (matchCount>0) - { - warn("Possible candidates are:\n"); + warn_cont("Possible candidates:\n"); md=mn->first(); while (md) { ClassDef *cd=md->memberClass(); - if (cd && className==cd->name()) - warn(" %s::%s%s\n",md->memberClass()->name(), - md->name(),md->argsString()); + if (!cd || cd->name()==className) + warn_cont(" %s\n",md->declaration()); md=mn->next(); } } } -#endif } else if (overloaded) // check if the function belongs to only one class { @@ -2993,24 +3022,16 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, doc+="

    "; doc+=root->doc; md->setDocumentation(doc); - //md->setDecFile(root->fileName); - //md->setDecLine(root->startLine); - //md->setDefFile(root->fileName); - //md->setDefLine(root->startLine); md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); - //if (root->mGrpId!=-1) - //{ - // md->setMemberGroup(memberGroupDict[root->mGrpId]); - //} - //md->setBody(root->body); md->setBodySegment(root->bodyLine,root->endBodyLine); bool ambig; FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); md->setBodyDef(fd); - md->setInline(root->inLine); + md->setMemberSpecifiers(root->memSpec); + md->setMemberGroupId(root->mGrpId); mn->inSort(md); - cd->insertMember(md,root->mGrpId); + cd->insertMember(md); cd->insertUsedFile(root->fileName); } } @@ -3116,7 +3137,7 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, // md->setMemberGroup(memberGroupDict[root->mGrpId]); //} md->setMemberClass(cd); - md->setInline(root->inLine); + md->setMemberSpecifiers(root->memSpec); md->setDefinition(funcDecl); //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); @@ -3124,8 +3145,9 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->addSectionsToDefinition(root->anchors); + md->setMemberGroupId(root->mGrpId); mn->inSort(md); - cd->insertMember(md,root->mGrpId); + cd->insertMember(md); cd->insertUsedFile(root->fileName); if (newMemberName) { @@ -3154,6 +3176,12 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, "be found.", funcName.data() ); } + else if (!className.isEmpty()) + { + warn(root->fileName,root->startLine, + "Warning: member %s of class %s cannot be found", + funcName.data(),className.data()); + } } } else @@ -3169,13 +3197,13 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, // find the members corresponding to the different documentation blocks // that are extracted from the sources. -void findMemberDocumentation(Entry *root) +static void findMemberDocumentation(Entry *root) { int i,l; QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, - "root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->inLine=%d\n", - root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->inLine + "root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d\n", + root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec ); bool isFunc=TRUE; if ((i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr @@ -3216,8 +3244,8 @@ void findMemberDocumentation(Entry *root) ) ) && (!root->doc.isEmpty() || !root->brief.isEmpty() || - root->bodyLine!=-1 /* || root->mGrpId!=-1 || Config::extractAllFlag*/ - || root->inLine + root->bodyLine!=-1 + || (root->memSpec&Entry::Inline) ) ) { @@ -3269,7 +3297,7 @@ void findMemberDocumentation(Entry *root) //---------------------------------------------------------------------- // find and add the enumeration to their classes, namespaces or files -void findEnums(Entry *root) +static void findEnums(Entry *root) { if (root->section==Entry::ENUM_SEC) // non anonymous enumeration @@ -3340,6 +3368,7 @@ void findEnums(Entry *root) //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); + md->setMemberGroupId(root->mGrpId); //if (root->mGrpId!=-1) //{ // md->setMemberGroup(memberGroupDict[root->mGrpId]); @@ -3347,18 +3376,18 @@ void findEnums(Entry *root) if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { md->setDefinition(nd->name()+"::"+name); - nd->insertMember(md,root->mGrpId); + nd->insertMember(md); md->setNamespace(nd); } else if (isGlobal) { md->setDefinition(name); - fd->insertMember(md,root->mGrpId); + fd->insertMember(md); } else if (cd) { md->setDefinition(cd->name()+"::"+name); - cd->insertMember(md,root->mGrpId); + cd->insertMember(md); cd->insertUsedFile(root->fileName); } md->setDocumentation(root->doc); @@ -3438,7 +3467,7 @@ void findEnums(Entry *root) //---------------------------------------------------------------------- // find the documentation blocks for the enumerations -void findEnumDocumentation(Entry *root) +static void findEnumDocumentation(Entry *root) { if (root->section==Entry::ENUMDOC_SEC && !root->name.isEmpty() @@ -3495,9 +3524,10 @@ void findEnumDocumentation(Entry *root) md->setBriefDescription(root->brief); } - if (root->mGrpId!=-1 && md->getMemberGroup()==0) + if (root->mGrpId!=-1 && md->getMemberGroupId()==-1) { - cd->addMemberToGroup(md,root->mGrpId); + //cd->addMemberToGroup(md,root->mGrpId); + md->setMemberGroupId(root->mGrpId); } md->addSectionsToDefinition(root->anchors); @@ -3577,7 +3607,7 @@ static void findDEV(const MemberNameList &mnl) // seach for each enum (member or function) if it has documented enum // values. -void findDocumentedEnumValues() +static void findDocumentedEnumValues() { findDEV(memberNameList); findDEV(functionNameList); @@ -3589,7 +3619,7 @@ void findDocumentedEnumValues() // the members that override the implementation of `m' are searched and // the member that `m' overrides is searched. -void computeMemberRelations() +static void computeMemberRelations() { MemberName *mn=memberNameList.first(); while (mn) // for each member name @@ -3641,7 +3671,7 @@ void computeMemberRelations() //---------------------------------------------------------------------------- -void computeClassImplUsageRelations() +static void computeClassImplUsageRelations() { ClassDef *cd; ClassListIterator cli(classList); @@ -3652,15 +3682,15 @@ void computeClassImplUsageRelations() } //---------------------------------------------------------------------------- -void computeMemberGroups() -{ - ClassDef *cd; - ClassListIterator cli(classList); - for (;(cd=cli.current());++cli) - { - cd->computeMemberGroups(); - } -} +//static void computeMemberGroups() +//{ +// ClassDef *cd; +// ClassListIterator cli(classList); +// for (;(cd=cli.current());++cli) +// { +// cd->computeMemberGroups(); +// } +//} //---------------------------------------------------------------------------- @@ -3680,7 +3710,7 @@ void computeClassIntfUsageRelations() // builds the list of all members for each class -void buildCompleteMemberLists() +static void buildCompleteMemberLists() { ClassDef *cd; ClassListIterator cli(classList); @@ -3702,7 +3732,7 @@ void buildCompleteMemberLists() //---------------------------------------------------------------------------- -void generateFileDocs() +static void generateFileDocs() { if (documentedHtmlFiles==0) return; writeFileIndex(*outputList); @@ -3764,7 +3794,7 @@ void generateFileDocs() // } //} -void addSourceReferences() +static void addSourceReferences() { ClassListIterator cli(classList); ClassDef *cd=0; @@ -3789,8 +3819,6 @@ void addSourceReferences() if (fd && cd && cd->isLinkableInProject() && md->getStartBodyLine()!=-1 && md->isLinkableInProject()) { - //printf("Found member `%s' in file `%s' at line `%d'\n", - // md->name().data(),fd->name().data(),md->getStartBodyLine()); Definition *d=cd; if (d==0) d=md->getNamespace(); if (d==0) d=md->getFileDef(); @@ -3825,16 +3853,13 @@ void addSourceReferences() //---------------------------------------------------------------------------- // generate the documentation of all classes -void generateClassDocs() +static void generateClassDocs() { // write the installdox script if necessary if (Config::generateHtml && (Config::tagFileList.count()>0 || Config::searchEngineFlag)) writeInstallScript(); - msg("Generating index page...\n"); - writeIndex(*outputList); - msg("Generating annotated compound index...\n"); writeAnnotatedIndex(*outputList); @@ -3872,7 +3897,7 @@ void generateClassDocs() //---------------------------------------------------------------------------- -void inheritDocumentation() +static void inheritDocumentation() { MemberNameListIterator mnli(memberNameList); MemberName *mn; @@ -3905,7 +3930,46 @@ void inheritDocumentation() //---------------------------------------------------------------------------- -void distributeMemberGroupDocumentation() +static void addMembersToMemberGroup() +{ + // for each class + ClassListIterator cli(classList); + ClassDef *cd; + for ( ; (cd=cli.current()) ; ++cli ) + { + cd->addMembersToMemberGroup(); + } + // for each file + FileName *fn=inputNameList.first(); + while (fn) + { + FileDef *fd=fn->first(); + while (fd) + { + fd->addMembersToMemberGroup(); + fd=fn->next(); + } + fn=inputNameList.next(); + } + // for each namespace + NamespaceDef *nd=namespaceList.first(); + while (nd) + { + nd->addMembersToMemberGroup(); + nd=namespaceList.next(); + } + // for each group + GroupDef *gd=groupList.first(); + while (gd) + { + gd->addMembersToMemberGroup(); + gd=groupList.next(); + } +} + +//---------------------------------------------------------------------------- + +static void distributeMemberGroupDocumentation() { // for each class ClassListIterator cli(classList); @@ -3944,7 +4008,7 @@ void distributeMemberGroupDocumentation() //---------------------------------------------------------------------------- -void findDefineDocumentation(Entry *root) +static void findDefineDocumentation(Entry *root) { if ((root->section==Entry::DEFINEDOC_SEC || root->section==Entry::DEFINE_SEC) && !root->name.isEmpty() @@ -3974,19 +4038,17 @@ void findDefineDocumentation(Entry *root) if (md->briefDescription().isEmpty()) md->setBriefDescription(root->brief); md->setBodySegment(root->bodyLine,root->endBodyLine); - //if (root->mGrpId!=-1 && md->getMemberGroup()==0) - //{ - // md->setMemberGroup(memberGroupDict[root->mGrpId]); - //} bool ambig; md->setBodyDef(findFileDef(&inputNameDict,root->fileName,ambig)); md->addSectionsToDefinition(root->anchors); + md->setMaxInitLines(root->initLines); + if (root->mGrpId!=-1) md->setMemberGroupId(root->mGrpId); addMemberToGroups(root,md); - FileDef *fd=md->getFileDef(); - if (fd && root->mGrpId!=-1) - { - fd->addMemberToGroup(md,root->mGrpId); - } + //FileDef *fd=md->getFileDef(); + //if (fd && root->mGrpId!=-1) + //{ + // fd->addMemberToGroup(md,root->mGrpId); + //} } md=mn->next(); } @@ -4021,11 +4083,12 @@ void findDefineDocumentation(Entry *root) //{ // md->setMemberGroup(memberGroupDict[root->mGrpId]); //} + if (root->mGrpId!=-1) md->setMemberGroupId(root->mGrpId); addMemberToGroups(root,md); - if (root->mGrpId!=-1) - { - fd->addMemberToGroup(md,root->mGrpId); - } + //if (root->mGrpId!=-1) + //{ + // fd->addMemberToGroup(md,root->mGrpId); + //} } } md=mn->next(); @@ -4057,7 +4120,7 @@ void findDefineDocumentation(Entry *root) //---------------------------------------------------------------------------- // create a (sorted) list of separate documentation pages -void buildPageList(Entry *root) +static void buildPageList(Entry *root) { if (root->section == Entry::PAGEDOC_SEC) { @@ -4115,7 +4178,7 @@ void buildPageList(Entry *root) } } -void findMainPage(Entry *root) +static void findMainPage(Entry *root) { if (root->section == Entry::MAINPAGEDOC_SEC) { @@ -4145,7 +4208,7 @@ void findMainPage(Entry *root) //---------------------------------------------------------------------------- -void resolveUserReferences() +static void resolveUserReferences() { QDictIterator sdi(sectionDict); SectionInfo *si; @@ -4185,7 +4248,7 @@ void resolveUserReferences() // } //} -void generatePageDocs() +static void generatePageDocs() { PageInfo *pi=pageList.first(); while (pi) @@ -4217,7 +4280,7 @@ void generatePageDocs() //---------------------------------------------------------------------------- // create a (sorted) list & dictionary of example pages -void buildExampleList(Entry *root) +static void buildExampleList(Entry *root) { if (root->section == Entry::EXAMPLE_SEC) { @@ -4261,7 +4324,7 @@ void buildExampleList(Entry *root) //---------------------------------------------------------------------------- // generate the example documentation -void generateExampleDocs() +static void generateExampleDocs() { outputList->disable(OutputGenerator::Man); PageInfo *pi=exampleList.first(); @@ -4283,7 +4346,7 @@ void generateExampleDocs() //---------------------------------------------------------------------------- // generate module pages -void generateGroupDocs() +static void generateGroupDocs() { GroupListIterator gli(groupList); GroupDef *gd; @@ -4325,7 +4388,7 @@ void generateGroupDocs() //---------------------------------------------------------------------------- // generate module pages -void generateNamespaceDocs() +static void generateNamespaceDocs() { writeNamespaceIndex(*outputList); @@ -4366,7 +4429,7 @@ static QCString fixSlashes(QCString &s) //---------------------------------------------------------------------------- // generate files for the search engine -void generateSearchIndex() +static void generateSearchIndex() { if (Config::searchEngineFlag && Config::generateHtml) { @@ -4478,7 +4541,7 @@ void generateSearchIndex() //---------------------------------------------------------------------------- // generate the configuration file -void generateConfigFile(const char *configFile,bool shortList) +static void generateConfigFile(const char *configFile,bool shortList) { QFile f; bool fileOpened=FALSE; @@ -4524,15 +4587,17 @@ void generateConfigFile(const char *configFile,bool shortList) //---------------------------------------------------------------------------- // read and parse a tag file -bool readLineFromFile(QFile &f,QCString &s) -{ - char c=0; - s.resize(0); - while (!f.atEnd() && (c=f.getch())!='\n') s+=c; - return f.atEnd(); -} +//static bool readLineFromFile(QFile &f,QCString &s) +//{ +// char c=0; +// s.resize(0); +// while (!f.atEnd() && (c=f.getch())!='\n') s+=c; +// return f.atEnd(); +//} + +//---------------------------------------------------------------------------- -void readTagFile(const char *tl) +static void readTagFile(const char *tl) { QCString tagLine = tl; QCString fileName; @@ -4571,7 +4636,7 @@ void readTagFile(const char *tl) // returns TRUE if the name of the file represented by `fi' matches // one of the file patterns in the `patList' list. -bool patternMatch(QFileInfo *fi,QStrList *patList) +static bool patternMatch(QFileInfo *fi,QStrList *patList) { bool found=FALSE; if (patList) @@ -4579,12 +4644,15 @@ bool patternMatch(QFileInfo *fi,QStrList *patList) char *pattern=patList->first(); while (pattern && !found) { + //printf("Matching `%s' against pattern `%s'\n",fi->fileName().data(),pattern); #if defined(_WIN32) // windows QRegExp re(pattern,FALSE,TRUE); // case insensitive match #else // unix QRegExp re(pattern,TRUE,TRUE); // case sensitive match #endif - found = found || re.match(fi->fileName())!=-1 || re.match(fi->filePath())!=-1; + found = found || re.match(fi->fileName())!=-1 || + re.match(fi->filePath())!=-1 || + re.match(fi->absFilePath())!=-1; pattern=patList->next(); } } @@ -4595,7 +4663,7 @@ bool patternMatch(QFileInfo *fi,QStrList *patList) // reads a file into an array and filters out any 0x00 and 0x06 bytes, // because these are special for the parser. -void copyAndFilterFile(const char *fileName,BufStr &dest) +static void copyAndFilterFile(const char *fileName,BufStr &dest) { // try to open file int size=0; @@ -4652,7 +4720,7 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) } //---------------------------------------------------------------------------- -void copyStyleSheet() +static void copyStyleSheet() { if (!Config::htmlStyleSheet.isEmpty()) { @@ -4687,8 +4755,7 @@ void copyStyleSheet() // The name of the file is written in front of the file's contents and // between 0x06 markers - -void readFiles(BufStr &output) +static void readFiles(BufStr &output) { QCString *s=inputFiles.first(); // char *p=output.data(); @@ -4743,7 +4810,7 @@ void readFiles(BufStr &output) // The directory is read iff the recusiveFlag is set. // The contents of all files is append to the input string -int readDir(QFileInfo *fi, +static int readDir(QFileInfo *fi, FileNameList *fnList, FileNameDict *fnDict, StringDict *exclDict, @@ -4756,6 +4823,7 @@ int readDir(QFileInfo *fi, QDir dir((const char *)fi->absFilePath()); dir.setFilter( QDir::Files | QDir::Dirs ); int totalSize=0; + //printf("readDir `%s'\n",fi->absFilePath().data()); const QFileInfoList *list = dir.entryInfoList(); QFileInfoListIterator it( *list ); @@ -4775,6 +4843,7 @@ int readDir(QFileInfo *fi, { totalSize+=cfi->size()+cfi->absFilePath().length()+4; QCString name=convertToQCString(cfi->fileName()); + //printf("New file %s\n",name.data()); if (fnDict) { FileDef *fd=new FileDef(cfi->dirPath()+"/",name); @@ -4815,44 +4884,44 @@ int readDir(QFileInfo *fi, //---------------------------------------------------------------------------- // read the file with name `name' into a string. -QCString readExampleFile(const char *name) -{ - QCString example; - QFileInfo fi(name); - if (fi.exists()) - { - QFile f((const char *)fi.absFilePath()); - if (f.open(IO_ReadOnly)) - { - example.resize(fi.size()+1); - if ((int)fi.size()!=f.readBlock(example.data(),fi.size())) - { - err("Error while reading file %s\n",fi.absFilePath().data()); - //exit(1); - return ""; - } - example.at(fi.size())='\0'; - } - else - { - err("Error opening file %s\n",fi.absFilePath().data()); - //exit(1); - return ""; - } - } - else - { - err("Error: example file %s does not exist\n",name); - exit(1); - } - return example; -} +//static QCString readExampleFile(const char *name) +//{ +// QCString example; +// QFileInfo fi(name); +// if (fi.exists()) +// { +// QFile f((const char *)fi.absFilePath()); +// if (f.open(IO_ReadOnly)) +// { +// example.resize(fi.size()+1); +// if ((int)fi.size()!=f.readBlock(example.data(),fi.size())) +// { +// err("Error while reading file %s\n",fi.absFilePath().data()); +// //exit(1); +// return ""; +// } +// example.at(fi.size())='\0'; +// } +// else +// { +// err("Error opening file %s\n",fi.absFilePath().data()); +// //exit(1); +// return ""; +// } +// } +// else +// { +// err("Error: example file %s does not exist\n",name); +// exit(1); +// } +// return example; +//} //---------------------------------------------------------------------------- // read a file or all files in a directory and append their contents to the // input string. The names of the files are appended to the `fiList' list. -int readFileOrDirectory(const char *s, +static int readFileOrDirectory(const char *s, FileNameList *fnList, FileNameDict *fnDict, StringDict *exclDict, @@ -4863,6 +4932,7 @@ int readFileOrDirectory(const char *s, ) { QFileInfo fi(s); + //printf("readFileOrDirectory(%s)\n",s); int totalSize=0; { if (exclDict==0 || exclDict->find(fi.absFilePath())==0) @@ -4876,6 +4946,7 @@ int readFileOrDirectory(const char *s, totalSize+=fi.size()+fi.absFilePath().length()+4; //readFile(&fi,fiList,input); //fiList->inSort(new FileInfo(fi)); QCString name=convertToQCString(fi.fileName()); + //printf("New file %s\n",name.data()); if (fnDict) { FileDef *fd=new FileDef(fi.dirPath(TRUE)+"/",name); @@ -4910,7 +4981,7 @@ int readFileOrDirectory(const char *s, //---------------------------------------------------------------------------- -void readFormulaRepository() +static void readFormulaRepository() { QFile f(Config::htmlOutputDir+"/formula.repository"); if (f.open(IO_ReadOnly)) // open repository @@ -4942,7 +5013,7 @@ void readFormulaRepository() //---------------------------------------------------------------------------- // print the usage of doxygen -void usage(const char *name) +static void usage(const char *name) { msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2000\n\n",versionString); msg("You can use doxygen in three ways:\n\n"); @@ -4964,7 +5035,7 @@ void usage(const char *name) // read the argument of option `c' from the comment argument list and // update the option index `optind'. -const char *getArg(int argc,char **argv,int &optind) +static const char *getArg(int argc,char **argv,int &optind) { char *s=0; if (strlen(&argv[optind][2])>0) @@ -5299,9 +5370,6 @@ int main(int argc,char **argv) msg("Determining which enums are documented\n"); findDocumentedEnumValues(); - msg("Computing member groups...\n"); - computeMemberGroups(); - msg("Computing member references...\n"); computeMemberReferences(); @@ -5314,6 +5382,11 @@ int main(int argc,char **argv) computeClassImplUsageRelations(); } + msg("Adding members to member groups.\n"); + addMembersToMemberGroup(); + + msg("Distributing member group documentation.\n"); + distributeMemberGroupDocumentation(); msg("Building full member lists recursively...\n"); buildCompleteMemberLists(); @@ -5324,9 +5397,6 @@ int main(int argc,char **argv) //msg("Determining member group documentation...\n"); //computeMemberGroupDocumentation(); - msg("Adding source references...\n"); - addSourceReferences(); - //unrelatedFunctionsUsed=hasUnrelatedFunctions(); if (Config::inheritDocsFlag) @@ -5335,9 +5405,12 @@ int main(int argc,char **argv) inheritDocumentation(); } - msg("Distributing member group documentation.\n"); - distributeMemberGroupDocumentation(); + //msg("Computing member groups...\n"); + //computeMemberGroups(); + msg("Adding source references...\n"); + addSourceReferences(); + /************************************************************************** * Generate documentation * **************************************************************************/ @@ -5367,6 +5440,9 @@ int main(int argc,char **argv) msg("Resolving user defined references...\n"); resolveUserReferences(); + msg("Generating index page...\n"); + writeIndex(*outputList); + msg("Generating example documentation...\n"); generateExampleDocs(); diff --git a/src/entry.cpp b/src/entry.cpp index e3aaa8d..2638051 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -69,8 +69,9 @@ Entry::Entry(const Entry &e) mGrpId = e.mGrpId; bodyLine = e.bodyLine; endBodyLine = e.endBodyLine; - inLine = e.inLine; + memSpec = e.memSpec; initializer = e.initializer; + initLines = e.initLines; sublist = new QList; sublist->setAutoDelete(TRUE); extends = new QList; @@ -207,6 +208,7 @@ void Entry::reset() scopeSpec.resize(0); memberSpec.resize(0); initializer.resize(0); + initLines = -1; startLine = 1; bodyLine = -1; endBodyLine = -1; @@ -217,7 +219,7 @@ void Entry::reset() slot = FALSE; stat = FALSE; proto = FALSE; - inLine = FALSE; + memSpec = 0; subGrouping = TRUE; protection = Public; sublist->clear(); diff --git a/src/entry.h b/src/entry.h index d35d80e..9f3018d 100644 --- a/src/entry.h +++ b/src/entry.h @@ -46,7 +46,7 @@ struct Argument docs=a.docs.copy(); array=a.array.copy(); } - /* Assignment of an argument (does a deep copy of all strings). */ + /*! Assignment of an argument (does a deep copy of all strings). */ Argument &operator=(const Argument &a) { if (this!=&a) @@ -144,6 +144,12 @@ class Entry MEMBERGRP_SEC = 0x01300000, USINGDECL_SEC = 0x01400000 }; + enum MemberSpecifier + { + Inline = 0x1, + Explicit = 0x2, + Mutable = 0x4 + }; Entry(); Entry(const Entry &); @@ -159,7 +165,8 @@ class Entry bool slot; // a Qt slot ? bool stat; // static ? bool proto; // prototype ? - bool inLine; // inline ? + int memSpec; // member specifiers + int initLines; // define/variable initializer lines to show bool subGrouping; // automatically group class members? Specifier virt; // virtualness of the entry Entry *parent; // parent node in the tree diff --git a/src/filedef.cpp b/src/filedef.cpp index 2d4e60d..2822fec 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -269,7 +269,10 @@ void FileDef::writeDocumentation(OutputList &ol) 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); @@ -439,44 +442,75 @@ void FileDef::writeSource(OutputList &ol) /*! Adds a member \a md to the member group with id \a groupId. */ -void FileDef::addMemberToGroup(MemberDef *md,int groupId) +void FileDef::addMemberListToGroup(MemberList *ml, + bool (MemberDef::*func)() const) { - if (groupId!=-1) + MemberListIterator mli(*ml); + MemberDef *md; + for (;(md=mli.current());++mli) { - QCString *pGrpHeader = memberHeaderDict[groupId]; - QCString *pDocs = memberDocDict[groupId]; - if (pGrpHeader) + int groupId=md->getMemberGroupId(); + if ((md->*func)() && groupId!=-1) { - MemberGroup *mg = memberGroupDict->find(groupId); - if (mg==0) + QCString *pGrpHeader = memberHeaderDict[groupId]; + QCString *pDocs = memberDocDict[groupId]; + if (pGrpHeader) { - mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); - memberGroupDict->insert(groupId,mg); - memberGroupList->append(mg); + MemberGroup *mg = memberGroupDict->find(groupId); + if (mg==0) + { + mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); + memberGroupDict->insert(groupId,mg); + memberGroupList->append(mg); + } + mg->insertMember(md); + md->setMemberGroup(mg); } - mg->insertMember(md); - md->setMemberGroup(mg); } } } +void FileDef::addMembersToMemberGroup() +{ + addMemberListToGroup(&allMemberList,&MemberDef::isDefine); + addMemberListToGroup(&allMemberList,&MemberDef::isTypedef); + addMemberListToGroup(&allMemberList,&MemberDef::isEnumerate); + addMemberListToGroup(&allMemberList,&MemberDef::isEnumValue); + addMemberListToGroup(&allMemberList,&MemberDef::isFunction); + addMemberListToGroup(&allMemberList,&MemberDef::isVariable); +} + /*! Adds member definition \a md to the list of all members of this file */ -void FileDef::insertMember(MemberDef *md,int groupId) +void FileDef::insertMember(MemberDef *md) { allMemberList.append(md); switch(md->memberType()) { - case MemberDef::Variable: varMembers.inSort(md); break; - case MemberDef::Function: funcMembers.inSort(md); break; - case MemberDef::Typedef: typedefMembers.inSort(md); break; - case MemberDef::Enumeration: enumMembers.inSort(md); break; - case MemberDef::EnumValue: enumValMembers.inSort(md); break; - case MemberDef::Prototype: protoMembers.inSort(md); break; - case MemberDef::Define: defineMembers.inSort(md); break; + case MemberDef::Variable: + varMembers.inSort(md); + break; + case MemberDef::Function: + funcMembers.inSort(md); + break; + case MemberDef::Typedef: + typedefMembers.inSort(md); + break; + case MemberDef::Enumeration: + enumMembers.inSort(md); + break; + case MemberDef::EnumValue: + enumValMembers.inSort(md); + break; + case MemberDef::Prototype: + protoMembers.inSort(md); + break; + case MemberDef::Define: + defineMembers.inSort(md); + break; default: err("FileDef::insertMembers(): unexpected member insert in file!\n"); } - addMemberToGroup(md,groupId); + //addMemberToGroup(md,groupId); } /*! Adds compound definition \a cd to the list of all compounds of this file */ diff --git a/src/filedef.h b/src/filedef.h index 01e59d6..8fcf6c1 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -110,8 +110,7 @@ class FileDef : public Definition void writeDocumentation(OutputList &ol); void writeSource(OutputList &ol); friend void generatedFileNames(); - void insertMember(MemberDef *md,int groupId); - void addMemberToGroup(MemberDef *md,int groupId); + void insertMember(MemberDef *md); void insertClass(ClassDef *cd); void insertNamespace(NamespaceDef *nd); void computeAnchors(); @@ -127,8 +126,12 @@ class FileDef : public Definition QList *includeFileList() const { return includeList; } QDict *includeFileDict() const { return includeDict; } + void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); + protected: + void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); + private: MemberList allMemberList; MemberList defineMembers; diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 66e7c53..941fdc9 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -91,28 +91,49 @@ void GroupDef::addNamespace(const NamespaceDef *def) namespaceList->append(def); } -void GroupDef::addMemberToGroup(MemberDef *md,int groupId) +void GroupDef::addMemberListToGroup(MemberList *ml, + bool (MemberDef::*func)() const) { - if (groupId!=-1) + if (ml==0) return; + MemberListIterator mli(*ml); + MemberDef *md; + for (;(md=mli.current());++mli) { - QCString *pGrpHeader = memberHeaderDict[groupId]; - QCString *pDocs = memberDocDict[groupId]; - if (pGrpHeader) + int groupId=md->getMemberGroupId(); + if ((md->*func)() && groupId!=-1) { - MemberGroup *mg = memberGroupDict->find(groupId); - if (mg==0) + QCString *pGrpHeader = memberHeaderDict[groupId]; + QCString *pDocs = memberDocDict[groupId]; + if (pGrpHeader) { - mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); - memberGroupDict->insert(groupId,mg); - memberGroupList->append(mg); + MemberGroup *mg = memberGroupDict->find(groupId); + if (mg==0) + { + mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); + memberGroupDict->insert(groupId,mg); + memberGroupList->append(mg); + } + mg->insertMember(md); + md->setMemberGroup(mg); } - mg->insertMember(md); - md->setMemberGroup(mg); } } } -void GroupDef::insertMember(MemberDef *md,int groupId) +void GroupDef::addMembersToMemberGroup() +{ + addMemberListToGroup(allMemberList,&MemberDef::isDefine); + addMemberListToGroup(allMemberList,&MemberDef::isTypedef); + addMemberListToGroup(allMemberList,&MemberDef::isEnumerate); + addMemberListToGroup(allMemberList,&MemberDef::isEnumValue); + addMemberListToGroup(allMemberList,&MemberDef::isFunction); + addMemberListToGroup(allMemberList,&MemberDef::isSlot); + addMemberListToGroup(allMemberList,&MemberDef::isSignal); + addMemberListToGroup(allMemberList,&MemberDef::isVariable); +} + + +void GroupDef::insertMember(MemberDef *md) { QCString funcDecl=md->name()+md->argsString(); if (allMemberDict->find(funcDecl)==0) @@ -131,7 +152,7 @@ void GroupDef::insertMember(MemberDef *md,int groupId) default: err("FileDef::insertMembers(): unexpected member insert in file!\n"); } - addMemberToGroup(md,groupId); + //addMemberToGroup(md,groupId); } } @@ -432,7 +453,7 @@ void addMemberToGroups(Entry *root,MemberDef *md) GroupDef *mgd = md->groupDef(); if (mgd==0) { - gd->insertMember(md,root->mGrpId); + gd->insertMember(md); md->setGroupDef(gd); } else if (mgd!=gd) diff --git a/src/groupdef.h b/src/groupdef.h index 4f90bb3..e673f7b 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -47,8 +47,7 @@ class GroupDef : public Definition void addClass(const ClassDef *def); void addNamespace(const NamespaceDef *def); void addGroup(const GroupDef *def); - void insertMember(MemberDef *def,int groupId); - void addMemberToGroup(MemberDef *def,int groupId); + void insertMember(MemberDef *def); void writeDocumentation(OutputList &ol); int countMembers() const; bool isLinkableInProject() @@ -60,8 +59,13 @@ class GroupDef : public Definition return isLinkableInProject() || isReference(); } void computeAnchors(); + + void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); + protected: + void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); + private: QCString title; // title of the group QCString fileName; // base name of the generated file diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index f4d6799..1649407 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -853,37 +853,18 @@ void HtmlGenerator::writeGraphicalHierarchy(DotGfxHierarchyTable &g) g.writeGraph(t,Config::htmlOutputDir); } -void HtmlGenerator::startMemberGroupHeader() +void HtmlGenerator::startMemberGroupHeader(bool) { - //t << "" << endl; - //t << "" << endl; - //t << "

    " << endl; - //t << " " << endl; - //t << " " << endl; - //t << " " << endl; - //t << " " << endl; - //t << " " << endl; - //t << " " << endl; - //t << " " << endl; - //t << " " << endl; - //t << "
      "; - t << "
    "; } void HtmlGenerator::endMemberGroupHeader() { - //t << "  
    " << endl; - //t << "
    " << endl; - //t << "" << endl; - //t << "" << endl; - t << "" << endl; } void HtmlGenerator::startMemberGroupDocs() { - //t << "" << endl; t << "
    "; } diff --git a/src/htmlgen.h b/src/htmlgen.h index e9f6cf5..e0e58cb 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -98,7 +98,7 @@ class HtmlGenerator : public OutputGenerator void endMemberList(); void startMemberItem(int); - void startMemberGroupHeader(); + void startMemberGroupHeader(bool); void endMemberGroupHeader(); void startMemberGroupDocs(); void endMemberGroupDocs(); diff --git a/src/index.cpp b/src/index.cpp index 6ed094a..75edfdd 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1534,10 +1534,21 @@ void writeIndex(OutputList &ol) int defLine = mainPage ? mainPage->defLine : 1; + QCString title; if (!mainPage || mainPage->title.isEmpty()) - ol.startFile("index","Main Index",FALSE); + { + title = "Main Index"; + } else - ol.startFile("index",mainPage->title,FALSE); + { + title = mainPage->title; + } + ol.startFile("index",title,FALSE); + + if (Config::generateHtml && Config::htmlHelpFlag) + { + HtmlHelp::getInstance()->addContentsItem(title,"index"); + } if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE); ol.startTitleHead(0); diff --git a/src/latexgen.cpp b/src/latexgen.cpp index fecebd8..028cb66 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -855,28 +855,30 @@ void LatexGenerator::startMemberDoc(const char *clname, const char *, const char *title) { - t << "\\index{"; - if (clname) + if (memname && memname[0]!='@') { - t << clname << "@{"; - docify(clname); - t << "}!"; - } - t << escapeLabelName(memname) << "@{"; - docify(memname); - t << "}}" << endl; - - t << "\\index{" << escapeLabelName(memname) << "@{"; - docify(memname); - t << "}"; - if (clname) - { - t << "!" << clname << "@{"; - docify(clname); - t << "}"; + t << "\\index{"; + if (clname) + { + t << clname << "@{"; + docify(clname); + t << "}!"; + } + t << escapeLabelName(memname) << "@{"; + docify(memname); + t << "}}" << endl; + + t << "\\index{" << escapeLabelName(memname) << "@{"; + docify(memname); + t << "}"; + if (clname) + { + t << "!" << clname << "@{"; + docify(clname); + t << "}"; + } + t << "}" << endl; } - t << "}" << endl; - // if (Config::compactLatexFlag) t << "\\paragraph"; else t << "\\subsubsection"; if (Config::pdfHyperFlag && title) t << "[" << filterTitle(title) << "]"; t << "{\\setlength{\\rightskip}{0pt plus 5cm}"; @@ -956,10 +958,28 @@ void LatexGenerator::writeSection(const char *lab,const char *title,bool sub) } } -void LatexGenerator::writeSectionRef(const char *,const char *lab, - const char *) +void LatexGenerator::writeSectionRef(const char *fileName,const char *lab, + const char *text) { - t << "\\ref{" << lab << "}"; + if (text && Config::pdfHyperFlag) + { + t << "\\hyperlink{"; + if (lab) t << lab; + t << "}{"; + docify(text); + t << "}"; + } + else + { + if (strcmp(lab,text)!=0) // lab!=text + { + t << "{\\bf " << text << " (\\ref " << lab << ")}}"; + } + else + { + t << "\\ref{" << lab << "}"; + } + } } void LatexGenerator::writeSectionRefItem(const char *,const char *lab, @@ -1265,9 +1285,10 @@ void LatexGenerator::writeImage(const char *name,const char *w,const char *h) t << "}}" << endl; } -void LatexGenerator::startMemberGroupHeader() +void LatexGenerator::startMemberGroupHeader(bool hasHeader) { - t << "\\begin{Indent}{\\bf "; + if (hasHeader) t << "\\begin{Indent}"; + t << "{\\bf "; } void LatexGenerator::endMemberGroupHeader() @@ -1289,9 +1310,10 @@ void LatexGenerator::startMemberGroup() { } -void LatexGenerator::endMemberGroup(bool) +void LatexGenerator::endMemberGroup(bool hasHeader) { - t << "\\end{Indent}" << endl; + if (hasHeader)t << "\\end{Indent}"; + t << endl; } void LatexGenerator::startDotGraph() diff --git a/src/latexgen.h b/src/latexgen.h index 933cb43..47aecd7 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -95,7 +95,7 @@ class LatexGenerator : public OutputGenerator void startMemberItem(int); void endMemberItem(bool); - void startMemberGroupHeader(); + void startMemberGroupHeader(bool); void endMemberGroupHeader(); void startMemberGroupDocs(); void endMemberGroupDocs(); diff --git a/src/mangen.cpp b/src/mangen.cpp index 8fc023c..cd5718c 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -385,7 +385,7 @@ void ManGenerator::endMemberList() } } -void ManGenerator::startMemberGroupHeader() +void ManGenerator::startMemberGroupHeader(bool) { t << "\n.PP\n.RI \"\\fB"; } diff --git a/src/mangen.h b/src/mangen.h index fc435a4..a9ff427 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -95,7 +95,7 @@ class ManGenerator : public OutputGenerator void startMemberItem(int); void endMemberItem(bool); - void startMemberGroupHeader(); + void startMemberGroupHeader(bool); void endMemberGroupHeader(); void startMemberGroupDocs(); void endMemberGroupDocs(); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index cde0c2a..1d6a26c 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -212,15 +212,17 @@ static void writeTemplatePrefix(OutputList &ol,ArgumentList *al,bool br=TRUE) * Members can be function/variables/enums/etc. inside a class or inside a * file. * - * \param t A string representing the type of the member. - * \param n A string representing the name of the member. - * \param a A string representing the arguments of the member. - * \param p The type of protection of the member, possible values are: - * \c Public, \c Protected, \c Private. - * \param v The `virtualness' of the member, possible values are: - * \c Normal, \c Virtual, \c Pure. - * \param s A boolean that is true if the member is static. - * \param r A boolean that is true if the member is only related. + * \param df File containing the definition of this member. + * \param dl Line at which the member definition was found. + * \param t A string representing the type of the member. + * \param n A string representing the name of the member. + * \param a A string representing the arguments of the member. + * \param p The type of protection of the member, possible values are: + * \c Public, \c Protected, \c Private. + * \param v The `virtualness' of the member, possible values are: + * \c Normal, \c Virtual, \c Pure. + * \param s A boolean that is true if the member is static. + * \param r A boolean that is true if the member is only related. * \param mt The kind of member. See #MemberDef::MemberType for a list of * all types. */ @@ -241,6 +243,7 @@ MemberDef::MemberDef(const char *df,int dl, memDef=0; memDec=0; group=0; + grpId=-1; exampleList=0; exampleDict=0; enumFields=0; @@ -262,13 +265,14 @@ MemberDef::MemberDef(const char *df,int dl, eUsed=FALSE; proto=FALSE; annScope=FALSE; - inLine=FALSE; + memSpec=FALSE; annMemb=0; annUsed=FALSE; annShown=FALSE; annEnumType=0; indDepth=0; section=0; + maxInitLines=defMaxInitLines; docEnumValues=FALSE; // copy function template arguments (if any) if (tal) @@ -442,19 +446,6 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *cd,NamespaceDef *nd, { Definition *d; if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else if (gd) d=gd; - //if (mg) - // ol.writeObjectLink(0,mg->getOutputFileBase(), - // anchor(),name()); - //else if (cd) - // ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), - // anchor(),name()); - //else if (nd) - // ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(), - // anchor(),name()); - //else if (fd) - // ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(), - // anchor(),name()); - //else ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),anchor(),name()); } @@ -749,7 +740,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ol.docify(excpString()); } - if (!init.isEmpty() && initLines==0) // add initializer + if (!init.isEmpty() && initLines==0 && maxInitLines>0) // add initializer { if (!isDefine()) { @@ -955,7 +946,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.startMemberDocName(); linkifyText(ol,scopeName,name(),def); writeDefArgumentList(ol,cd,scopeName,this); - if (!init.isEmpty() && initLines==0) // add initializer + if (!init.isEmpty() && initLines==0 && maxInitLines>0) // add initializer { if (!isDefine()) { @@ -986,7 +977,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (isStatic() || protection()!=Public || virt!=Normal || isSignal() || isFriend() || isRelated() || isSlot() || - (isInline() && Config::inlineInfoFlag) + getMemberSpecifiers()!=0 ) { // write the member specifier list @@ -1000,6 +991,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, { if (Config::inlineInfoFlag && isInline()) sl.append("inline"); + if (isExplicit()) sl.append("explicit"); + if (isMutable()) sl.append("mutable"); if (isStatic()) sl.append("static"); if (protection()==Protected) sl.append("protected"); else if (protection()==Private) sl.append("private"); @@ -1340,7 +1333,6 @@ bool MemberDef::isLinkableInProject() { return !name().isEmpty() && name().at(0)!='@' && ((hasDocumentation() && !isReference()) - /* || (memberGroup && memberGroup->isLinkableInProject())*/ ) && (prot!=Private || Config::extractPrivateFlag || isFriend()) && // not a private class member (classDef!=0 || Config::extractPrivateFlag || !isStatic()); // not a private file/namespace member @@ -1381,3 +1373,9 @@ void MemberDef::setMemberGroup(MemberGroup *grp) { memberGroup = grp; } + +bool MemberDef::visibleMemberGroup(bool hideNoHeader) +{ + return memberGroup!=0 && + (!hideNoHeader || memberGroup->header()!="[NOHEADER]"); +} diff --git a/src/memberdef.h b/src/memberdef.h index f369592..972c44a 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -55,8 +55,8 @@ class MemberDef : public Definition enum { - maxInitLines = 30 // maximum number of lines shown for member - // initialization + defMaxInitLines = 30 // default maximum number of lines shown for member + // initializer }; MemberDef(const char *defFileName,int defLine, @@ -93,21 +93,24 @@ class MemberDef : public Definition FileDef *getFileDec() { return fileDec; } bool isRelated() const { return related; } bool isStatic() const { return stat; } - bool isInline() const { return inLine; } + bool isInline() const { return (memSpec&Entry::Inline)!=0; } + bool isExplicit() const { return (memSpec&Entry::Explicit)!=0; } + bool isMutable() const { return (memSpec&Entry::Mutable)!=0; } MemberList *getSectionList() const { return section; } void setMemberType(MemberType t) { mtype=t; } void setDefinition(const char *d) { def=d; } - //void setDefFile(const char *f) { defFile=f; } - //void setDefLine(int l) { defLine=l; } void setFileDef(FileDef *fd) { fileDef=fd; } void setFileDec(FileDef *fd) { fileDec=fd; } void setAnchor(const char *a) { anc=a; } void setProtection(Protection p) { prot=p; } - void setInline(bool in) { inLine=in; } + void setMemberSpecifiers(int s) { memSpec=s; } + int getMemberSpecifiers() { return memSpec; } + void mergeMemberSpecifiers(int s) { memSpec|=s; } void setInitializer(const char *i) { init=i; init=init.stripWhiteSpace(); initLines=init.contains('\n'); } + void setMaxInitLines(int lines) { if (lines!=-1) maxInitLines=lines; } void setMemberClass(ClassDef *cd) { classDef=cd; } void setSectionList(MemberList *sl) { section=sl; } void makeRelated() { related=TRUE; } @@ -143,10 +146,6 @@ class MemberDef : public Definition bool hasExamples(); ExampleList *getExampleList() const { return exampleList; } - // prototype related members - //void setDecFile(const char *f) { declFile=f; } - //void setDecLine(int l) { defLine=l; } - // convenience members bool isSignal() const { return mtype==Signal; } bool isSlot() const { return mtype==Slot; } @@ -162,10 +161,6 @@ class MemberDef : public Definition void setPrototype(bool p) { proto=p; } bool isPrototype() const { return proto; } - // tag file related members - //void setReference(const char *r) { external=r; } - //bool isReference() { return !external.isEmpty(); } - // argument related members ArgumentList *argumentList() const { return argList; } void setArgumentList(ArgumentList *al) @@ -186,6 +181,8 @@ class MemberDef : public Definition // member group related members void setMemberGroup(MemberGroup *grp); MemberGroup *getMemberGroup() const { return memberGroup; } + void setMemberGroupId(int id) { grpId=id; } + int getMemberGroupId() const { return grpId; } void setFromAnnonymousScope(bool b) { annScope=b; } void setFromAnnonymousMember(MemberDef *m) { annMemb=m; } @@ -193,6 +190,8 @@ class MemberDef : public Definition bool annonymousDeclShown() { return annUsed; } void setIndentDepth( int i) { indDepth=i; } int indentDepth() { return indDepth; } + + bool visibleMemberGroup(bool hideNoHeader); private: ClassDef *classDef; // member of or related to @@ -225,7 +224,7 @@ class MemberDef : public Definition Protection prot; // protection type [Public/Protected/Private] bool related; // is this a member that is only related to a class bool stat; // is it a static function? - bool inLine; // is it an inline function? + int memSpec; // The specifiers present for this member MemberType mtype; // returns the kind of member bool eUsed; // is the enumerate already placed in a list bool proto; // is it a prototype; @@ -234,13 +233,14 @@ class MemberDef : public Definition bool annUsed; bool annShown; int indDepth; + int maxInitLines; // when the initializer will be displayed MemberList *section; // declation list containing this member MemberDef *annMemb; ArgumentList *argList; // argument list of this member ArgumentList *tArgList; // template argument list of function template ArgumentList *scopeTAL; // template argument list of class template ArgumentList *membTAL; // template argument list of class template - //int grpId; // group id + int grpId; // group id //QCString grpHeader; // group header MemberGroup *memberGroup; // group's member definition diff --git a/src/membergroup.cpp b/src/membergroup.cpp index dc3529a..7590079 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -53,7 +53,9 @@ MemberGroup::~MemberGroup() void MemberGroup::insertMember(MemberDef *md) { - //printf("MemberGroup::insertMember(%s)\n",md->name().data()); + //printf("MemberGroup::insertMember memberList=%p count=%d" + // " member section list: %p\n",memberList,memberList->count(), + // md->getSectionList()); if (inSameSection && memberList->count()>0 && memberList->first()->getSectionList()!=md->getSectionList()) { @@ -97,11 +99,11 @@ void MemberGroup::addToDeclarationSection() } } -int MemberGroup::countDecMembers() +int MemberGroup::countDecMembers(bool sectionPerType) { if (numDeclMembers==-1) /* number of member not cached */ { - memberList->countDecMembers(TRUE,TRUE); + memberList->countDecMembers(TRUE,TRUE,sectionPerType); numDeclMembers = memberList->totalCount(); } return numDeclMembers; diff --git a/src/membergroup.h b/src/membergroup.h index 37fa9dd..238d688 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -52,7 +52,7 @@ class MemberGroup /* : public Definition */ QCString documentation() { return doc; } bool allMembersInSameSection() { return inSameSection; } void addToDeclarationSection(); - int countDecMembers(); + int countDecMembers(bool sectionPerType); void distributeMemberGroupDocumentation(); private: diff --git a/src/memberlist.cpp b/src/memberlist.cpp index e15f36a..7a862a8 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -44,7 +44,7 @@ int MemberList::compareItems(GCI item1, GCI item2) return strcmp(c1->name(),c2->name()); } -void MemberList::countDecMembers(bool inGroup,bool countSubGroups) +void MemberList::countDecMembers(bool inGroup,bool countSubGroups,bool sectionPerType) { //printf("----- countDecMembers ----\n"); varCnt=funcCnt=enumCnt=enumValCnt=typeCnt=protoCnt=defCnt=friendCnt=0; @@ -64,7 +64,7 @@ void MemberList::countDecMembers(bool inGroup,bool countSubGroups) md->hasDocumentedEnumValues() ) ) && - inGroup==(md->getMemberGroup()!=0) && + inGroup==md->visibleMemberGroup(sectionPerType) && !(inGroup && md->protection()==Private && !Config::extractPrivateFlag) ) { @@ -82,6 +82,7 @@ void MemberList::countDecMembers(bool inGroup,bool countSubGroups) case MemberDef::Prototype: protoCnt++,m_count++; break; case MemberDef::Define: if (Config::extractAllFlag || md->argsString() || + !md->initializer().isEmpty() || md->hasDocumentation() ) defCnt++,m_count++; break; @@ -98,7 +99,7 @@ void MemberList::countDecMembers(bool inGroup,bool countSubGroups) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - int mgCount = mg->countDecMembers(); + int mgCount = mg->countDecMembers(sectionPerType); //printf("memberGroupList adding %d inGroup=%d\n",mgCount,inGroup); m_count+=mgCount; } @@ -155,21 +156,20 @@ void MemberList::writePlainDeclarations(OutputList &ol, bool inGroup,bool countSubGroups ) { + bool sectionPerType = !inGroup && (fd || nd || gd); //printf("----- writePlainDeclaration() ----\n"); - countDecMembers(inGroup,countSubGroups); + countDecMembers(inGroup,countSubGroups,sectionPerType); if (totalCount()==0) return; // no members in this list //printf("----> writePlainDeclaration() inGroup=%d totalCount()=%d\n",inGroup,totalCount()); ol.pushGeneratorState(); //int prevGroupId = -1; - bool sectionPerType = !inGroup && (fd || nd || gd); if (!sectionPerType) ol.startMemberList(); MemberDef *md; if (defineCount()>0) { - //printf("There are %d defines\n",defineCount()); if (sectionPerType) { ol.startMemberHeader(); @@ -183,8 +183,10 @@ void MemberList::writePlainDeclarations(OutputList &ol, //printf("md->isDefined()=%d inGroup=%d md->getMemberGroup()=%p\n", // md->isDefine(),inGroup,md->getMemberGroup()); if (md->isDefine() && - (md->argsString() || md->hasDocumentation() || Config::extractAllFlag) && - inGroup==(md->getMemberGroup()!=0) + (md->argsString() || md->hasDocumentation() || + !md->initializer().isEmpty() || + Config::extractAllFlag) && + inGroup==md->visibleMemberGroup(sectionPerType) ) { md->writeDeclaration(ol,cd,nd,fd,gd,inGroup); @@ -209,7 +211,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, MemberListIterator mli(*this); for ( ; (md=mli.current()); ++mli ) { - if (md->isPrototype() && inGroup==(md->getMemberGroup()!=0)) + if (md->isPrototype() && inGroup==md->visibleMemberGroup(sectionPerType)) { md->writeDeclaration(ol,cd,nd,fd,gd,inGroup); } @@ -234,7 +236,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, MemberListIterator mli(*this); for ( ; (md=mli.current()) ; ++mli ) { - if (md->isTypedef() && inGroup==(md->getMemberGroup()!=0)) + if (md->isTypedef() && inGroup==md->visibleMemberGroup(sectionPerType)) { md->writeDeclaration(ol,cd,nd,fd,gd,inGroup); } @@ -263,7 +265,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, type=type.stripWhiteSpace(); // TODO: is this really needed? // filter out enums that are in a group iff inGroup holds - if (md->isEnumerate() && inGroup==(md->getMemberGroup()!=0) /*&& (hasDocs || !Config::hideMemberFlag)*/) + if (md->isEnumerate() && inGroup==md->visibleMemberGroup(sectionPerType) /*&& (hasDocs || !Config::hideMemberFlag)*/) { // filter out invisible enums if ( !Config::hideMemberFlag || // do not hide undocumented members or @@ -409,7 +411,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, if ( ( md->isFunction() || md->isSignal() || md->isSlot()) && ( !md->isRelated() || md->memberClass() ) && - inGroup==(md->getMemberGroup()!=0) + inGroup==md->visibleMemberGroup(sectionPerType) ) { md->writeDeclaration(ol,cd,nd,fd,gd,inGroup); @@ -424,7 +426,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, MemberListIterator mli(*this); for ( ; (md=mli.current()) ; ++mli ) { - if (md->isFriend() && inGroup==(md->getMemberGroup()!=0)) + if (md->isFriend() && inGroup==md->visibleMemberGroup(sectionPerType)) { QCString type=md->typeString(); //printf("Friend: type=%s name=%s\n",type.data(),md->name().data()); @@ -479,7 +481,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, MemberListIterator mli(*this); for ( ; (md=mli.current()) ; ++mli ) { - if (md->isVariable() && inGroup==(md->getMemberGroup()!=0)) + if (md->isVariable() && inGroup==md->visibleMemberGroup(sectionPerType)) { md->writeDeclaration(ol,cd,nd,fd,gd,inGroup); } @@ -495,7 +497,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, for ( ; (md=mli.current()) ; ++mli ) { if (md->fromAnnonymousScope() && !md->annonymousDeclShown() - && inGroup==(md->getMemberGroup()!=0)) + && inGroup==md->visibleMemberGroup(sectionPerType)) { //printf("annonymous compound members\n"); md->setFromAnnonymousScope(FALSE); @@ -518,13 +520,14 @@ void MemberList::writeDeclarations(OutputList &ol, { //printf("MemberList::writeDeclaration(title=`%s',subtitle=`%s')\n",title,subtitle); //printf("----- writeDeclaration() ----\n"); - countDecMembers(FALSE,countSubGroups); // count member not in group + bool sectionPerType = !inGroup && (fd || nd || gd); + countDecMembers(FALSE,countSubGroups,sectionPerType); // count member not in group int normalMembers = totalCount(); int ingroupMembers = 0; //printf("Normal members %d\n",normalMembers); if (inGroup) { - countDecMembers(TRUE,countSubGroups); // count member inside group + countDecMembers(TRUE,countSubGroups,sectionPerType); // count member inside group ingroupMembers = totalCount(); } int totalMembers = normalMembers + ingroupMembers; @@ -551,13 +554,13 @@ void MemberList::writeDeclarations(OutputList &ol, if (memberGroupList) { - //printf("MemberList::writeDeclarations()\n"); MemberGroupListIterator mgli(*memberGroupList); MemberGroup *mg; while ((mg=mgli.current())) { - ol.startMemberGroupHeader(); - if (mg->header()!="[NOHEADER]") + bool hasHeader=mg->header()!="[NOHEADER]"; + ol.startMemberGroupHeader(hasHeader); + if (hasHeader) { parseText(ol,mg->header()); } @@ -566,14 +569,13 @@ void MemberList::writeDeclarations(OutputList &ol, { //printf("Member group has docs!\n"); ol.startMemberGroupDocs(); - parseDoc(ol,"",1, - 0,0,mg->documentation()); + parseDoc(ol,"",1,0,0,mg->documentation()); ol.endMemberGroupDocs(); } ol.startMemberGroup(); mg->writePlainDeclarations(ol,cd,nd,fd,gd); ++mgli; - ol.endMemberGroup(mgli.current()==0); + ol.endMemberGroup(hasHeader); } } //printf("----- end writeDeclaration() ----\n"); @@ -593,10 +595,11 @@ void MemberList::writeDocumentation(OutputList &ol, void MemberList::addMemberGroup(MemberGroup *mg) { - //printf("MemberList::addMemberGroup(%p)\n",mg); if (memberGroupList==0) { memberGroupList=new MemberGroupList; } memberGroupList->append(mg); } + + diff --git a/src/memberlist.h b/src/memberlist.h index 8346c8f..d154d0f 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -41,7 +41,7 @@ class MemberList : public QList int protoCount() const { return protoCnt; } int defineCount() const { return defCnt; } int friendCount() const { return friendCnt; } - void countDecMembers(bool inGroup,bool countSubGroups); + void countDecMembers(bool inGroup,bool countSubGroups,bool sectionPerType); void countDocMembers(); int totalCount() const { return //varCnt+funcCnt+enumCnt+enumValCnt+typeCnt+ diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index a3cbaa2..89f7a5a 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -78,28 +78,44 @@ void NamespaceDef::insertClass(ClassDef *cd) } } -void NamespaceDef::addMemberToGroup(MemberDef *md,int groupId) +void NamespaceDef::addMemberListToGroup(MemberList *ml, + bool (MemberDef::*func)() const) { - if (groupId!=-1) + MemberListIterator mli(*ml); + MemberDef *md; + for (;(md=mli.current());++mli) { - QCString *pGrpHeader = memberHeaderDict[groupId]; - QCString *pDocs = memberDocDict[groupId]; - if (pGrpHeader) + int groupId=md->getMemberGroupId(); + if ((md->*func)() && groupId!=-1) { - MemberGroup *mg = memberGroupDict->find(groupId); - if (mg==0) + QCString *pGrpHeader = memberHeaderDict[groupId]; + QCString *pDocs = memberDocDict[groupId]; + if (pGrpHeader) { - mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); - memberGroupDict->insert(groupId,mg); - memberGroupList->append(mg); + MemberGroup *mg = memberGroupDict->find(groupId); + if (mg==0) + { + mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); + memberGroupDict->insert(groupId,mg); + memberGroupList->append(mg); + } + mg->insertMember(md); + md->setMemberGroup(mg); } - mg->insertMember(md); - md->setMemberGroup(mg); } } } -void NamespaceDef::insertMember(MemberDef *md,int groupId) +void NamespaceDef::addMembersToMemberGroup() +{ + addMemberListToGroup(&allMemberList,&MemberDef::isTypedef); + addMemberListToGroup(&allMemberList,&MemberDef::isEnumerate); + addMemberListToGroup(&allMemberList,&MemberDef::isEnumValue); + addMemberListToGroup(&allMemberList,&MemberDef::isFunction); + addMemberListToGroup(&allMemberList,&MemberDef::isVariable); +} + +void NamespaceDef::insertMember(MemberDef *md) { //memList->append(md); allMemberList.append(md); @@ -115,7 +131,7 @@ void NamespaceDef::insertMember(MemberDef *md,int groupId) default: err("NamespaceDef::insertMembers(): unexpected member inserted in namespace!\n"); } - addMemberToGroup(md,groupId); + //addMemberToGroup(md,groupId); } void NamespaceDef::computeAnchors() diff --git a/src/namespacedef.h b/src/namespacedef.h index ffcc8d2..1156d89 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -39,33 +39,18 @@ class NamespaceDef : public Definition NamespaceDef(const char *defFileName,int defLine, const char *name,const char *ref=0); ~NamespaceDef(); - //QCString namespaceFile() const { return fileName; } QCString getOutputFileBase() const { return fileName; } void insertUsedFile(const char *fname); void writeDocumentation(OutputList &ol); void insertClass(ClassDef *cd); - void insertMember(MemberDef *md,int groupId); - void addMemberToGroup(MemberDef *md,int groupId); + void insertMember(MemberDef *md); void computeAnchors(); int countMembers(); void addUsingDirective(NamespaceDef *nd); NamespaceList *getUsedNamespaces() const { return usingDirList; } void addUsingDeclaration(ClassDef *cd); ClassList *getUsedClasses() const { return usingDeclList; } - - //const char *getReference() { return reference; } - //bool isVisible() - //{ - // return !getReference() && hasDocumentation() && - // !name().isEmpty() && name().at(0)!='@'; - //} - //bool isVisibleExt() - //{ - // return (getReference() || hasDocumentation()) && - // !name().isEmpty() && name().at(0)!='@'; - //} - bool isLinkableInProject() { int i = name().findRev("::"); @@ -77,8 +62,12 @@ class NamespaceDef : public Definition { return isLinkableInProject() || isReference(); } + void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); + protected: + void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); + private: //QCString reference; QCString fileName; diff --git a/src/outputgen.h b/src/outputgen.h index bde5dcc..5f351f0 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -103,7 +103,7 @@ class OutputGenerator virtual void endMemberList() = 0; virtual void startMemberItem(int) = 0; virtual void endMemberItem(bool) = 0; - virtual void startMemberGroupHeader() = 0; + virtual void startMemberGroupHeader(bool) = 0; virtual void endMemberGroupHeader() = 0; virtual void startMemberGroupDocs() = 0; virtual void endMemberGroupDocs() = 0; diff --git a/src/outputlist.h b/src/outputlist.h index 435a2a2..b651546 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -164,8 +164,8 @@ class OutputList { forall(&OutputGenerator::startMemberItem,i1); } void endMemberItem(bool b2) { forall(&OutputGenerator::endMemberItem,b2); } - void startMemberGroupHeader() - { forall(&OutputGenerator::startMemberGroupHeader); } + void startMemberGroupHeader(bool b) + { forall(&OutputGenerator::startMemberGroupHeader,b); } void endMemberGroupHeader() { forall(&OutputGenerator::endMemberGroupHeader); } void startMemberGroupDocs() diff --git a/src/pre.l b/src/pre.l index 324fad5..8974744 100644 --- a/src/pre.l +++ b/src/pre.l @@ -760,8 +760,7 @@ Define *newDefine() void addDefine() { - //bool ambig; - //FileDef *fd=findFileDef(&inputNameDict,g_yyFileName,ambig); + //printf("addDefine %s %s\n",g_defName.data(),g_defArgsStr.data()); MemberDef *md=new MemberDef( g_yyFileName,g_yyLineNr, "#define",g_defName,g_defArgsStr,0, @@ -789,7 +788,7 @@ void addDefine() functionNameDict.insert(g_defName,mn); } mn->append(md); - if (g_yyFileDef) g_yyFileDef->insertMember(md,-1); + if (g_yyFileDef) g_yyFileDef->insertMember(md); //Define *d; //if ((d=defineDict[g_defName])==0) defineDict.insert(g_defName,newDefine()); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 86ff8c2..9ac69cf 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -46,20 +46,24 @@ static ListItemInfo listItemInfo[indentLevels]; static QCString formatBmkStr(const char *name) { QCString result=name; - int i=0; - char c; - while ((c=result.at(i))!=0) + if (!result.isEmpty()) { - switch(c) + char c; + char *p=result.data(); + while ((c=*p)) { - case '.': - case ':': - result.at(i)='_'; - break; - default: - break; + switch(c) + { + case '.': + // fall through + case ':': + *p='_'; + break; + default: + break; + } + p++; } - i++; } return result; } @@ -1146,18 +1150,16 @@ void RTFGenerator::endTitleHead(const char *fileName,const char *name) t << "}" << endl; // make an index entry - addToIndex(name,NULL); + addToIndex(name,0); - - if (fileName) + if (name) { - // doxygen expects different anchors for pdf and if "FULL PATHS" - writeAnchor(fileName,0); + writeAnchor(0,name); } - else + + if (Config::rtfHyperFlag && fileName) { - // make a bookmark for referencing - writeAnchor(0,name); + writeAnchor(fileName,0); } } } @@ -1193,8 +1195,11 @@ void RTFGenerator::startMemberDoc(const char *clname, const char *) { t << "{\\comment startMemberDoc}" << endl; - addToIndex(memname,clname); - addToIndex(clname,memname); + if (memname && memname[0]!='@') + { + addToIndex(memname,clname); + addToIndex(clname,memname); + } //t << Rtf_Style_Reset << Rtf_Style_ListBullet1; t << Rtf_Style_Reset << Rtf_Style_Heading4; //styleStack.push(Rtf_Style_Heading4); @@ -1352,7 +1357,7 @@ void RTFGenerator::startDescList() { t << "{\\comment (startDescList)}" << endl; t << "{"; - ///*if (!m_omitParagraph)*/ newParagraph(); + newParagraph(); } void RTFGenerator::endDescTitle() @@ -2027,11 +2032,11 @@ bool RTFGenerator::preProcessFileInplace(const char *path,const char *name) return TRUE; } -void RTFGenerator::startMemberGroupHeader() +void RTFGenerator::startMemberGroupHeader(bool hasHeader) { t << "{\\comment startMemberGroupHeader}" << endl; t << "{" << endl; - incrementIndentLevel(); + if (hasHeader) incrementIndentLevel(); t << Rtf_Style_Reset << Rtf_Style_GroupHeader; } @@ -2061,10 +2066,10 @@ void RTFGenerator::startMemberGroup() t << Rtf_Style_Reset << Rtf_BList_DepthStyle() << endl; } -void RTFGenerator::endMemberGroup(bool) +void RTFGenerator::endMemberGroup(bool hasHeader) { t << "{\\comment endMemberGroup}" << endl; - decrementIndentLevel(); + if (hasHeader) decrementIndentLevel(); t << "}"; } diff --git a/src/rtfgen.h b/src/rtfgen.h index cc7f54a..9245bb3 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -197,7 +197,7 @@ class RTFGenerator : public OutputGenerator void endInclDepGraph(DotInclDepGraph &); void writeGraphicalHierarchy(DotGfxHierarchyTable &) {} - void startMemberGroupHeader(); + void startMemberGroupHeader(bool); void endMemberGroupHeader(); void startMemberGroupDocs(); void endMemberGroupDocs(); diff --git a/src/scanner.l b/src/scanner.l index 056caef..5a55ea9 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1,4 +1,4 @@ -/****************************************************************************** +/***************************************************************************** * * * @@ -840,7 +840,7 @@ static QCString findAndCopyImage(const char *fileName,ImageTypes type) else { result=fileName; - if (result.left(5)!="http:") + if (result.left(5)!="http:" && result.left(6)!="https:") { warn(yyFileName,yyLineNr, "Warning: image file %s is not found in IMAGE_PATH: " @@ -1523,7 +1523,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") outDoc->docify(", "); } } -{CMD}"param"/{BN} { +(({B}*"\n"){2,}{B}*)?{CMD}"param"/{BN} { endArgumentList(); if (!inParamBlock) { @@ -1543,7 +1543,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") } BEGIN(DocParam); } -{CMD}"retval"/{BN} { +(({B}*"\n"){2,}{B}*)?{CMD}"retval"/{BN} { endArgumentList(); if (!inRetValBlock) { @@ -1563,7 +1563,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") } BEGIN(DocParam); } -{CMD}("exception"|"throw")s?/{BN} { +(({B}*"\n"){2,}{B}*)?{CMD}("exception"|"throw")s?/{BN} { endArgumentList(); if (!inExceptionBlock) { @@ -1602,7 +1602,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") outDoc->startDescTableData(); BEGIN(DocScan); } -{CMD}"section "{ID}"\n" { +{CMD}"section "{ID}"\n" { QCString secName=&yytext[9]; // skip "\section " secName=secName.left(secName.length()-1); // remove \n //printf("SectionName %s found\n",secName.data()); @@ -1624,7 +1624,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") outDoc->writeAnchor(sec->fileName,sec->label); } } -{CMD}"ref" { +{CMD}"ref" { BEGIN(DocRefName); } {CMD}"refitem" { @@ -1809,12 +1809,16 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") warn(yyFileName,yyLineNr,"Warning: \\endcode without
     or \\code "
         					       "in the documentation."); 
     					}
    -{SCOPEMASK}"("[a-z_A-Z0-9,:\<\> \t\*\&]+")"	{
    +					
    +{ID}"<"[^>\ \t\n]*">"("::"{ID})+"("?[a-z_A-Z0-9,:\<\> \t\*\&]*")"?	{
    +  					  generateRef(*outDoc,className,yytext,inSeeBlock);
    +  					}
    +{SCOPEMASK}"("[a-z_A-Z0-9,:\<\> \t\*\&]+")" {
    +  					  generateRef(*outDoc,className,yytext,inSeeBlock);
    +  					}
    +{SCOPEMASK}("()")?		{
       					  generateRef(*outDoc,className,yytext,inSeeBlock);
       					}
    -{SCOPEMASK}(("()")?)          	{ 
    -					  generateRef(*outDoc,className,yytext,inSeeBlock);
    -					} 
     ({SCOPEMASK}"::")?"operator()("[a-z_A-Z0-9,\<\> \t\*\&]*")"	{ 
     				          QCString oName=yytext;
     					  generateRef(*outDoc,className,
    @@ -1825,7 +1829,7 @@ DOCPARAM  ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"")
     					  generateRef(*outDoc,className,
     					              removeRedundantWhiteSpace(oName),inSeeBlock);
     					}
    -("http:"|"ftp:"|"file:"){URLMASK}	{ outDoc->writeHtmlLink(yytext,yytext); }
    +("http:"|"https:"|"ftp:"|"file:"){URLMASK}	{ outDoc->writeHtmlLink(yytext,yytext); }
     [a-zA-Z_0-9\.\-]+"@"[0-9a-z_A-Z\.\-]+	{ outDoc->writeMailLink(yytext); }
     {FILEMASK}			{
     					  generateFileRef(*outDoc,yytext);
    @@ -2292,7 +2296,13 @@ DOCPARAM  ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"")
     					  current->virt = Virtual;
     					  lineCount();
     					}
    -{B}*"inline"{BN}+		{ current->inLine = TRUE;
    +{B}*"inline"{BN}+		{ current->memSpec|=Entry::Inline;
    +                                          lineCount(); 
    +                                        }
    +{B}*"mutable"{BN}+		{ current->memSpec|=Entry::Mutable;
    +                                          lineCount(); 
    +                                        }
    +{B}*"explicit"{BN}+	{ current->memSpec|=Entry::Explicit;
                                               lineCount(); 
                                             }
     {B}*"import"{BN}+		{ // IDL import keyword
    @@ -3620,7 +3630,7 @@ DOCPARAM  ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"")
     					  if( *yytext == '{' )
     					  {
     					    if (current_root->section & Entry::COMPOUND_MASK)
    -					      previous->inLine = TRUE;
    +					      previous->memSpec = previous->memSpec | Entry::Inline;
     					    //addToBody(yytext);
     					    curlyCount=0;
     					    BEGIN( SkipCurly ) ;
    @@ -4618,6 +4628,12 @@ DOCPARAM  ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"")
     {CMD}"nosubgrouping"/[^a-z_A-Z0-9] {
                                               current->subGrouping = FALSE; 
                                             }
    +{CMD}"showinitializer"/[^a-z_A-Z0-9] {
    +					  current->initLines = 100000; // ON
    +  					}
    +{CMD}"hideinitializer"/[^a-z_A-Z0-9] {
    +					  current->initLines = 0; // OFF
    +  					}
     {ID}				{
       					  current->groups->append(
     					    new QCString(yytext)
    diff --git a/src/tag.l b/src/tag.l
    index 7b37851..58f7714 100644
    --- a/src/tag.l
    +++ b/src/tag.l
    @@ -119,21 +119,21 @@ static void addMember(const char *name,const char *anchor,const char *args)
         if (cd) // member of a class
         {
           md->setMemberClass(cd);
    -      cd->insertMember(md,-1); /* TODO: store group info */
    +      cd->insertMember(md); 
           mnd=&memberNameDict;
           mnl=&memberNameList;
         }
         else if (nd) // member of a namespace
         {
           md->setNamespace(nd);
    -      nd->insertMember(md,-1); /* TODO: store group info */
    +      nd->insertMember(md); 
           mnd=&functionNameDict;
           mnl=&functionNameList;
         }
         else // member of a file
         {
           md->setFileDef(fd);
    -      fd->insertMember(md,-1); /* TODO: store group info */
    +      fd->insertMember(md);
           mnd=&functionNameDict;
           mnl=&functionNameList;
         }
    diff --git a/src/util.cpp b/src/util.cpp
    index bc5067f..c0246fa 100644
    --- a/src/util.cpp
    +++ b/src/util.cpp
    @@ -463,6 +463,10 @@ QCString argListToString(ArgumentList *al)
         {
           result+= a->type;
         }
    +    if (!a->defval.isEmpty())
    +    {
    +      result+="="+a->defval;
    +    }
         a = al->next();
         if (a) result+=","; 
       }
    @@ -1062,6 +1066,7 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl,
         stripIrrelevantConstVolatile(srcAType);
         stripIrrelevantConstVolatile(dstAType);
     
    +    if (srcA->array!=dstA->array) return FALSE;
         if (srcAType!=dstAType) // check if the argument only differs on name 
         {
           //printf("scope=`%s': `%s' <=> `%s'\n",className.data(),srcAType.data(),dstAType.data());
    @@ -1256,8 +1261,6 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl)
     {
       //printf("mergeArguments `%s', `%s'\n",
       //    argListToString(srcAl).data(),argListToString(dstAl).data());
    -  //printArgList(srcAl);printf(" <=> ");
    -  //printArgList(dstAl);printf("\n");
     
       if (srcAl==0 || dstAl==0 || srcAl->count()!=dstAl->count())
       {
    @@ -1795,6 +1798,15 @@ bool generateRef(OutputList &ol,const char *scName,
       } 
       //printf("scope=`%s' name=`%s' arg=`%s' linkText=`%s'\n",
       //       scopeStr.data(),nameStr.data(),argsStr.data(),linkText.data());
    +  
    +  // strip template specifier
    +  // TODO: match against the correct partial template instantiation 
    +  int templPos=nameStr.find('<');
    +  if (templPos!=-1 && nameStr.find("operator")==-1)
    +  {
    +    int endTemplPos=nameStr.findRev('>');
    +    nameStr=nameStr.left(templPos)+nameStr.right(nameStr.length()-endTemplPos-1);
    +  }
     
       MemberDef *md    = 0;
       ClassDef *cd     = 0;
    -- 
    cgit v0.12