From bedb86023002aa3985c914d330f54314d211bdc0 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 6 Aug 2005 11:48:27 +0000 Subject: Release-1.4.4-20050806 --- INSTALL | 2 +- README | 2 +- addon/doxmlparser/include/doxmlintf.h | 15 +- addon/doxmlparser/src/compoundhandler.cpp | 76 ++++++---- addon/doxmlparser/src/compoundhandler.h | 95 +++++++------ addon/doxmlparser/src/dochandler.cpp | 49 +++++-- addon/doxmlparser/src/dochandler.h | 5 +- addon/doxmlparser/src/doxmlintf.h | 15 +- addon/doxmlparser/src/memberhandler.cpp | 4 +- addon/doxmlparser/src/memberhandler.h | 129 ++++++----------- addon/doxmlparser/src/paramhandler.cpp | 2 +- addon/doxmlparser/src/paramhandler.h | 19 ++- addon/doxmlparser/src/sectionhandler.cpp | 15 ++ addon/doxmlparser/src/sectionhandler.h | 19 ++- doc/arch.doc | 6 +- doc/config.doc | 59 +++++--- doc/docblocks.doc | 49 ++++++- doc/features.doc | 12 +- doc/grouping.doc | 7 +- doc/install.doc | 11 +- doc/language.doc | 4 +- doc/lists.doc | 11 +- doc/starting.doc | 110 +++++++++++---- doc/translator_report.txt | 19 +-- doc/trouble.doc | 4 + examples/Makefile.in | 13 +- examples/Makefile.win.in | 13 +- examples/docstring.cfg | 9 ++ examples/docstring.py | 26 ++++ examples/example.tag | 2 +- examples/pyexample.cfg | 9 ++ examples/pyexample.py | 29 ++++ examples/templ.cpp | 2 +- src/classdef.cpp | 3 +- src/commentcnv.l | 8 +- src/commentscan.l | 10 +- src/compound.xsd | 1 + src/compound_xsd.h | 1 + src/config.l | 32 +++-- src/definition.cpp | 6 +- src/definition.h | 5 + src/docparser.cpp | 19 ++- src/docparser.h | 6 + src/dot.cpp | 24 +++- src/doxygen.cpp | 223 +++++++++++++++++++++++------- src/entry.cpp | 72 +--------- src/entry.h | 1 + src/htmldocvisitor.cpp | 4 +- src/index.cpp | 30 ++-- src/latexdocvisitor.cpp | 4 +- src/mandocvisitor.cpp | 4 +- src/memberdef.cpp | 29 +++- src/outputlist.cpp | 2 +- src/pycode.l | 4 +- src/pyscanner.l | 220 ++++++++++++++++++++--------- src/rtfdocvisitor.cpp | 4 +- src/scanner.l | 23 ++- src/translator_tw.h | 68 ++++++++- src/util.cpp | 59 ++++---- src/xmldocvisitor.cpp | 4 +- src/xmlgen.cpp | 2 +- 61 files changed, 1156 insertions(+), 554 deletions(-) create mode 100644 examples/docstring.cfg create mode 100644 examples/docstring.py create mode 100644 examples/pyexample.cfg create mode 100644 examples/pyexample.py diff --git a/INSTALL b/INSTALL index 20d3dfb..ab1c722 100644 --- a/INSTALL +++ b/INSTALL @@ -4,4 +4,4 @@ Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (20 July 2005) +Dimitri van Heesch (06 August 2005) diff --git a/README b/README index 3060193..b45591c 100644 --- a/README +++ b/README @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (20 July 2005) +Dimitri van Heesch (dimitri@stack.nl) (06 August 2005) diff --git a/addon/doxmlparser/include/doxmlintf.h b/addon/doxmlparser/include/doxmlintf.h index 52db174..79dc763 100644 --- a/addon/doxmlparser/include/doxmlintf.h +++ b/addon/doxmlparser/include/doxmlintf.h @@ -486,6 +486,7 @@ class IDocRoot : public IDoc { public: virtual IDocIterator *contents() const = 0; + virtual IDocInternal *internal() const = 0; }; class IDocIterator @@ -601,6 +602,7 @@ class IMember virtual ILinkedTextIterator *exceptions() const = 0; virtual IMemberReferenceIterator *references() const = 0; virtual IMemberReferenceIterator *referencedBy() const = 0; + virtual const IString *bodyFile() const = 0; virtual int bodyStart() const = 0; virtual int bodyEnd() const = 0; virtual const IString * definitionFile() const = 0; @@ -730,6 +732,7 @@ class ISection Signals, //!< Qt Signals DCOPFuncs, //!< KDE-DCOP interface functions Properties, //!< IDL properties + Events, //!< C# events PubStatFuncs, //!< Public static member functions PubStatAttribs, //!< Public static attributes ProTypes, //!< Protected member typedefs @@ -764,6 +767,11 @@ class ISection /*! Returns what kind of section this is */ virtual SectionKind kind() const = 0; + + /*! Returns the description attached to this section (for user defined + * sections, also known as member groups). + */ + virtual IDocRoot *description() const = 0; /*! Returns an iterator for the members of this section */ virtual IMemberIterator *members() const = 0; @@ -834,9 +842,10 @@ class ICompound public: /*! Represents the kind of compounds recognised by doxygen. */ enum CompoundKind { Invalid=0, - Class, Struct, Union, Interface, Exception, - Namespace, File, Group, Page + Class, Struct, Union, Interface, Protocol, Category, + Exception, File, Namespace, Group, Page, Example, Dir }; + /*! Returns the name of this compound */ virtual const IString * name() const = 0; @@ -907,6 +916,7 @@ class IRelatedCompound virtual ICompound *compound() const = 0; virtual Protection protection() const = 0; virtual Kind kind() const = 0; + virtual const IString *name() const = 0; }; @@ -934,6 +944,7 @@ class IClass : public ICompound virtual IParamIterator *templateParameters() const = 0; virtual const IString *locationFile() const = 0; virtual int locationLine() const = 0; + virtual const IString *locationBodyFile() const = 0; virtual int locationBodyStartLine() const = 0; virtual int locationBodyEndLine() const = 0; diff --git a/addon/doxmlparser/src/compoundhandler.cpp b/addon/doxmlparser/src/compoundhandler.cpp index 411f114..5bdf160 100644 --- a/addon/doxmlparser/src/compoundhandler.cpp +++ b/addon/doxmlparser/src/compoundhandler.cpp @@ -130,19 +130,19 @@ class CompoundTypeMap CompoundTypeMap() { m_map.setAutoDelete(TRUE); - m_map.insert("class",new int(ICompound::Class)); - m_map.insert("struct",new int(ICompound::Struct)); - m_map.insert("union",new int(ICompound::Union)); + m_map.insert("class", new int(ICompound::Class)); + m_map.insert("struct", new int(ICompound::Struct)); + m_map.insert("union", new int(ICompound::Union)); m_map.insert("interface",new int(ICompound::Interface)); - m_map.insert("protocol",new int(ICompound::Interface)); - m_map.insert("category",new int(ICompound::Interface)); + m_map.insert("protocol", new int(ICompound::Protocol)); + m_map.insert("category", new int(ICompound::Category)); m_map.insert("exception",new int(ICompound::Exception)); - m_map.insert("file",new int(ICompound::File)); + m_map.insert("file", new int(ICompound::File)); m_map.insert("namespace",new int(ICompound::Namespace)); - m_map.insert("group",new int(ICompound::Group)); - m_map.insert("page",new int(ICompound::Page)); - m_map.insert("example",new int(ICompound::Page)); - m_map.insert("dir",new int(ICompound::Page)); + m_map.insert("group", new int(ICompound::Group)); + m_map.insert("page", new int(ICompound::Page)); + m_map.insert("example", new int(ICompound::Example)); + m_map.insert("dir", new int(ICompound::Dir)); } virtual ~CompoundTypeMap() { @@ -176,18 +176,27 @@ void compoundhandler_exit() //---------------------------------------------------------------------------- CompoundHandler::CompoundHandler(const QString &xmlDir) - : m_brief(0), m_detailed(0), m_programListing(0), - m_xmlDir(xmlDir), m_refCount(1), m_memberDict(257), m_memberNameDict(257), - m_mainHandler(0), m_inheritanceGraph(0), m_collaborationGraph(0), - m_includeDependencyGraph(0), m_includedByDependencyGraph(0), m_templateParamList(0), - m_titleHandler(0), m_members(0) + : m_titleHandler(0), + m_includeDependencyGraph(0), + m_includedByDependencyGraph(0), + m_templateParamList(0), + m_brief(0), + m_detailed(0), + m_inheritanceGraph(0), + m_collaborationGraph(0), + m_programListing(0), + m_members(0), + m_xmlDir(xmlDir), + m_refCount(1), + m_memberDict(257), + m_memberNameDict(257), + m_mainHandler(0) { m_superClasses.setAutoDelete(TRUE); m_subClasses.setAutoDelete(TRUE); m_sections.setAutoDelete(TRUE); m_memberNameDict.setAutoDelete(TRUE); m_innerCompounds.setAutoDelete(TRUE); - m_params.setAutoDelete(TRUE); m_includes.setAutoDelete(TRUE); m_includedBy.setAutoDelete(TRUE); @@ -202,11 +211,11 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) addStartHandler("title",this,&CompoundHandler::startTitle); - addStartHandler("basecompoundref",this,&CompoundHandler::addSuperClass); - addEndHandler("basecompoundref"); + addStartHandler("basecompoundref",this,&CompoundHandler::startSuperClass); + addEndHandler("basecompoundref",this,&CompoundHandler::endSuperClass); - addStartHandler("derivedcompoundref",this,&CompoundHandler::addSubClass); - addEndHandler("derivedcompoundref"); + addStartHandler("derivedcompoundref",this,&CompoundHandler::startSubClass); + addEndHandler("derivedcompoundref",this,&CompoundHandler::endSubClass); addStartHandler("includes",this,&CompoundHandler::startIncludes); addStartHandler("includedby",this,&CompoundHandler::startIncludedBy); @@ -312,9 +321,9 @@ void CompoundHandler::startIncludedBy(const QXmlAttributes& attrib) void CompoundHandler::startCompound(const QXmlAttributes& attrib) { - m_id = attrib.value("id"); + m_id = attrib.value("id"); m_kindString = attrib.value("kind"); - m_kind = s_typeMap->map(m_kindString); + m_kind = s_typeMap->map(m_kindString); m_protection = attrib.value("prot"); debug(2,"startCompound(id=`%s' type=`%s')\n",m_id.data(),m_kindString.data()); } @@ -326,10 +335,11 @@ void CompoundHandler::endCompound() void CompoundHandler::startLocation(const QXmlAttributes& attrib) { - m_defFile = attrib.value("file"); - m_defLine = attrib.value("line").toInt(); + m_defFile = attrib.value("file"); + m_defLine = attrib.value("line").toInt(); + m_defBodyFile = attrib.value("bodyfile"); m_defBodyStart = attrib.value("bodystart").toInt(); - m_defBodyEnd = attrib.value("bodyend").toInt(); + m_defBodyEnd = attrib.value("bodyend").toInt(); } void CompoundHandler::endCompoundName() @@ -380,7 +390,7 @@ void CompoundHandler::startListOfAllMembers(const QXmlAttributes& attrib) m_members->startListOfAllMembers(attrib); } -void CompoundHandler::addSuperClass(const QXmlAttributes& attrib) +void CompoundHandler::startSuperClass(const QXmlAttributes& attrib) { IRelatedCompound::Protection prot = IRelatedCompound::Public; QString protString = attrib.value("prot"); @@ -407,9 +417,15 @@ void CompoundHandler::addSuperClass(const QXmlAttributes& attrib) protString.data(), kindString.data()); m_superClasses.append(sc); + m_curString = ""; +} + +void CompoundHandler::endSuperClass() +{ + m_superClasses.getLast()->setName(m_curString); } -void CompoundHandler::addSubClass(const QXmlAttributes& attrib) +void CompoundHandler::startSubClass(const QXmlAttributes& attrib) { IRelatedCompound::Protection prot = IRelatedCompound::Public; QString protString = attrib.value("prot"); @@ -431,6 +447,12 @@ void CompoundHandler::addSubClass(const QXmlAttributes& attrib) protString.data(), kindString.data()); m_subClasses.append(sc); + m_curString = ""; +} + +void CompoundHandler::endSubClass() +{ + m_subClasses.getLast()->setName(m_curString); } void CompoundHandler::startTitle(const QXmlAttributes& attrib) diff --git a/addon/doxmlparser/src/compoundhandler.h b/addon/doxmlparser/src/compoundhandler.h index 59ad7ce..ad8e2c8 100644 --- a/addon/doxmlparser/src/compoundhandler.h +++ b/addon/doxmlparser/src/compoundhandler.h @@ -36,7 +36,7 @@ class TemplateParamListHandler; class TitleHandler; class ListOfAllMembersHandler; -class IncludeHandler : public IInclude, public BaseHandler\ +class IncludeHandler : public IInclude, public BaseHandler { public: IncludeHandler(IBaseHandler *parent,const char *endtag); @@ -55,9 +55,9 @@ class IncludeHandler : public IInclude, public BaseHandler\ private: IBaseHandler *m_parent; - StringImpl m_name; - StringImpl m_refId; - bool m_isLocal; + StringImpl m_name; // element's content + StringImpl m_refId; // refid + bool m_isLocal; // local }; class IncludeIterator : public BaseIterator @@ -78,16 +78,19 @@ class RelatedCompound : public IRelatedCompound ) : m_parent(parent), m_id(id), m_protection(prot), m_kind(kind) {} virtual ~RelatedCompound() {} + void setName(const QString &str) { m_name = str; } virtual ICompound *compound() const; virtual Protection protection() const { return m_protection; } virtual Kind kind() const { return m_kind; } + virtual const IString *name() const { return &m_name; } private: CompoundHandler *m_parent; - QString m_id; - Protection m_protection; - Kind m_kind; + QString m_id; // refid + Protection m_protection; // prot + Kind m_kind; // virt + StringImpl m_name; // element's content }; class RelatedCompoundIterator : public BaseIterator @@ -114,8 +117,10 @@ class CompoundHandler : public IClass, public: virtual void startSection(const QXmlAttributes& attrib); virtual void startCompound(const QXmlAttributes& attrib); - virtual void addSuperClass(const QXmlAttributes& attrib); - virtual void addSubClass(const QXmlAttributes& attrib); + virtual void startSuperClass(const QXmlAttributes& attrib); + virtual void endSuperClass(); + virtual void startSubClass(const QXmlAttributes& attrib); + virtual void endSubClass(); virtual void endCompound(); virtual void endCompoundName(); virtual void startBriefDesc(const QXmlAttributes& attrib); @@ -168,6 +173,7 @@ class CompoundHandler : public IClass, ICompoundIterator *nestedGroup() const; const IString *locationFile() const { return &m_defFile; } int locationLine() const { return m_defLine; } + const IString *locationBodyFile() const { return &m_defBodyFile; } int locationBodyStartLine() const { return m_defBodyStart; } int locationBodyEndLine() const { return m_defBodyEnd; } IMemberReferenceIterator *members() const; @@ -183,38 +189,45 @@ class CompoundHandler : public IClass, const IDocTitle *title() const; private: - QList m_superClasses; - QList m_subClasses; - QList m_sections; - QList m_params; - QList m_includes; - QList m_includedBy; - DocHandler* m_brief; - DocHandler* m_detailed; - ProgramListingHandler* m_programListing; - StringImpl m_id; - StringImpl m_protection; - StringImpl m_kindString; - CompoundKind m_kind; - StringImpl m_name; - StringImpl m_defFile; - int m_defLine; - int m_defBodyStart; - int m_defBodyEnd; - QString m_xmlDir; - int m_refCount; - QDict m_memberDict; - QDict > m_memberNameDict; - MainHandler* m_mainHandler; - GraphHandler* m_inheritanceGraph; - GraphHandler* m_collaborationGraph; - GraphHandler* m_includeDependencyGraph; - GraphHandler* m_includedByDependencyGraph; - QList m_innerCompounds; - ProgramListingHandler* m_source; - TemplateParamListHandler* m_templateParamList; - TitleHandler* m_titleHandler; - ListOfAllMembersHandler* m_members; + // XML elements: + // ------------- + StringImpl m_name; // compoundname + TitleHandler* m_titleHandler; // title + QList m_subClasses; // basecompoundref + QList m_superClasses; // derivedcompoundref + QList m_includes; // includes + QList m_includedBy; // includedBy + GraphHandler* m_includeDependencyGraph; // incdepgraph + GraphHandler* m_includedByDependencyGraph; // invincdepgraph + QList m_innerCompounds; // innerdir/innerfile/innerclass/innernamespace/innergroup + TemplateParamListHandler* m_templateParamList; // templateparamlist + QList m_sections; // sectiondef + DocHandler* m_brief; // briefdescription + DocHandler* m_detailed; // detaileddescription + GraphHandler* m_inheritanceGraph; // inheritancegraph + GraphHandler* m_collaborationGraph; // collaborationgraph + ProgramListingHandler* m_programListing; // programlisting + // location + StringImpl m_defFile; // - file + int m_defLine; // - line + StringImpl m_defBodyFile; // - bodyfile + int m_defBodyStart; // - bodystart + int m_defBodyEnd; // - bodyend + ListOfAllMembersHandler* m_members; // listofallmember + + // XML attributes: + // --------------- + StringImpl m_id; // id + CompoundKind m_kind; // kind + StringImpl m_kindString; // kind as a string + StringImpl m_protection; // prot + + // local variables + QString m_xmlDir; // directory where the info is found + int m_refCount; // object reference counter + QDict m_memberDict; // id->member lookup + QDict > m_memberNameDict; // name->memberlist lookup + MainHandler* m_mainHandler; // parent object }; void compoundhandler_init(); diff --git a/addon/doxmlparser/src/dochandler.cpp b/addon/doxmlparser/src/dochandler.cpp index 11af311..ba562ef 100644 --- a/addon/doxmlparser/src/dochandler.cpp +++ b/addon/doxmlparser/src/dochandler.cpp @@ -1679,28 +1679,37 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent) m_children.setAutoDelete(TRUE); m_markupHandler = new MarkupHandler(m_children,m_curString); + + // preformatted setFallBackHandler(m_markupHandler); addEndHandler("para",this,&ParagraphHandler::endParagraph); - addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList); + addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak); + addStartHandler("hruler",this,&ParagraphHandler::startHRuler); + addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing); + addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim); + addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry); addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList); - addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList); + addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList); addStartHandler("simplesect",this,&ParagraphHandler::startSimpleSect); - addStartHandler("ref",this,&ParagraphHandler::startRef); + // TODO: title addStartHandler("variablelist",this,&ParagraphHandler::startVariableList); - addStartHandler("hruler",this,&ParagraphHandler::startHRuler); - addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak); + addStartHandler("table",this,&ParagraphHandler::startTable); + // TODO: heading + addStartHandler("image",this,&ParagraphHandler::startImage); + addStartHandler("dotfile",this,&ParagraphHandler::startDotFile); + addStartHandler("toclist",this,&ParagraphHandler::startTocList); + // TODO: language??? + addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList); + // TODO: xrefsect + addStartHandler("copydoc",this,&ParagraphHandler::startCopyDoc); + + addStartHandler("ref",this,&ParagraphHandler::startRef); addStartHandler("ulink",this,&ParagraphHandler::startULink); addStartHandler("email",this,&ParagraphHandler::startEMail); addStartHandler("link",this,&ParagraphHandler::startLink); - addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing); addStartHandler("formula",this,&ParagraphHandler::startFormula); - addStartHandler("image",this,&ParagraphHandler::startImage); - addStartHandler("dotfile",this,&ParagraphHandler::startDotFile); - addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry); - addStartHandler("table",this,&ParagraphHandler::startTable); - addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim); addStartHandler("latexonly",this,&ParagraphHandler::startHtmlOnly); addStartHandler("htmlonly",this,&ParagraphHandler::startLatexOnly); addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut); @@ -1714,8 +1723,6 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent) addStartHandler("nbsp",this,&ParagraphHandler::startNbsp); addStartHandler("copy",this,&ParagraphHandler::startCopy); addStartHandler("anchor",this,&ParagraphHandler::startAnchor); - addStartHandler("copydoc",this,&ParagraphHandler::startCopyDoc); - addStartHandler("toclist",this,&ParagraphHandler::startTocList); } ParagraphHandler::~ParagraphHandler() @@ -2170,12 +2177,13 @@ DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent) addEndHandler("briefdescription",this,&DocHandler::endDoc); addEndHandler("detaileddescription",this,&DocHandler::endDoc); addEndHandler("inbodydescription",this,&DocHandler::endDoc); - addEndHandler("internal"); + //addEndHandler("internal"); // TODO: implement this as a section + addStartHandler("internal",this,&DocHandler::startInternal); addStartHandler("para",this,&DocHandler::startParagraph); addStartHandler("sect1",this,&DocHandler::startSect1); addStartHandler("title",this,&DocHandler::startTitle); - addStartHandler("internal"); + //addStartHandler("internal"); } DocHandler::~DocHandler() @@ -2215,8 +2223,19 @@ void DocHandler::startTitle(const QXmlAttributes& attrib) m_children.append(titleHandler); } +void DocHandler::startInternal(const QXmlAttributes& attrib) +{ + m_internal = new DocInternalHandler(this,1); + m_internal->startInternal(attrib); +} + IDocIterator *DocHandler::contents() const { return new DocIterator(*this); } +IDocInternal *DocHandler::internal() const +{ + return m_internal; +} + diff --git a/addon/doxmlparser/src/dochandler.h b/addon/doxmlparser/src/dochandler.h index 25fed50..922624d 100644 --- a/addon/doxmlparser/src/dochandler.h +++ b/addon/doxmlparser/src/dochandler.h @@ -1311,7 +1311,7 @@ class DocInternalSubIterator : public BaseIteratorVia { friend class DocIterator; @@ -1321,6 +1321,7 @@ class DocHandler : public DocRootImpl, public BaseHandler virtual void startParagraph(const QXmlAttributes& attrib); virtual void startSect1(const QXmlAttributes& attrib); virtual void startTitle(const QXmlAttributes& attrib); + virtual void startInternal(const QXmlAttributes& attrib); DocHandler(IBaseHandler *parent); virtual ~DocHandler(); @@ -1328,10 +1329,12 @@ class DocHandler : public DocRootImpl, public BaseHandler // IDocRoot virtual Kind kind() const { return DocImpl::Root; } virtual IDocIterator *contents() const; + virtual IDocInternal *internal() const; private: IBaseHandler *m_parent; QList m_children; + DocInternalHandler *m_internal; }; class DocIterator : public BaseIteratorVia diff --git a/addon/doxmlparser/src/doxmlintf.h b/addon/doxmlparser/src/doxmlintf.h index 52db174..79dc763 100644 --- a/addon/doxmlparser/src/doxmlintf.h +++ b/addon/doxmlparser/src/doxmlintf.h @@ -486,6 +486,7 @@ class IDocRoot : public IDoc { public: virtual IDocIterator *contents() const = 0; + virtual IDocInternal *internal() const = 0; }; class IDocIterator @@ -601,6 +602,7 @@ class IMember virtual ILinkedTextIterator *exceptions() const = 0; virtual IMemberReferenceIterator *references() const = 0; virtual IMemberReferenceIterator *referencedBy() const = 0; + virtual const IString *bodyFile() const = 0; virtual int bodyStart() const = 0; virtual int bodyEnd() const = 0; virtual const IString * definitionFile() const = 0; @@ -730,6 +732,7 @@ class ISection Signals, //!< Qt Signals DCOPFuncs, //!< KDE-DCOP interface functions Properties, //!< IDL properties + Events, //!< C# events PubStatFuncs, //!< Public static member functions PubStatAttribs, //!< Public static attributes ProTypes, //!< Protected member typedefs @@ -764,6 +767,11 @@ class ISection /*! Returns what kind of section this is */ virtual SectionKind kind() const = 0; + + /*! Returns the description attached to this section (for user defined + * sections, also known as member groups). + */ + virtual IDocRoot *description() const = 0; /*! Returns an iterator for the members of this section */ virtual IMemberIterator *members() const = 0; @@ -834,9 +842,10 @@ class ICompound public: /*! Represents the kind of compounds recognised by doxygen. */ enum CompoundKind { Invalid=0, - Class, Struct, Union, Interface, Exception, - Namespace, File, Group, Page + Class, Struct, Union, Interface, Protocol, Category, + Exception, File, Namespace, Group, Page, Example, Dir }; + /*! Returns the name of this compound */ virtual const IString * name() const = 0; @@ -907,6 +916,7 @@ class IRelatedCompound virtual ICompound *compound() const = 0; virtual Protection protection() const = 0; virtual Kind kind() const = 0; + virtual const IString *name() const = 0; }; @@ -934,6 +944,7 @@ class IClass : public ICompound virtual IParamIterator *templateParameters() const = 0; virtual const IString *locationFile() const = 0; virtual int locationLine() const = 0; + virtual const IString *locationBodyFile() const = 0; virtual int locationBodyStartLine() const = 0; virtual int locationBodyEndLine() const = 0; diff --git a/addon/doxmlparser/src/memberhandler.cpp b/addon/doxmlparser/src/memberhandler.cpp index fe0f5ac..74d1347 100644 --- a/addon/doxmlparser/src/memberhandler.cpp +++ b/addon/doxmlparser/src/memberhandler.cpp @@ -154,7 +154,8 @@ void EnumValueHandler::startDetailedDesc(const QXmlAttributes& attrib) //------------------------------------------------------------------------------ MemberHandler::MemberHandler(IBaseHandler *parent) - : m_parent(parent), m_compound(0), m_brief(0), m_detailed(0), m_inbody(0) + : m_brief(0), m_detailed(0), m_inbody(0), + m_compound(0), m_section(0), m_parent(parent) { //printf("MemberHandler::MemberHandler() %p\n",this); addEndHandler("memberdef",this,&MemberHandler::endMember); @@ -310,6 +311,7 @@ void MemberHandler::startInbodyDesc(const QXmlAttributes& attrib) void MemberHandler::startLocation(const QXmlAttributes& attrib) { m_defFile = attrib.value("file"); + m_bodyFile = attrib.value("bodyfile"); QCString s; s = attrib.value("line"); if (!s.isEmpty()) m_defLine=s.toInt(); diff --git a/addon/doxmlparser/src/memberhandler.h b/addon/doxmlparser/src/memberhandler.h index 750c5e3..19eacbd 100644 --- a/addon/doxmlparser/src/memberhandler.h +++ b/addon/doxmlparser/src/memberhandler.h @@ -61,53 +61,6 @@ class MemberReferenceIterator : public BaseIterator(list) {} }; - -#if 0 -class EnumValueHandler : public IEnumValue, public BaseHandler -{ - public: - virtual void startName(const QXmlAttributes& attrib); - virtual void endName(); - virtual void startInitializer(const QXmlAttributes& attrib); - virtual void endInitializer(); - virtual void startEnumValue(const QXmlAttributes& attrib); - virtual void endEnumValue(); - virtual void startBriefDesc(const QXmlAttributes& attrib); - virtual void startDetailedDesc(const QXmlAttributes& attrib); - - // IEnumValue - virtual const IString *name() const { return &m_name; } - virtual ILinkedTextIterator *initializer() const - { return new LinkedTextIterator(m_initializer); } - - void setName(const QString &name) { m_name=name; } - - virtual ~EnumValueHandler(); - EnumValueHandler(IBaseHandler *parent); - - virtual IDocRoot *briefDescription() const - { return m_brief; } - virtual IDocRoot *detailedDescription() const - { return m_detailed; } - - private: - StringImpl m_name; - QList m_initializer; - IBaseHandler *m_parent; - DocHandler *m_brief; - DocHandler *m_detailed; - LinkedTextHandler *m_linkedTextHandler; -}; - -class EnumValueIterator : public BaseIterator -{ - public: - EnumValueIterator(const QList &list) : - BaseIterator(list) {} -}; -#endif - - class MemberHandler : public IDefine, public IProperty, public IVariable, @@ -206,6 +159,8 @@ class MemberHandler : public IDefine, virtual IMemberReferenceIterator *referencedBy() const; virtual ILinkedTextIterator *initializer() const; virtual ILinkedTextIterator *exceptions() const; + virtual const IString *bodyFile() const + { return &m_bodyFile; } virtual int bodyStart() const { return m_bodyStart; } virtual int bodyEnd() const @@ -229,48 +184,56 @@ class MemberHandler : public IDefine, void setSectionHandler(SectionHandler *s); private: - IBaseHandler *m_parent; + // XML elements: + // ----------------- + QList m_templateParams; // templateparamlist + QList m_type; // type + StringImpl m_definition; // definition + StringImpl m_argsstring; // argsstring + StringImpl m_name; // name + StringImpl m_read; // read + StringImpl m_write; // write + MemberReference *m_reimplements; // reimplements + QList m_reimplementedBy; // reimplementedby + QList m_params; // param + QList m_enumValues; // enumvalue + QList m_initializer; // initializer + QList m_exception; // exceptions + DocHandler *m_brief; // briefdescription + DocHandler *m_detailed; // detaileddescription + DocHandler *m_inbody; // inbodydescription + // location + StringImpl m_defFile; // - file + int m_defLine; // - line + StringImpl m_bodyFile; // - bodyfile + int m_bodyStart; // - bodystart + int m_bodyEnd; // - bodyend + QList m_references; // references + QList m_referencedBy; // referencedby + + // XML attributes: + // --------------- + MemberKind m_kind; // kind + StringImpl m_kindString; // kind as a string + StringImpl m_id; // id + StringImpl m_protection; // prot + bool m_isStatic; // static + bool m_isConst; // const + bool m_isExplicit; // explicit + bool m_isInline; // inline + StringImpl m_virtualness; // virt + bool m_isVolatile; // volatile + bool m_isMutable; // mutable + bool m_isReadable; // readable + bool m_isWritable; // writable + CompoundHandler *m_compound; SectionHandler *m_section; - MemberKind m_kind; - StringImpl m_kindString; - StringImpl m_id; - StringImpl m_protection; - StringImpl m_virtualness; StringImpl m_typeString; - QList m_type; - QList m_initializer; - QList m_exception; - StringImpl m_name; - StringImpl m_read; - StringImpl m_write; - StringImpl m_definition; - StringImpl m_argsstring; - DocHandler *m_brief; - DocHandler *m_detailed; - DocHandler *m_inbody; - QList m_params; - QList m_templateParams; - QList m_references; - QList m_referencedBy; - MemberReference *m_reimplements; - QList m_reimplementedBy; - StringImpl m_defFile; - int m_defLine; - int m_bodyStart; - int m_bodyEnd; - bool m_isConst; - bool m_isVolatile; LinkedTextHandler *m_linkedTextHandler; - QList m_enumValues; bool m_insideTemplateParamList; bool m_hasTemplateParamList; - bool m_isStatic; - bool m_isExplicit; - bool m_isInline; - bool m_isMutable; - bool m_isReadable; - bool m_isWritable; + IBaseHandler *m_parent; }; class MemberIterator : public BaseIteratorVia virtual IDocRoot *briefDescription() const; private: + + // XML elements: + // ------------- + QList m_type; // type + StringImpl m_declName; // declname + StringImpl m_defName; // defname + StringImpl m_array; // array + QList m_defVal; // defval + DocHandler *m_brief; // briefdescription + + StringImpl m_attrib; // TODO: not yet in XML output + IBaseHandler *m_parent; - DocHandler *m_brief; - QList m_type; - StringImpl m_declName; - StringImpl m_defName; - StringImpl m_attrib; - StringImpl m_array; - QList m_defVal; LinkedTextHandler *m_linkedTextHandler; }; diff --git a/addon/doxmlparser/src/sectionhandler.cpp b/addon/doxmlparser/src/sectionhandler.cpp index 18d6b19..973d990 100644 --- a/addon/doxmlparser/src/sectionhandler.cpp +++ b/addon/doxmlparser/src/sectionhandler.cpp @@ -17,6 +17,7 @@ #include "compoundhandler.h" #include "sectionhandler.h" #include "memberhandler.h" +#include "dochandler.h" #include "debug.h" class SectionTypeMap @@ -33,6 +34,7 @@ class SectionTypeMap m_map.insert("signal",new int(ISection::Signals)); m_map.insert("dcop-func",new int(ISection::DCOPFuncs)); m_map.insert("property",new int(ISection::Properties)); + m_map.insert("event",new int(ISection::Events)); m_map.insert("public-static-func",new int(ISection::PubStatFuncs)); m_map.insert("public-static-attrib",new int(ISection::PubStatAttribs)); m_map.insert("protected-type",new int(ISection::ProTypes)); @@ -95,6 +97,7 @@ SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent) addStartHandler("memberdef",this,&SectionHandler::startMember); addStartHandler("header",this,&SectionHandler::startHeader); addEndHandler("header",this,&SectionHandler::endHeader); + addStartHandler("description",this,&SectionHandler::startDescription); } SectionHandler::~SectionHandler() @@ -110,6 +113,13 @@ void SectionHandler::startSection(const QXmlAttributes& attrib) debug(2,"section kind=`%s'\n",m_kindString.data()); } +void SectionHandler::startDescription(const QXmlAttributes& attrib) +{ + DocHandler *docHandler = new DocHandler(this); + docHandler->startDoc(attrib); + m_description = docHandler; +} + void SectionHandler::endSection() { m_parent->setDelegate(0); @@ -146,6 +156,11 @@ void SectionHandler::initialize(CompoundHandler *ch) } } +IDocRoot *SectionHandler::description() const +{ + return m_description; +} + IMemberIterator *SectionHandler::members() const { return new MemberIterator(m_members); diff --git a/addon/doxmlparser/src/sectionhandler.h b/addon/doxmlparser/src/sectionhandler.h index 3be4ee8..46a072f 100644 --- a/addon/doxmlparser/src/sectionhandler.h +++ b/addon/doxmlparser/src/sectionhandler.h @@ -23,8 +23,6 @@ #include "basehandler.h" -class MainHandler; - class SectionIterator : public BaseIterator { @@ -40,6 +38,7 @@ class SectionHandler : public IUserDefined, public BaseHandler virtual void startMember(const QXmlAttributes& attrib); virtual void startHeader(const QXmlAttributes& attrib); virtual void startSection(const QXmlAttributes& attrib); + virtual void startDescription(const QXmlAttributes& attrib); virtual void endSection(); virtual void endHeader(); @@ -51,6 +50,7 @@ class SectionHandler : public IUserDefined, public BaseHandler { return &m_kindString; } virtual SectionKind kind() const { return m_kind; } + IDocRoot *description() const; virtual IMemberIterator *members() const; virtual bool isStatic() const { @@ -83,10 +83,17 @@ class SectionHandler : public IUserDefined, public BaseHandler private: IBaseHandler *m_parent; - SectionKind m_kind; - StringImpl m_kindString; - StringImpl m_header; - QList m_members; + + // XML elements: + // ------------- + StringImpl m_header; // header + DocHandler* m_description; // description + QList m_members; // memberdef + + // XML attributes: + // --------------- + SectionKind m_kind; // kind + StringImpl m_kindString; // kind as a string }; void sectionhandler_init(); diff --git a/doc/arch.doc b/doc/arch.doc index ca0417c..a5ace10 100644 --- a/doc/arch.doc +++ b/doc/arch.doc @@ -31,9 +31,9 @@ The following sections explain the steps above in more detail. The configuration file that controls the settings of a project is parsed and the settings are stored in the singleton class \c Config -in \c src/config.h. The parser itself is written using \c flex and can be -found in \c src/config.l. This parser is also used directly by \c doxywizard, -so it is put in a separate library. +in src/config.h. The parser itself is written using \c flex +and can be found in src/config.l. This parser is also used +directly by \c doxywizard, so it is put in a separate library. Each configuration option has one of 5 possible types: \c String, \c List, \c Enum, \c Int, or \c Bool. The values of these options are diff --git a/doc/config.doc b/doc/config.doc index e29233e..891f148 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -61,6 +61,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_alphabetical_index ALPHABETICAL_INDEX \refitem cfg_always_detailed_sec ALWAYS_DETAILED_SEC \refitem cfg_binary_toc BINARY_TOC +\refitem cfg_builtin_stl_support BUILTIN_STL_SUPPORT \refitem cfg_brief_member_desc BRIEF_MEMBER_DESC \refitem cfg_call_graph CALL_GRAPH \refitem cfg_case_sense_names CASE_SENSE_NAMES @@ -206,6 +207,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_treeview_width TREEVIEW_WIDTH \refitem cfg_uml_look UML_LOOK \refitem cfg_use_htags USE_HTAGS +\refitem cfg_use_pdflatex USE_PDFLATEX \refitem cfg_use_windows_encoding USE_WINDOWS_ENCODING \refitem cfg_verbatim_headers VERBATIM_HEADERS \refitem cfg_warn_format WARN_FORMAT @@ -343,7 +345,8 @@ followed by the descriptions of the tags grouped by category. path to strip. \anchor cfg_strip_from_inc_path -
\c STRIP_FROM_INC_PATH +
\c STRIP_FROM_INC_PATH
+ \addindex STRIP_FROM_INC_PATH The \c STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the path mentioned in the documentation of a class, which tells the reader which header file to include in order to use a class. @@ -378,6 +381,24 @@ followed by the descriptions of the tags grouped by category. comment as the brief description. If set to NO (the default), the Javadoc-style will behave just like the Qt-style comments. +\anchor cfg_builtin_stl_support +
\c BUILTIN_STL_SUPPORT
+ \addindex BUILTIN_STL_SUPPORT + If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to + include (a tag file for) the STL sources as input, then you should + set this tag to \c YES in order to let doxygen match functions declarations and + definitions whose arguments contain STL classes (e.g. func(std::string); v.s. + func(std::string) {}). This also make the inheritance and collaboration + diagrams that involve STL classes more complete and accurate. + +\anchor cfg_distribute_group_doc +
\c DISTRIBUTE_GROUP_DOC
+ \addindex DISTRIBUTE_GROUP_DOC + If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC + tag is set to YES, then doxygen will reuse the documentation of the first + member in the group (if any) for the other members of the group. By default + all members of a group must be documented explicitly. + \anchor cfg_multiline_cpp_is_brief
\c MULTILINE_CPP_IS_BRIEF
\addindex MULTILINE_CPP_IS_BRIEF @@ -404,14 +425,6 @@ followed by the descriptions of the tags grouped by category. member inherits the documentation from any documented member that it re-implements. -\anchor cfg_distribute_group_doc -
\c DISTRIBUTE_GROUP_DOC
- \addindex DISTRIBUTE_GROUP_DOC - If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC - tag is set to YES, then doxygen will reuse the documentation of the first - member in the group (if any) for the other members of the group. By default - all members of a group must be documented explicitly. - \anchor cfg_separate_member_pages
\c SEPARATE_MEMBER_PAGES
\addindex SEPARATE_MEMBER_PAGES @@ -453,10 +466,10 @@ followed by the descriptions of the tags grouped by category. \anchor cfg_optimize_output_java
\c OPTIMIZE_OUTPUT_JAVA
\addindex OPTIMIZE_OUTPUT_JAVA - Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources - only. Doxygen will then generate output that is more tailored for Java. - For instance, namespaces will be presented as packages, qualified scopes - will look different, etc. + Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or + Python sources only. Doxygen will then generate output that is more tailored + for that language. For instance, namespaces will be presented as packages, + qualified scopes will look different, etc. \anchor cfg_subgrouping
\c SUBGROUPING
@@ -683,18 +696,20 @@ function's detailed documentation block. \anchor cfg_warn_if_doc_error
\c WARN_IF_DOC_ERROR
+ \addindex WARN_IF_DOC_ERROR If \c WARN_IF_DOC_ERROR is set to \c YES, doxygen will generate warnings for potential errors in the documentation, such as not documenting some parameters in a documented function, or documenting parameters that don't exist or using markup commands wrongly. \anchor cfg_warn_no_paramdoc -
\c WARN_NO_PARAMDOC -This \c WARN_NO_PARAMDOC option can be abled to get warnings for -functions that are documented, but have no documentation for their parameters -or return value. If set to \c NO (the default) doxygen will only warn about -wrong or incomplete parameter documentation, but not about the absence of -documentation. +
\c WARN_NO_PARAMDOC
+ \addindex WARN_NO_PARAMDOC + This \c WARN_NO_PARAMDOC option can be abled to get warnings for + functions that are documented, but have no documentation for their parameters + or return value. If set to \c NO (the default) doxygen will only warn about + wrong or incomplete parameter documentation, but not about the absence of + documentation. \anchor cfg_warn_format
\c WARN_FORMAT
@@ -749,7 +764,7 @@ documentation. popen()) the command command input-file, where \c command is the value of the \c FILE_VERSION_FILTER tag, and \c input-file is the name of an input file provided by doxygen. - Whatever the progam writes to standard output is used as the file version. + Whatever the program writes to standard output is used as the file version. Example of using a shell script as a filter for Unix: \verbatim @@ -1243,12 +1258,12 @@ EXTRA_PACKAGES = times \addindex PDF_HYPERLINKS If the \c PDF_HYPERLINKS tag is set to \c YES, the \f$\mbox{\LaTeX}\f$ that - is generated is prepared for conversion to PDF (using ps2pdf). + is generated is prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will contain links (just like the HTML output) instead of page references. This makes the output suitable for online browsing using a PDF viewer. -\anchor cfg_latex_pdflatex +\anchor cfg_use_pdflatex
\c USE_PDFLATEX
\addindex LATEX_PDFLATEX diff --git a/doc/docblocks.doc b/doc/docblocks.doc index b1ad2dc..a0132d8 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -18,9 +18,11 @@ \section specialblock Special documentation blocks -A special documentation block is a C or C++ comment block with some +A special documentation block is a C or C++ style comment block with some additional markings, so doxygen knows it is a piece of documentation that -needs to end up in the generated documentation. +needs to end up in the generated documentation. For Python code there is +a different comment convention, which can be found in section +\ref pythonblocks For each code item there are two types of descriptions, which together form the documentation: a \e brief description and \e detailed @@ -168,7 +170,7 @@ detailed description, the one before the \e definition is preferred and the one before the declaration will be ignored. Here is an example of a documented piece of C++ code using the Qt style: -\verbinclude qtstyle.cpp +\include qtstyle.cpp \htmlonly Click here for the corresponding HTML documentation that is generated by doxygen. @@ -201,7 +203,7 @@ Here is an example: Here is the same piece of code as shown above, this time documented using the JavaDoc style and \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" set to YES: -\verbinclude jdstyle.cpp +\include jdstyle.cpp \htmlonly Click here for the corresponding HTML documentation that is generated by doxygen. @@ -260,7 +262,7 @@ only the \< indicates that the member is located in front of the block instead of after the block. Here is an example of the use of these comment blocks: -\verbinclude afterdoc.h +\include afterdoc.h \htmlonly Click here for the corresponding HTML documentation that is generated by doxygen. @@ -313,6 +315,7 @@ Other structural commands are:
  • \c \\fn to document a function.
  • \c \\var to document a variable or typedef or enum value.
  • \c \\def to document a \#define. +
  • \c \\typedef to document a type definition.
  • \c \\file to document a file.
  • \c \\namespace to document a namespace.
  • \c \\package to document a Java package. @@ -335,7 +338,7 @@ or a \verbatim /** @file */ \endverbatim line in this file. Here is an example of a C header named \c structcmd.h that is documented using structural commands: -\verbinclude structcmd.h +\include structcmd.h \htmlonly Click here for the corresponding HTML documentation that is generated by doxygen. @@ -351,6 +354,40 @@ using structural commands: in comment blocks which are place in front of a function. This is clearly a case where the \\fn command is redundant and will only lead to problems. +\section pythonblocks Special documentation blocks in Python + +For Python there is a standard way of documenting the code using +so called documentation strings. Such strings are stored in \c __doc__ +and can be retrieved at runtime. Doxygen will extract such comments +and assume they have to be represented in a preformatted way. + +\include docstring.py + \htmlonly + Click here + for the corresponding HTML documentation that is generated by doxygen. + \endhtmlonly + +Note that in this case none of doxygen's \ref cmd_intro "special commands" +are supported. + +There is also another way to document Python code using comments that +start with "##". These type of comment blocks are more in line with the +way documentation blocks work for the other languages support doxygen +and this also allows the use of special commands. + +Here is the same example again but now using doxygen style comments: + +\include pyexample.py + \htmlonly + Click here + for the corresponding HTML documentation that is generated by doxygen. + \endhtmlonly + +Since python looks more like Java than like C or C++, you should set +\ref cfg_optimize_output_java "OPTMIZE_OUTPUT_JAVA" to \c YES in the +config file. + + \htmlonly Go to the next section or return to the index. diff --git a/doc/features.doc b/doc/features.doc index e3c76ad..871242d 100644 --- a/doc/features.doc +++ b/doc/features.doc @@ -21,20 +21,22 @@
  • Requires very little overhead from the writer of the documentation. Plain text will do, but for more fancy or structured output HTML tags and/or some of doxygen's special commands can be used. -
  • Supports C/C++, Java, (Corba and Microsoft) Java, +
  • Supports C/C++, Java, (Corba and Microsoft) Java, Python, IDL, C#, Objective-C and to some extent D and PHP sources. -
  • Supports documentation of files, namespaces, classes, structs, unions, - templates, variables, functions, typedefs, enums and defines. +
  • Supports documentation of files, namespaces, packages, classes, + structs, unions, templates, variables, functions, typedefs, enums and + defines.
  • JavaDoc (1.1), Qt-Doc, and ECMA-334 (C# spec.) compatible.
  • Automatically generates class and collaboration diagrams in HTML (as clickable image maps) and \f$\mbox{\LaTeX}\f$ (as Encapsulated PostScript images).
  • Uses the dot tool of the Graphviz tool kit to generate include dependency graphs, collaboration diagrams, and graphical class hierarchy graphs. -
  • Allows you to put documentation in the header file (before the +
  • Flexible comment placement: Allows you to put documentation in the + header file (before the declaration of an entity), source file (before the definition of an entity) or in a separate file. -
  • Can generate a list of all members of a class (including any inherited +
  • Generates a list of all members of a class (including any inherited members) along with their protection level.
  • Outputs documentation in on-line format (HTML and UNIX man page) and off-line format (\f$\mbox{\LaTeX}\f$ and RTF) simultaneously diff --git a/doc/grouping.doc b/doc/grouping.doc index 2b896e5..6e942ce 100644 --- a/doc/grouping.doc +++ b/doc/grouping.doc @@ -22,7 +22,7 @@ for each group. These groups are called \ref modules "'modules'" in the document The second mechanism works within a member list of some compound entity, and is refered to as a \ref memgroup "'member groups'". For \ref cmdpage "pages" there is a third grouping mechanism referred to -a \ref subpaging "subpaging". +as \ref subpaging "subpaging". \section modules Modules @@ -217,4 +217,9 @@ the same time makes page B a subpage of A. This has the effect of making two groups GA and GB, where GB is part of GA, page A is put in group GA, and page B is put in group GB. +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/install.doc b/doc/install.doc index 2bea43f..8fb1f6a 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -184,7 +184,7 @@ Compilation is now done by performing the following steps: This is sufficient to use doxygen. \note You need the GNU install tool for this to work (it is part of - the fileutils package). Other install tools may put the binaries in + the coreutils package). Other install tools may put the binaries in the wrong directory! If you have a RPM or DEP package, then please follow the @@ -549,14 +549,15 @@ features: If you want to use MikTeX then you need to select at least the medium size installation. For really old versions of MikTex or minimal installations, you may need to download the fancyhdr package separately. - You can find it at: - ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/supported/fancyhdr/ + You can find it in the + + contrib/supported directory of the tex archives.
  • If you want to generate compressed HTML help (see \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the config file, then you need the Microsoft HTML help workshop. - You can download it at: - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconHH1Start.asp + You can download it from + Microsoft.
  • the Graph visualization toolkit version 1.8.10
    diff --git a/doc/language.doc b/doc/language.doc index df9d7a6..061c788 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -78,7 +78,7 @@ when the translator was updated. Chinese Traditional Daniel YC Lin
    Gary Lee daniel at twpda dot com
    garylee at ecosine dot com dot tw - 1.3.8 + up-to-date Croatian @@ -273,7 +273,7 @@ when the translator was updated. Chinese & Li Daobing & {\tt\tiny lidaobing@gmail.com} & 1.4.1 \\ ~ & Wei Liu & {\tt\tiny liuwei@asiainfo.com} & ~ \\ \hline - Chinese Traditional & Daniel YC Lin & {\tt\tiny daniel@twpda.com} & 1.3.8 \\ + Chinese Traditional & Daniel YC Lin & {\tt\tiny daniel@twpda.com} & up-to-date \\ ~ & Gary Lee & {\tt\tiny garylee@ecosine.com.tw} & ~ \\ \hline Croatian & Boris Bralo & {\tt\tiny boris.bralo@zg.htnet.hr} & up-to-date \\ diff --git a/doc/lists.doc b/doc/lists.doc index 9da03d2..649d83c 100644 --- a/doc/lists.doc +++ b/doc/lists.doc @@ -1,13 +1,13 @@ /*! \page lists Lists -Doxygen has a number of ways to create lists of items. +Doxygen provides a number of ways to create lists of items. Using dashes By putting a number of column-aligned minus signs at the start of a line, a bullet list will automatically be generated. Numbered lists can also be generated by using a minus followed by a hash. - Nesting of lists is allowed.

    + Nesting of lists is allowed and is based on indentation of the items.

    Here is an example: \verbatim /*! @@ -38,8 +38,9 @@ Doxygen has a number of ways to create lists of items. More text here. -If you use tabs within lists, please make sure that \ref cfg_tab_size "TAB_SIZE" in the -configuration file is set to the correct tab size. +If you use tabs for indentation within lists, please make sure +that \ref cfg_tab_size "TAB_SIZE" in the configuration file is set to +the correct tab size. You can end a list by starting a new paragraph or by putting a dot (.) on an empty line at the same indent level as the @@ -98,7 +99,7 @@ Here is the above example with HTML commands: */ \endverbatim -\note The indentation here is not important. +\note In this case the indentation is not important. Using \\arg or \@li diff --git a/doc/starting.doc b/doc/starting.doc index 7410208..d0af1ec 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -26,11 +26,14 @@ for which you do not have the sources. See section \ref doxytag_usage for more detailed usage information. Optionally, the executable \c doxywizard can be used, which is a -graphical front-end for editing the configuration file that is used by -doxygen. +\ref doxywizard_usage "graphical front-end" for editing the configuration file +that is used by doxygen and for running doxygen in a graphical environment. +For Mac OS X doxywizard will be started by clicking on the Doxygen application +icon. The following figure shows the relation between the tools and the flow -of information between them: +of information between them (it looks complex but that's only because it +tries to be complete): \image html infoflow.gif "Doxygen information flow" \image latex infoflow.eps "Doxygen information flow" width=14cm @@ -55,7 +58,7 @@ name \ already exists, doxygen will rename it to \.bak before generating the configuration template. If you use - (i.e. the minus sign) as the file name then doxygen will try to read the configuration file from standard -input (stdin). +input (stdin), which can be useful for scripting. The configuration file has a format that is similar to that of a (simple) Makefile. It contains of a number of assignments (tags) of the form: @@ -78,8 +81,8 @@ and header files, you can leave the current directory. If you have a larger project consisting of a source directory or tree -you should put the root directory or -directories after the \ref cfg_input "INPUT" tag, and add one or more file +you should assign the root directory or +directories to the \ref cfg_input "INPUT" tag, and add one or more file patterns to the \ref cfg_file_patterns "FILE_PATTERNS" tag (for instance *.cpp *.h). Only files that match one of the patterns will be parsed (if the patterns are omitted a list of @@ -92,17 +95,21 @@ To omit all \c test directories from a source tree for instance, one could use: \verbatim EXCLUDE_PATTERNS = */test/* \endverbatim -Doxygen normally parses files if they are C or C++ sources. If a file -has a .idl or .odl extension it is treated as an -IDL file. If it has a .java extension it is treated as a file -written in Java. Files ending with .cs are treated as C# files. -Finally, files with the extensions .php, .php4, +Doxygen looking at the file's extension to determine how to parse a file. +If a file has an .idl or .odl extension it is +treated as an IDL file. If it has a .java extension it is +treated as a file written in Java. Files ending with .cs are +treated as C# files and the .py extension selects the +Python parser. Finally, files with the extensions .php, .php4, .inc or .phtml are treated as PHP sources. +Any other extension is parsed as if it is a C/C++ file, where files that +end with .m are treated as Objective-C source files. \anchor extract_all If you start using doxygen for an existing project (thus without any documentation that doxygen is aware of), you can still get an idea of -what the documented result would be. To do so, you must set +what the structure is and how the documented result would look like. +To do so, you must set the \ref cfg_extract_all "EXTRACT_ALL" tag in the configuration file to \c YES. Then, doxygen will pretend everything in your sources is documented. Please note that as a consequence warnings about undocumented members @@ -124,46 +131,91 @@ To generate the documentation you can now enter: doxygen \endverbatim -Doxygen will create a \c html, \c rtf, \c latex and/or \c man directory inside -the output directory. +Depending on your settings doxygen will create \c html, \c rtf, +\c latex, \c xml and/or \c man directories inside the output directory. As the names suggest these directories contain the -generated documentation in HTML, RTF, \f$\mbox{\LaTeX}\f$ and Unix-Man page -format. +generated documentation in HTML, RTF, \f$\mbox{\LaTeX}\f$, XML and +Unix-Man page format. The default output directory is the directory in which \c doxygen -is started. The directory to which the output is written can be changed -using the \ref cfg_output_directory "OUTPUT_DIRECTORY", +is started. The root directory to which the output is written can be changed +using the \ref cfg_output_directory "OUTPUT_DIRECTORY". The format specific +directory within the output directory can be selected using the \ref cfg_html_output "HTML_OUTPUT", \ref cfg_rtf_output "RTF_OUTPUT", -\ref cfg_latex_output "LATEX_OUTPUT", and \ref cfg_man_output "MAN_OUTPUT" +\ref cfg_latex_output "LATEX_OUTPUT", \ref cfg_xml_output "XML_OUTPUT", +and \ref cfg_man_output "MAN_OUTPUT" tags of the configuration file. If the output directory does not exist, -\c doxygen will try to create it for you. +\c doxygen will try to create it for you (but it will \e not try to create +a whole path recursively, like mkdir -p does). +\subsection html_out HTML output \addindex browser The generated HTML documentation can be viewed by pointing a HTML browser to the \c index.html file in the \c html directory. For the best results a browser that supports cascading style sheets (CSS) should be used -(I'm currently using Netscape 4.61 to test the generated output). -\addindex LaTeX +(I'm using Mozilla, Safari, Konqueror, and sometimes IE6 to test the +generated output). + +Some of the features the HTML section (such as +\ref cfg_generate_treeview "GENERATE_TREEVIEW") require a browser that +supports DHTML and Javascript. +If you plan to use the search engine (see +\ref cfg_searchengine "SEARCHENGINE"), you should view the HTML output +via a PHP enable web server (e.g. apache with the PHP module installed). + +\subsection latex_out LaTeX output +\addindex LaTeX The generated \f$\mbox{\LaTeX}\f$ documentation must first be compiled by -a \f$\mbox{\LaTeX}\f$ compiler (I use teTeX distribution version 0.9 -that contains \f$\mbox{\TeX}\f$ version 3.14159). To simplify the process -of compiling the generated +a \f$\mbox{\LaTeX}\f$ compiler (I use a recent teTeX distribution). +To simplify the process of compiling the generated documentation, \c doxygen writes a \c Makefile into the \c latex directory. By typing \c make in the \c latex directory the dvi file \c refman.dvi will be generated (provided that you have a make tool called make of course). This file can then be viewed using \c xdvi or converted into a PostScript file \c refman.ps by typing make ps (this requires dvips). + To put 2 pages on one physical page use make ps_2on1 instead. The resulting PostScript file can be send to a PostScript printer. If you do not have a PostScript printer, you can try to use ghostscript to convert PostScript into something your printer understands. + Conversion to PDF is also possible if you have installed the ghostscript interpreter; just type make pdf (or make pdf_2on1). To get the best results for PDF output you should set -the \ref cfg_pdf_hyperlinks "PDF_HYPERLINKS" tag to \c YES. - +the \ref cfg_pdf_hyperlinks "PDF_HYPERLINKS" +and \ref cfg_use_pdflatex "USE_PDFLATEX" tags to \c YES. + +\subsection rtf_out RTF output +\addindex RTF +Doxygen combines the RTF output to a single file called refman.rtf. This +file is optimized for importing into the Microsoft Word. Certain information +is encoded using field. To show the actual value you need to +select all (Edit - select all) and then toggle fields (right click and select +the option from the drop down menu). + +\subsection xml_out XML output +\addindex XML +The XML output consists of a structured "dump" of the information gathered +by doxygen. Each compound (class/namespace/file/...) has its own XML file +and there is also an index file called index.xml. + +A file called combine.xslt +XSLT script is also generated and can be used to combine all XML files +into a single file. + +Doxygen also generates two XML schema files index.xsd +(for the index file) and compound.xsd (for the compound files). +This schema file describes the possible elements, their attributes and +how they are structured, i.e. it the describes the grammar of the XML +files and can be used for validation or to steer XSLT scripts. + +In the addon/doxmlparser directory you can find a parser library for reading +the XML output produced by doxygen in an incremental way +(see addon/doxmlparser/include/doxmlintf.h for the interface of the library) + +\subsection man_out Man page output The generated man pages can be viewed using the \c man program. You do need to make sure the man directory is in the man path (see the \c MANPATH environment variable). Note that there are some limitations to the @@ -215,7 +267,9 @@ During parsing the following steps take place:

  • All resulting blank lines are treated as a paragraph separators. This saves you from placing new-paragraph commands yourself in order to make the generated documentation readable. -
  • Links are created for words corresponding to documented classes. +
  • Links are created for words corresponding to documented classes + (unless the word is preceded by a \%; then the word will not be linked and + the \% sign is removed).
  • Links to members are created when certain patterns are found in the text. See section \ref autolink for more information on how the automatic link generation works. diff --git a/doc/translator_report.txt b/doc/translator_report.txt index 325429d..dc2c164 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -8,7 +8,7 @@ German, Greek, Hungarian, Indonesian, Italian, Japanese (+En), Korean (+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. -Of them, 17 translators are up-to-date, 14 translators are based on +Of them, 18 translators are up-to-date, 13 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -20,6 +20,7 @@ still may be some details listed even for them: TranslatorAfrikaans TranslatorBrazilian -- Remove the obsolete methods (never used). TranslatorCatalan + TranslatorChinesetraditional -- Remove the obsolete methods (never used). TranslatorCroatian TranslatorCzech TranslatorDutch -- Remove the obsolete methods (never used). @@ -49,7 +50,6 @@ must be implemented to become up-to-date: TranslatorJapanese 1.3.9 7 methods to implement TranslatorDanish 1.3.9 7 methods to implement TranslatorSpanish 1.3.8 8 methods to implement - TranslatorChinesetraditional 1.3.8 8 methods to implement TranslatorPortuguese 1.3.3 12 methods to implement TranslatorSlovak 1.2.18 21 methods to implement TranslatorSlovene 1.2.16 23 methods to implement @@ -99,21 +99,10 @@ TranslatorChinese (TranslatorAdapter_1_4_1) 1 method to implement virtual QCString trOverloadText() -TranslatorChinesetraditional (TranslatorAdapter_1_3_8) 8 methods to implement +TranslatorChinesetraditional (Translator) ---------------------------- - Implements 184 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trOverloadText() - virtual QCString trDirIndex() - virtual QCString trDirDocumentation() - virtual QCString trDirectories() - virtual QCString trDirDescription() - virtual QCString trSourceFile(QCString & filename) - virtual QCString trDirReference(const char * dirName) - virtual QCString trDir(bool first_capital, bool singular) + Implements 192 of the required methods. Obsolete methods (should be removed, never used): diff --git a/doc/trouble.doc b/doc/trouble.doc index e8880b3..312c163 100644 --- a/doc/trouble.doc +++ b/doc/trouble.doc @@ -134,5 +134,9 @@ For patches please use one file please tar or zip everything, so I only have to save and download one file. +\htmlonly +Return to the index. +\endhtmlonly + */ diff --git a/examples/Makefile.in b/examples/Makefile.in index 07906aa..e0c591f 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -21,13 +21,15 @@ all: class/html/index.html \ tag/html/index.html \ group/html/index.html \ diagrams/html/index.html \ - memgrp/html/index.html + memgrp/html/index.html \ + docstring/html/index.html \ + pyexample/html/index.html clean: rm -rf class define enum file func page relates author \ par overload example include qtstyle jdstyle structcmd \ autolink tag restypedef afterdoc template tag group diagrams \ - memgrp + memgrp docstring pyexample class/html/index.html: class.h class.cfg $(DOXYGEN)/bin/doxygen class.cfg @@ -97,7 +99,14 @@ group/html/index.html: group.cpp group.cfg memgrp/html/index.html: memgrp.cpp memgrp.cfg $(DOXYGEN)/bin/doxygen memgrp.cfg +pyexample/html/index.html: pyexample.py pyexample.cfg + $(DOXYGEN)/bin/doxygen pyexample.cfg + +docstring/html/index.html: docstring.py docstring.cfg + $(DOXYGEN)/bin/doxygen docstring.cfg + diagrams/html/index.html: diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg ifneq ($(HAVE_DOT),) $(DOXYGEN)/bin/doxygen diagrams.cfg endif + diff --git a/examples/Makefile.win.in b/examples/Makefile.win.in index 1caef19..86e2a94 100644 --- a/examples/Makefile.win.in +++ b/examples/Makefile.win.in @@ -22,10 +22,12 @@ all: class/html/index.html \ tag/html/index.html \ group/html/index.html \ diagrams/html/index.html \ - memgrp/html/index.html + memgrp/html/index.html \ + docstring/html/index.html \ + pyexample/html/index.html clean: - deltree /y class define enum file + deltree /y class define enum file pyexample docstring deltree /y func page relates author deltree /y par overload example include qtstyle deltree /y jdstyle structcmd autolink resdefine @@ -97,5 +99,12 @@ group/html/index.html: group.cpp group.cfg memgrp/html/index.html: memgrp.cpp memgrp.cfg $(DOXYDIR)\doxygen memgrp.cfg +pyexample/html/index.html: pyexample.py pyexample.cfg + $(DOXYDIR)\doxygen pyexample.cfg + +docstring/html/index.html: docstring.py docstring.cfg + $(DOXYDIR)\doxygen docstring.cfg + diagrams/html/index.html: diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg $(DOXYDIR)\doxygen diagrams.cfg + diff --git a/examples/docstring.cfg b/examples/docstring.cfg new file mode 100644 index 0000000..d185998 --- /dev/null +++ b/examples/docstring.cfg @@ -0,0 +1,9 @@ +PROJECT_NAME = "Python" +OUTPUT_DIRECTORY = docstring +GENERATE_LATEX = NO +GENERATE_MAN = NO +GENERATE_RTF = NO +OPTIMIZE_OUTPUT_JAVA = YES +INPUT = docstring.py +QUIET = YES +JAVADOC_AUTOBRIEF = YES diff --git a/examples/docstring.py b/examples/docstring.py new file mode 100644 index 0000000..ab185b6 --- /dev/null +++ b/examples/docstring.py @@ -0,0 +1,26 @@ +"""Documentation for this module. + +More details. +""" + +def func(): + """Documentation for a function. + + More details. + """ + pass + +class PyClass: + """Documentation for a class. + + More details. + """ + + def __init__(self): + """The constructor.""" + self._memVar = 0; + + def PyMethod(self): + """Documentation for a method.""" + pass + diff --git a/examples/example.tag b/examples/example.tag index e5c228e..c67e49a 100644 --- a/examples/example.tag +++ b/examples/example.tag @@ -7,7 +7,7 @@ void example class_test.html - a0 + example_28_29 () diff --git a/examples/pyexample.cfg b/examples/pyexample.cfg new file mode 100644 index 0000000..c6fc3fa --- /dev/null +++ b/examples/pyexample.cfg @@ -0,0 +1,9 @@ +PROJECT_NAME = "Python" +OUTPUT_DIRECTORY = pyexample +GENERATE_LATEX = NO +GENERATE_MAN = NO +GENERATE_RTF = NO +OPTIMIZE_OUTPUT_JAVA = YES +INPUT = pyexample.py +QUIET = YES +JAVADOC_AUTOBRIEF = YES diff --git a/examples/pyexample.py b/examples/pyexample.py new file mode 100644 index 0000000..de04c28 --- /dev/null +++ b/examples/pyexample.py @@ -0,0 +1,29 @@ +## Documentation for this module. +# +# More details. + +## Documentation for a function. +# +# More details. +def func(): + pass + +## Documentation for a class. +# +# More details. +class PyClass: + + ## The constructor. + def __init__(self): + self._memVar = 0; + + ## Documentation for a method. + # @param self The object pointer. + def PyMethod(self): + pass + + ## A class variable. + classVar = 0; + + ## @var _memVar + # a member variable diff --git a/examples/templ.cpp b/examples/templ.cpp index 3250abc..9ed48fb 100644 --- a/examples/templ.cpp +++ b/examples/templ.cpp @@ -25,7 +25,7 @@ template class Test : public Test template Test::Test() {} /*! The copy constructor */ -template Test::Test(const Test &t) {} +template Test::Test(const Test &t) {} /*! The constructor of the partial specilization */ template Test::Test() {} diff --git a/src/classdef.cpp b/src/classdef.cpp index acf2233..8bc3f38 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1883,7 +1883,7 @@ void ClassDef::setTemplateArguments(ArgumentList *al) */ bool ClassDef::hasNonReferenceSuperClass() { - bool found=!isReference() && isLinkableInProject(); + bool found=!isReference() && isLinkableInProject() && !isHidden(); if (found) { return TRUE; // we're done if this class is not a reference @@ -2778,6 +2778,7 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName, fileName,startLine,name()+templSpec,ClassDef::Class); templateClass->setTemplateMaster(this); templateClass->setOuterScope(getOuterScope()); + templateClass->setHidden(isHidden()); m_templateInstances->insert(templSpec,templateClass); freshInstance=TRUE; } diff --git a/src/commentcnv.l b/src/commentcnv.l index fa72e3f..a3d62a4 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -320,12 +320,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) copyToOutput(yytext,yyleng); BEGIN(CComment); } -[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"|"f$"|"f[")/[ \r\t\n] { /* start of a verbatim block */ +[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"|"f$"|"f["|"f{")/[^a-z_A-Z0-9] { /* start of a verbatim block */ copyToOutput(yytext,yyleng); if (yytext[2]=='[') { g_blockName="f]"; } + else if (yytext[2]=='{') + { + g_blockName="f}"; + } else { g_blockName=&yytext[1]; @@ -336,7 +340,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) . { /* any other character */ copyToOutput(yytext,yyleng); } -[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]") { /* end of verbatim block */ +[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}") { /* end of verbatim block */ copyToOutput(yytext,yyleng); if (yytext[1]=='f') // end of formula { diff --git a/src/commentscan.l b/src/commentscan.l index 10222d2..13489f5 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -105,7 +105,6 @@ static bool handlePublic(const QCString &s); static bool handlePublicSection(const QCString &s); static bool handleInherit(const QCString &); - typedef bool (*DocCmdFunc)(const QCString &name); struct DocCmdMap @@ -811,7 +810,11 @@ MAILADR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-] addOutput(yytext); } {DETAILEDCMD}/[^a-z_A-Z]* { // command that can end a brief description - if (inContext!=OutputXRef) setOutput(OutputDoc); + if (inContext!=OutputXRef) + { + briefEndsAtDot=FALSE; + setOutput(OutputDoc); + } // continue with the same input REJECT; } @@ -924,6 +927,7 @@ MAILADR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-] if (briefEndsAtDot) { setOutput(OutputDoc); + briefEndsAtDot=FALSE; } } \n { // newline @@ -1434,8 +1438,10 @@ MAILADR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-] } "/*" { // start of a C-comment g_commentCount++; + addOutput(yytext); } "*/" { // end of a C-comment + addOutput(yytext); g_commentCount--; if (g_commentCount<0 && blockName!="verbatim") { diff --git a/src/compound.xsd b/src/compound.xsd index 561ab94..2e3ec01 100644 --- a/src/compound.xsd +++ b/src/compound.xsd @@ -151,6 +151,7 @@ + diff --git a/src/compound_xsd.h b/src/compound_xsd.h index 2d93a57..d2ba0bf 100644 --- a/src/compound_xsd.h +++ b/src/compound_xsd.h @@ -151,6 +151,7 @@ "\n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/config.l b/src/config.l index a9ca7c0..bc09280 100644 --- a/src/config.l +++ b/src/config.l @@ -1472,14 +1472,6 @@ void Config::create() "re-implements. \n", TRUE ); - cb = addBool( - "DISTRIBUTE_GROUP_DOC", - "If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n" - "tag is set to YES, then doxygen will reuse the documentation of the first \n" - "member in the group (if any) for the other members of the group. By default \n" - "all members of a group must be documented explicitly.\n", - FALSE - ); cb = addBool( "SEPARATE_MEMBER_PAGES", "If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n" @@ -1512,12 +1504,30 @@ void Config::create() ); cb = addBool( "OPTIMIZE_OUTPUT_JAVA", - "Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources \n" - "only. Doxygen will then generate output that is more tailored for Java. \n" + "Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n" + "sources only. Doxygen will then generate output that is more tailored for Java. \n" "For instance, namespaces will be presented as packages, qualified scopes \n" "will look different, etc. \n", FALSE ); + cb = addBool( + "BUILTIN_STL_SUPPORT", + "If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to \n" + "include (a tag file for) the STL sources as input, then you should \n" + "set this tag to YES in order to let doxygen match functions declarations and \n" + "definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n" + "func(std::string) {}). This also make the inheritance and collaboration \n" + "diagrams that involve STL classes more complete and accurate. \n", + FALSE + ); + cb = addBool( + "DISTRIBUTE_GROUP_DOC", + "If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n" + "tag is set to YES, then doxygen will reuse the documentation of the first \n" + "member in the group (if any) for the other members of the group. By default \n" + "all members of a group must be documented explicitly.\n", + FALSE + ); cb = addBool( "SUBGROUPING", "Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n" @@ -1731,7 +1741,7 @@ void Config::create() "version control system). Doxygen will invoke the program by executing (via \n" "popen()) the command , where is the value of \n" "the FILE_VERSION_FILTER tag, and is the name of an input file \n" - "provided by doxygen. Whatever the progam writes to standard output \n" + "provided by doxygen. Whatever the program writes to standard output \n" "is used as the file version. See the manual for examples. \n" ); cs->setWidgetType(ConfigString::File); diff --git a/src/definition.cpp b/src/definition.cpp index 9b0ee16..9114e9d 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -52,7 +52,7 @@ static void addToMap(const char *name,Definition *d) dl = new DefinitionList; Doxygen::symbolMap->append(symbolName,dl); } - //printf("******* adding symbol `%s'\n",symbolName.data()); + //printf("******* adding symbol `%s' (%p)\n",symbolName.data(),d); dl->append(d); d->setSymbolName(symbolName); } @@ -65,7 +65,7 @@ static void removeFromMap(Definition *d) if (index!=-1) symbolName=symbolName.mid(index+2); if (!symbolName.isEmpty()) { - //printf("******* removing symbol `%s'\n",symbolName.data()); + //printf("******* removing symbol `%s' (%p)\n",symbolName.data(),d); DefinitionList *dl=Doxygen::symbolMap->find(symbolName); if (dl) { @@ -81,6 +81,7 @@ Definition::Definition(const char *df,int dl, const char *d,bool isSymbol) { //QCString ns; + //printf("Definition(%s) %p\n",name,this); m_defFileName = df; int lastDot = m_defFileName.findRev('.'); if (lastDot!=-1) @@ -118,6 +119,7 @@ Definition::Definition(const char *df,int dl, m_docLine=1; m_docFile=(QCString)"<"+name+">"; m_isSymbol = isSymbol; + m_hidden = FALSE; if (m_isSymbol) addToMap(name,this); } diff --git a/src/definition.h b/src/definition.h index 496b368..394bc79 100644 --- a/src/definition.h +++ b/src/definition.h @@ -167,6 +167,8 @@ class Definition */ void writeDocAnchorsToTagFile(); + bool isHidden() const { return m_hidden; } + // source references void setBodySegment(int bls,int ble); void setBodyDef(FileDef *fd) { m_bodyDef=fd; } @@ -200,6 +202,8 @@ class Definition void writeNavigationPath(OutputList &ol) const; virtual void writeQuickMemberLinks(OutputList &,MemberDef *) const {} + void setHidden(bool b) { m_hidden = b; } + protected: void setLocalName(const QCString name) { m_localName=name; } @@ -243,6 +247,7 @@ class Definition QList *m_xrefListItems; QCString m_symbolName; bool m_isSymbol; + bool m_hidden; QCString m_qualifiedName; diff --git a/src/docparser.cpp b/src/docparser.cpp index 1399788..a88ca05 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -543,10 +543,12 @@ static bool insideOL(DocNode *n) */ static bool findDocsForMemberOrCompound(const char *commandName, QString *pDoc, + QString *pBrief, Definition **pDef) { //printf("findDocsForMemberOrCompound(%s)\n",commandName); *pDoc=""; + *pBrief=""; *pDef=0; QString cmdArg=substitute(commandName,"#","::"); int l=cmdArg.length(); @@ -574,6 +576,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (found && md) { *pDoc=md->documentation(); + *pBrief=md->briefDescription(); *pDef=md; return TRUE; } @@ -594,6 +597,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (cd) // class { *pDoc=cd->documentation(); + *pBrief=cd->briefDescription(); *pDef=cd; return TRUE; } @@ -601,6 +605,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (nd) // namespace { *pDoc=nd->documentation(); + *pBrief=nd->briefDescription(); *pDef=nd; return TRUE; } @@ -608,6 +613,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (gd) // group { *pDoc=gd->documentation(); + *pBrief=gd->briefDescription(); *pDef=gd; return TRUE; } @@ -615,6 +621,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (pd) // page { *pDoc=pd->documentation(); + *pBrief=pd->briefDescription(); *pDef=pd; return TRUE; } @@ -623,6 +630,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, if (fd && !ambig) // file { *pDoc=fd->documentation(); + *pBrief=fd->briefDescription(); *pDef=fd; return TRUE; } @@ -1336,6 +1344,11 @@ static int internalValidatingParseDoc(DocNode *parent,QList &children, // first parse any number of paragraphs bool isFirst=TRUE; DocPara *lastPar=0; + if (!children.isEmpty() && children.last()->kind()==DocNode::Kind_Para) + { // last child item was a paragraph + lastPar = (DocPara*)children.last(); + isFirst=FALSE; + } do { DocPara *par = new DocPara(parent); @@ -1344,6 +1357,7 @@ static int internalValidatingParseDoc(DocNode *parent,QList &children, if (!par->isEmpty()) { children.append(par); + if (lastPar) lastPar->markLast(FALSE); lastPar=par; } else @@ -1604,9 +1618,9 @@ void DocIncOperator::parse() void DocCopy::parse() { - QString doc; + QString doc,brief; Definition *def; - if (findDocsForMemberOrCompound(m_link,&doc,&def)) + if (findDocsForMemberOrCompound(m_link,&doc,&brief,&def)) { if (g_copyStack.findRef(def)==-1) // definition not parsed earlier { @@ -1622,6 +1636,7 @@ void DocCopy::parse() g_styleStack.clear(); g_nodeStack.clear(); g_copyStack.append(def); + internalValidatingParseDoc(this,m_children,brief); internalValidatingParseDoc(this,m_children,doc); g_copyStack.remove(def); ASSERT(g_styleStack.isEmpty()); diff --git a/src/docparser.h b/src/docparser.h index e7fefa2..8befd6a 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -394,6 +394,12 @@ class DocInclude : public DocNode m_isExample(isExample), m_exampleFile(exampleFile) {} Kind kind() const { return Kind_Include; } QString file() const { return m_file; } + QString extension() const { int i=m_file.findRev('.'); + if (i!=-1) + return m_file.right(m_file.length()-i); + else + return ""; + } Type type() const { return m_type; } QString text() const { return m_text; } QString context() const { return m_context; } diff --git a/src/dot.cpp b/src/dot.cpp index 7a1ec72..c501a39 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -287,6 +287,7 @@ static bool readBoundingBoxEPS(const char *fileName,int *width,int *height) return FALSE; } +#if 0 /*! returns TRUE if class cd is a leaf (i.e. has no visible children) */ static bool isLeaf(ClassDef *cd) @@ -311,6 +312,7 @@ static bool isLeaf(ClassDef *cd) } return TRUE; } +#endif // since dot silently reproduces the input file when it does not // support the PNG format, we need to check the result. @@ -1151,7 +1153,7 @@ void DotGfxHierarchyTable::addHierarchy(DotNode *n,ClassDef *cd,bool hideSuper) for ( ; (bcd=bcli.current()) ; ++bcli ) { ClassDef *bClass=bcd->classDef; - //printf(" Trying super class=`%s' usedNodes=%d\n",bClass->name().data(),m_usedNodes->count()); + //printf(" Trying sub class=`%s' usedNodes=%d\n",bClass->name().data(),m_usedNodes->count()); if (bClass->isVisibleInHierarchy() && hasVisibleRoot(bClass->baseClasses())) { DotNode *bn; @@ -1178,8 +1180,10 @@ void DotGfxHierarchyTable::addHierarchy(DotNode *n,ClassDef *cd,bool hideSuper) else { QCString tmp_url=""; - if (bClass->isLinkable()) + if (bClass->isLinkable() && !bClass->isHidden()) + { tmp_url=bClass->getReference()+"$"+bClass->getOutputFileBase(); + } bn = new DotNode(m_curNodeNumber++, bClass->displayName(), tmp_url.data() @@ -1218,8 +1222,10 @@ void DotGfxHierarchyTable::addClassList(ClassSDict *cl) ) // root node in the forest { QCString tmp_url=""; - if (cd->isLinkable()) + if (cd->isLinkable() && !cd->isHidden()) + { tmp_url=cd->getReference()+"$"+cd->getOutputFileBase(); + } //printf("Inserting root class %s\n",cd->name().data()); DotNode *n = new DotNode(m_curNodeNumber++, cd->displayName(), @@ -1353,7 +1359,7 @@ void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, QCString displayName=className; if (Config_getBool("HIDE_SCOPE_NAMES")) displayName=stripScope(displayName); QCString tmp_url; - if (cd->isLinkable()) + if (cd->isLinkable() && !cd->isHidden()) { tmp_url=cd->getReference()+"$"+cd->getOutputFileBase(); } @@ -1376,7 +1382,8 @@ void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, n->addParent(bn); } m_usedNodes->insert(className,bn); - //printf(" add new child node `%s' to %s\n",className.data(),n->m_label.data()); + //printf(" add new child node `%s' to %s hidden=%d url=%s\n", + // className.data(),n->m_label.data(),cd->isHidden(),tmp_url.data()); // we use <=, i.s.o < to cause one more level than intended which is used to // detect truncated nodes @@ -1492,7 +1499,10 @@ DotClassGraph::DotClassGraph(ClassDef *cd,DotNode::GraphType t,int maxRecursionD m_maxDistance = 0; m_recDepth = maxRecursionDepth; QCString tmp_url=""; - if (cd->isLinkable()) tmp_url=cd->getReference()+"$"+cd->getOutputFileBase(); + if (cd->isLinkable() && !cd->isHidden()) + { + tmp_url=cd->getReference()+"$"+cd->getOutputFileBase(); + } QCString className = cd->displayName(); //if (cd->templateArguments()) //{ @@ -1948,7 +1958,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) if (bfd) { in = bfd->absFilePath(); - doc = bfd->isLinkable(); + doc = bfd->isLinkable() && bfd->isHidden(); src = bfd->generateSourceFile(); } if (doc || src || !Config_getBool("HIDE_UNDOC_RELATIONS")) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 1035776..2c9b6ca 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -205,6 +205,154 @@ const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*"; QCString spaces; QCString Doxygen::htmlFileExtension; +struct STLInfo +{ + const char *className; + const char *baseClass1; + const char *baseClass2; + const char *templType1; + const char *templName1; + const char *templType2; + const char *templName2; + bool virtualInheritance; + bool iterators; +}; + +static STLInfo g_stlinfo[] = +{ + // className baseClass1 baseClass2 templType1 templName1 templType2 templName2 virtInheritance // iterators + { "allocator", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, + { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, + { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, + { "basic_ios", "ios_base", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_istream", "basic_ios", 0, "Char", 0, 0, 0, TRUE, FALSE }, + { "basic_ostream", "basic_ios", 0, "Char", 0, 0, 0, TRUE, FALSE }, + { "basic_iostream", "basic_istream", "basic_ostream", "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_ifstream", "basic_istream", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_ofstream", "basic_ostream", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_fstream", "basic_iostream", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_istringstream", "basic_istream", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_ostringstream", "basic_ostream", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "basic_stringstream", "basic_iostream", 0, "Char", 0, 0, 0, FALSE, FALSE }, + { "ios", "basic_ios", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wios", "basic_ios", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "istream", "basic_istream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wistream", "basic_istream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "ostream", "basic_ostream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wostream", "basic_ostream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "ifstream", "basic_ifstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wifstream", "basic_ifstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "ofstream", "basic_ofstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wofstream", "basic_ofstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "fstream", "basic_fstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wfstream", "basic_wfstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "istringstream", "basic_istringstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wistringstream", "basic_istringstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "ostringstream", "basic_ostringstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wostringstream", "basic_ostringstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "stringstream", "basic_stringstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "wstringstream", "basic_stringstream", 0, 0, 0, 0, 0, FALSE, FALSE }, + { "basic_string", 0, 0, "Char", 0, 0, 0, FALSE, TRUE }, + { "string", "basic_string", 0, 0, 0, 0, 0, FALSE, TRUE }, + { "wstring", "basic_string", 0, 0, 0, 0, 0, FALSE, TRUE }, + { "complex", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, + { "bitset", 0, 0, "Bits", 0, 0, 0, FALSE, FALSE }, + { "deque", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, + { "list", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, + { "map", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, + { "multimap", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, + { "set", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, + { "multiset", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, + { "vector", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, + { "queue", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, + { "priority_queue", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, + { "stack", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, + { "valarray", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, + { 0, 0, 0, 0, 0, 0, 0, FALSE, FALSE } +}; + +static void addSTLMember(Entry *root,const char *type,const char *name) +{ + Entry *memEntry = new Entry; + memEntry->name = name; + memEntry->type = type; + memEntry->protection = Private; + memEntry->section = Entry::VARIABLE_SEC; + memEntry->brief = "STL member"; + memEntry->hidden = TRUE; + root->addSubEntry(memEntry); +} + +static void addSTLClasses(Entry *root) +{ + Entry *namespaceEntry = new Entry; + namespaceEntry->fileName = "[STL]"; + namespaceEntry->startLine = 1; + namespaceEntry->parent = root; + namespaceEntry->name = "std"; + namespaceEntry->section = Entry::NAMESPACE_SEC; + namespaceEntry->brief = "STL namespace"; + namespaceEntry->hidden = TRUE; + root->addSubEntry(namespaceEntry); + + STLInfo *info = g_stlinfo; + while (info->className) + { + //printf("Adding STL class %s\n",info->className); + QCString fullName = info->className; + fullName.prepend("std::"); + + // add fake Entry for the class + Entry *classEntry = new Entry; + classEntry->fileName = "[STL]"; + classEntry->startLine = 1; + classEntry->name = fullName; + classEntry->parent = namespaceEntry; + classEntry->section = Entry::CLASS_SEC; + classEntry->brief = "STL class"; + classEntry->hidden = TRUE; + namespaceEntry->addSubEntry(classEntry); + + // add template arguments to class + if (info->templType1) + { + ArgumentList *al = new ArgumentList; + Argument *a=new Argument; + a->type="typename"; + a->name=info->templType1; + al->append(a); + if (info->templType2) // another template argument + { + a=new Argument; + a->type="typename"; + a->name=info->templType2; + al->append(a); + } + classEntry->tArgLists = new QList; + classEntry->tArgLists->setAutoDelete(TRUE); + classEntry->tArgLists->append(al); + } + // add member variables + if (info->templName1) + { + addSTLMember(classEntry,info->templType1,info->templName1); + } + if (info->templName2) + { + addSTLMember(classEntry,info->templType2,info->templName2); + } + if (info->baseClass1) + { + classEntry->extends->append(new BaseInfo(info->baseClass1,Public,info->virtualInheritance?Virtual:Normal)); + } + if (info->baseClass2) + { + classEntry->extends->append(new BaseInfo(info->baseClass2,Public,info->virtualInheritance?Virtual:Normal)); + } + info++; + } +} + //---------------------------------------------------------------------------- static void addRelatedPage(Entry *root) @@ -801,6 +949,7 @@ static void addClassToContext(Entry *root) cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition cd->setBriefDescription(root->brief,root->briefFile,root->briefLine); cd->setIsObjectiveC(root->objc); + cd->setHidden(root->hidden); //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data()); ArgumentList *tArgList = @@ -823,7 +972,6 @@ static void addClassToContext(Entry *root) cd->setBriefDescription(root->brief,root->briefFile,root->briefLine); cd->insertUsedFile(root->fileName); - // add class to the list //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); Doxygen::classSDict.append(fullName,cd); @@ -1045,6 +1193,7 @@ static void buildNamespaceList(Entry *root) nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->addSectionsToDefinition(root->anchors); + nd->setHidden(root->hidden); //printf("Adding namespace to group\n"); addNamespaceToGroups(root,nd); @@ -1163,6 +1312,7 @@ static void findUsingDirectives(Entry *root) nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->addSectionsToDefinition(root->anchors); + nd->setHidden(root->hidden); QListIterator gli(*root->groups); Grouping *g; @@ -1509,6 +1659,7 @@ static MemberDef *addVariableToClass( md->setReadAccessor(root->read); md->setWriteAccessor(root->write); md->enableCallGraph(root->callGraph); + md->setHidden(root->hidden); addMemberToGroups(root,md); //if (root->mGrpId!=-1) //{ @@ -2261,7 +2412,7 @@ static void buildFunctionList(Entry *root) { int ts=rname.find('<'); int te=rname.find('>'); - if (ts==-1 || te==-1) + if (memIndex>0 && (ts==-1 || te==-1)) { nd = Doxygen::namespaceSDict.find(rname.left(memIndex)); isMember = nd==0; @@ -2360,7 +2511,7 @@ static void buildFunctionList(Entry *root) if (found) { // merge argument lists - //mergeArguments(root->argList,md->argumentList()); + mergeArguments(md->argumentList(),root->argList,!root->doc.isEmpty()); // merge documentation if (md->documentation().isEmpty() && !root->doc.isEmpty()) { @@ -3224,7 +3375,7 @@ static void findUsedClassesForClass(Entry *root, if (arg->name==usedName) // type is a template argument { found=TRUE; - Debug::print(Debug::Classes,0," New used class `%s'\n", usedName.data()); + Debug::print(Debug::Classes,0," New used class `%s'\n", usedName.data()); ClassDef *usedCd = Doxygen::hiddenClasses.find(usedName); if (usedCd==0) @@ -3237,7 +3388,7 @@ static void findUsedClassesForClass(Entry *root, if (usedCd) { if (isArtificial) usedCd->setClassIsArtificial(); - Debug::print(Debug::Classes,0," Adding used class `%s' (1)\n", usedCd->name().data()); + Debug::print(Debug::Classes,0," Adding used class `%s' (1)\n", usedCd->name().data()); instanceCd->addUsedClass(usedCd,md->name()); usedCd->addUsedByClass(instanceCd,md->name()); } @@ -4026,14 +4177,11 @@ static void addMemberDocs(Entry *root, if (al) { //printf("merging arguments (1) docs=%d\n",root->doc.isEmpty()); - if ((!root->doc.isEmpty() || !root->proto)) - { - mergeArguments(md->argumentList(),al,TRUE); - } + mergeArguments(md->argumentList(),al,!root->doc.isEmpty()); } else { - if ( (!root->doc.isEmpty() || !root->proto) && + if ( matchArguments2( md->getOuterScope(), md->getFileDef(), md->argumentList(), rscope,rfd,root->argList, TRUE @@ -4041,7 +4189,7 @@ static void addMemberDocs(Entry *root, ) { //printf("merging arguments (2)\n"); - mergeArguments(md->argumentList(),root->argList,TRUE); + mergeArguments(md->argumentList(),root->argList,!root->doc.isEmpty()); } } if (over_load) // the \overload keyword was used @@ -6085,8 +6233,9 @@ static void generateClassList(ClassSDict &classSDict) ClassDef *cd=cli.current(); //printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope); - if (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file - cd->getOuterScope()==Doxygen::globalScope // only look at global classes + if ((cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file + cd->getOuterScope()==Doxygen::globalScope // only look at global classes + ) && !cd->isHidden() ) { // skip external references, anonymous compounds and @@ -6927,10 +7076,12 @@ static void generateNamespaceDocs() for ( ; cli.current() ; ++cli ) { ClassDef *cd=cli.current(); - if ( cd->isLinkableInProject() && - cd->templateMaster()==0 - ) // skip external references, anonymous compounds and - // template instances and nested classes + if ( ( cd->isLinkableInProject() && + cd->templateMaster()==0 + ) // skip external references, anonymous compounds and + // template instances and nested classes + && !cd->isHidden() + ) { msg("Generating docs for compound %s...\n",cd->name().data()); @@ -8083,7 +8234,9 @@ void readConfiguration(int argc, char **argv) Config::instance()->substituteEnvironmentVars(); Config::instance()->convertStrToVal(); Config::instance()->check(); + initWarningFormat(); + QCString outputLanguage=Config_getEnum("OUTPUT_LANGUAGE"); if (!setTranslator(outputLanguage)) { @@ -8400,37 +8553,6 @@ void parseInput() readFormulaRepository(); } - /************************************************************************** - * Read Input Files * - **************************************************************************/ - -#if 0 - QCString tmpName = Config_getString("OUTPUT_DIRECTORY")+ - "/doxygen_scratchfile.tmp"; - - // read and preprocess all input files - readFiles(tmpName); - - QFileInfo fi(tmpName); - if (fi.size()==0) - { - err("No input read, no output generated!\n"); - QDir().remove(tmpName); - delete root; - cleanUpDoxygen(); - exit(1); - } - else - { - msg("Read %d bytes\n",fi.size()); - } - - msg("Parsing input...\n"); - parseMain(root,tmpName); // build a tree of entries - - // remove temp file - QDir().remove(tmpName); -#endif parseFiles(root); /************************************************************************** @@ -8445,6 +8567,11 @@ void parseInput() buildDirectories(); findDirDocumentation(root); + if (Config_getBool("BUILTIN_STL_SUPPORT")) + { + addSTLClasses(root); + } + msg("Building namespace list...\n"); buildNamespaceList(root); findUsingDirectives(root); diff --git a/src/entry.cpp b/src/entry.cpp index f2ef0c7..5ce3239 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -42,6 +42,7 @@ Entry::Entry() tagInfo = 0; sli = 0; relatesDup = FALSE; + hidden = FALSE; groupDocType = GROUPDOC_NORMAL; reset(); } @@ -90,6 +91,7 @@ Entry::Entry(const Entry &e) callGraph = e.callGraph; objc = e.objc; tagInfo = e.tagInfo; + hidden = e.hidden; sublist = new QList; sublist->setAutoDelete(TRUE); extends = new QList; @@ -231,6 +233,7 @@ void Entry::reset() explicitExternal = FALSE; memSpec = 0; objc = FALSE; + hidden = FALSE; subGrouping = TRUE; protection = Public; groupDocType = GROUPDOC_NORMAL; @@ -248,74 +251,7 @@ void Entry::reset() int Entry::getSize() { - int size=sizeof(Entry); - size+=type.length()+1; - size+=name.length()+1; - size+=args.length()+1; - size+=bitfields.length()+1; - size+=exception.length()+1; - size+=program.length()+1; - size+=includeFile.length()+1; - size+=includeName.length()+1; - size+=doc.length()+1; - size+=docFile.length()+1; - size+=relates.length()+1; - size+=brief.length()+1; - size+=briefFile.length()+1; - size+=inbodyDocs.length()+1; - size+=inbodyFile.length()+1; - size+=inside.length()+1; - size+=fileName.length()+1; - size+=initializer.length()+1; - BaseInfo *bi=extends->first(); - while (bi) - { - size+=sizeof(QLNode); - size+=bi->name.length()+1+sizeof(bi->prot)+sizeof(bi->virt); - bi=extends->next(); - } - Grouping *g=groups->first(); - while (g) - { - size+=sizeof(QLNode); - size+=g->groupname.length()+1; - size+=sizeof(g->pri); - g=groups->next(); - } - Entry *e=sublist->first(); - while (e) - { - size+=e->getSize(); - e=sublist->next(); - } - Argument *a=argList->first(); - while (a) - { - size+=sizeof(Argument); - size+=a->type.length()+1 - +a->name.length()+1 - +a->defval.length()+1; - a=argList->next(); - } - if (tArgLists) - { - ArgumentList *al=tArgLists->first(); - while (al) - { - size+=sizeof(ArgumentList); - a=al->first(); - while (a) - { - size+=sizeof(Argument); - size+=a->type.length()+1 - +a->name.length()+1 - +a->defval.length()+1; - a=al->next(); - } - al=tArgLists->next(); - } - } - return size; + return sizeof(Entry); } /*! the argument list is documented if one of its diff --git a/src/entry.h b/src/entry.h index 74ddfed..b10315b 100644 --- a/src/entry.h +++ b/src/entry.h @@ -310,6 +310,7 @@ class Entry TagInfo *tagInfo; //!< tag file info static int num; //!< counts the total number of entries bool objc; //!< Objective-C construct + bool hidden; //!< does this represent an entity this is hidden from the output enum { GROUPDOC_NORMAL, //!< defgroup diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index a560dc3..3a2f222 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -257,7 +257,7 @@ void HtmlDocVisitor::visit(DocInclude *inc) { case DocInclude::Include: m_t << PREFRAG_START; - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(),inc->text().latin1(), inc->isExample(),inc->exampleFile()); m_t << PREFRAG_END; @@ -267,7 +267,7 @@ void HtmlDocVisitor::visit(DocInclude *inc) m_t << PREFRAG_START; QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(), inc->isExample(), diff --git a/src/index.cpp b/src/index.cpp index 10560f5..bad0cc2 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -284,7 +284,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) //printf("Passed...\n"); bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd); //printf("tree4: Has children %s: %d\n",cd->name().data(),hasChildren); - if (cd->isLinkable()) + if (cd->isLinkable() && !cd->isHidden()) { //printf("Writing class %s\n",cd->displayName().data()); ol.writeIndexItem(cd->getReference(),cd->getOutputFileBase(),cd->displayName()); @@ -367,7 +367,7 @@ void writeClassTree(BaseClassList *cl,int level) } bool hasChildren = !cd->visited && classHasVisibleChildren(cd); //printf("tree2: Has children %s: %d\n",cd->name().data(),hasChildren); - if (cd->isLinkable()) + if (cd->isLinkable() && !cd->isHidden()) { if (hasHtmlHelp) { @@ -406,7 +406,7 @@ void writeClassTreeNode(ClassDef *cd,bool hasHtmlHelp,bool hasFtvHelp,bool &star } bool hasChildren = classHasVisibleChildren(cd); //printf("node: Has children %s: %d\n",cd->name().data(),hasChildren); - if (cd->isLinkable()) + if (cd->isLinkable() && !cd->isHidden()) { if (hasHtmlHelp) { @@ -499,7 +499,7 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started) } bool hasChildren = !cd->visited && classHasVisibleChildren(cd); //printf("list: Has children %s: %d\n",cd->name().data(),hasChildren); - if (cd->isLinkable()) + if (cd->isLinkable() && !cd->isHidden()) { //printf("Writing class %s isLinkable()=%d isLinkableInProject()=%d cd->templateMaster()=%p\n", // cd->displayName().data(),cd->isLinkable(),cd->isLinkableInProject(),cd->templateMaster()); @@ -914,7 +914,7 @@ int countNamespaces() NamespaceDef *nd; for (;(nd=nli.current());++nli) { - if (nd->isLinkableInProject()) count++; + if (nd->isLinkableInProject() && !nd->isHidden()) count++; } return count; } @@ -979,7 +979,7 @@ void writeNamespaceIndex(OutputList &ol) NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (nd->isLinkableInProject()) + if (nd->isLinkableInProject() && !nd->isHidden()) { if (first) { @@ -1042,7 +1042,7 @@ int countAnnotatedClasses() ClassDef *cd; for (;(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isHidden()) { //printf("Annotated class %s\n",cd->name().data()); count++; @@ -1074,7 +1074,7 @@ void writeAnnotatedClassList(OutputList &ol) // see which elements are in use for (cli.toFirst();(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isHidden()) { int c = cd->displayName().at(0); g_classIndexLetterUsed[CHL_All][c]=TRUE; @@ -1108,7 +1108,7 @@ void writeAnnotatedClassList(OutputList &ol) for (cli.toFirst();(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isHidden()) { QCString type=cd->compoundTypeString(); ol.startIndexKey(); @@ -1159,7 +1159,7 @@ void writeAlphabeticalClassList(OutputList &ol) QCString alphaLinks = "

    "; for (;(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isHidden()) { int index = getPrefixIndex(cd->className()); //printf("name=%s index=%d\n",cd->className().data(),index); @@ -1201,7 +1201,7 @@ void writeAlphabeticalClassList(OutputList &ol) startLetter=0; for (cli.toFirst();(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isHidden()) { int index = getPrefixIndex(cd->className()); if (toupper(cd->className().at(index))!=startLetter) @@ -1424,7 +1424,7 @@ void writeMemberList(OutputList &ol,bool useSections, if ( md->isLinkableInProject() && (cd=md->getClassDef()) && - cd->isLinkableInProject() && cd->templateMaster()==0 && + cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isHidden() && ( (filter==CMHL_All && !(md->isFriend() && isFriendToHide)) || (filter==CMHL_Functions && (md->isFunction() || md->isSlot() || md->isSignal())) || (filter==CMHL_Variables && md->isVariable()) || @@ -1481,7 +1481,7 @@ void writeMemberList(OutputList &ol,bool useSections, if ( md->isLinkableInProject() && prevName!=cd->displayName() && - cd->templateMaster()==0 + cd->templateMaster()==0 && !cd->isHidden() ) { if (count==0) @@ -2512,7 +2512,7 @@ void writeGraphInfo(OutputList &ol) //---------------------------------------------------------------------------- /*! - * write groups as hierarchial trees + * write groups as hierarchical trees * \author KPW */ @@ -3144,7 +3144,7 @@ void writeIndex(OutputList &ol) { if (Doxygen::mainPage->title().lower()!="notitle") { - ol.parseDoc(defFileName,defLine,Doxygen::mainPage,0,Doxygen::mainPage->title(),TRUE,FALSE); + ol.docify(Doxygen::mainPage->title()); } } else diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 9afde53..c8a172c 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -319,7 +319,7 @@ void LatexDocVisitor::visit(DocInclude *inc) m_t << "\n\n\\footnotesize\\begin{verbatim}"; QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(), inc->isExample(), @@ -329,7 +329,7 @@ void LatexDocVisitor::visit(DocInclude *inc) break; case DocInclude::Include: m_t << "\n\n\\footnotesize\\begin{verbatim}"; - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(),inc->isExample(), inc->exampleFile()); diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 93c5ec5..706a4eb 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -235,7 +235,7 @@ void ManDocVisitor::visit(DocInclude *inc) m_t << ".nf" << endl; QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); - Doxygen::parserManager->getParser(0/*TODO*/) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(), inc->isExample(), @@ -250,7 +250,7 @@ void ManDocVisitor::visit(DocInclude *inc) if (!m_firstCol) m_t << endl; m_t << ".PP" << endl; m_t << ".nf" << endl; - Doxygen::parserManager->getParser(0/*TODO*/) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(),inc->isExample(), inc->exampleFile()); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 3e9becf..3bfb93d 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2006,9 +2006,36 @@ QCString MemberDef::getScopeString() const return result; } +static QCString escapeAnchor(const QCString &anchor) +{ + QCString result; + int l = anchor.length(),i; + for (i=0;i='a' && c<='z') || (c>='A' && c<='Z')) + { + result+=c; + } + else + { + static char hexStr[]="0123456789ABCDEF"; + char escChar[]={ '_', 0, 0, 0 }; + escChar[1]=hexStr[c>>4]; + escChar[2]=hexStr[c&0xf]; + result+=escChar; + } + } + return result; +} + void MemberDef::setAnchor(const char *a) { - anc=a; + //anc=a; + a=a; + QCString memAnchor = name(); + if (!args.isEmpty()) memAnchor+=args; + anc = escapeAnchor(memAnchor); } void MemberDef::setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, diff --git a/src/outputlist.cpp b/src/outputlist.cpp index b6e5e75..297ddca 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -166,7 +166,7 @@ void OutputList::parseDoc(const char *fileName,int startLine, { //printf("og->printDoc(extension=%s)\n", // ctx?ctx->getDefFileExtension().data():""); - if (og->isEnabled()) og->printDoc(root,ctx?ctx->getDefFileExtension():0); + if (og->isEnabled()) og->printDoc(root,ctx?ctx->getDefFileExtension():QCString("")); og=outputs->next(); } diff --git a/src/pycode.l b/src/pycode.l index 175556a..5e66693 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -710,7 +710,7 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) return; } -static void findMemberLink(CodeOutputInterface &ol,const char *symName) +static void findMemberLink(CodeOutputInterface &ol,char *symName) { //printf("Member reference: %s scope=%s member=%s\n", // yytext, @@ -757,7 +757,7 @@ static void findMemberLink(CodeOutputInterface &ol,const char *symName) } } //printf("sym %s not found\n",&yytext[5]); - codify(yytext); + codify(symName); } static void startFontClass(const char *s) diff --git a/src/pyscanner.l b/src/pyscanner.l index 650e51e..64d7585 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -67,6 +67,7 @@ static Protection protection; static Entry* current_root = 0 ; static Entry* current = 0 ; static Entry* previous = 0 ; +static Entry* bodyEntry = 0 ; static int yyLineNr = 1 ; static QCString yyFileName; static MethodTypes mtype; @@ -86,6 +87,7 @@ static bool g_expectModuleDocs; static int g_stringContext; static QCString * g_copyString; static int g_indent = 0; +static int g_curIndent = 0; static QDict g_packageNameCache(257); static QCString g_packageScope; @@ -95,7 +97,8 @@ static char g_atomEnd; static int g_atomCount; static bool g_insideConstructor; -static Entry * g_constructorEntry = 0; + +static QCString g_moduleScope; //----------------------------------------------------------------------------- @@ -302,17 +305,11 @@ static void handleCommentBlock(const QCString &doc,bool brief) static void endOfDef() { - if (g_insideConstructor) - { - g_constructorEntry->endBodyLine = yyLineNr; - } - else - { - current->endBodyLine = yyLineNr; - newEntry(); - } + current = bodyEntry; + bodyEntry->endBodyLine = yyLineNr; + bodyEntry = 0; + newEntry(); g_insideConstructor = FALSE; - g_constructorEntry = 0; } static inline void addToString(const char *s) @@ -417,6 +414,7 @@ STARTDOCSYMS ^{B}"##"/[^#] /* Main start state */ %x Search +%x SearchMemVars /* Mid-comment states */ @@ -456,7 +454,8 @@ STARTDOCSYMS ^{B}"##"/[^#] { - ^{B}"def"{BB} { // start of a function/method definition + ^{B}"def"{BB} | + "def"{BB} { // start of a function/method definition g_indent=computeIndent(yytext); g_expectModuleDocs = FALSE; current->fileName = yyFileName; @@ -475,7 +474,8 @@ STARTDOCSYMS ^{B}"##"/[^#] BEGIN( FunctionDec ); } - ^{B}"class"{BB} { // start of a class definition + ^{B}"class"{BB} | + "class"{BB} { // start of a class definition g_indent=computeIndent(yytext); g_expectModuleDocs = FALSE; current->section = Entry::CLASS_SEC; @@ -511,7 +511,9 @@ STARTDOCSYMS ^{B}"##"/[^#] } {IDENTIFIER} { // some other identifier } - + ^{BB} { + g_curIndent=computeIndent(yytext); + } [^\n] { // any other character... // This is the major default // that should catch everything @@ -538,6 +540,53 @@ STARTDOCSYMS ^{B}"##"/[^#] } } +{ + "self."{IDENTIFIER}/{B}"=" { + //printf("Found member variable %s\n",&yytext[5]); + current->name=&yytext[5]; + current->section=Entry::VARIABLE_SEC; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + current->type.resize(0); + if (current->name.at(0)=='_') // mark as private + { + current->protection=Private; + } + else + { + current->protection=Public; + } + newEntry(); + } + {TRIDOUBLEQUOTE} { // start of a comment block + initTriDoubleQuoteBlock(); + BEGIN(TripleComment); + } + + {TRISINGLEQUOTE} { // start of a comment block + initTriSingleQuoteBlock(); + BEGIN(TripleComment); + } + + {STARTDOCSYMS} { // start of a special comment + initSpecialBlock(); + BEGIN(SpecialComment); + } + "'" { // start of a single quoted string + g_stringContext=YY_START; + g_copyString=0; + BEGIN( SingleQuoteString ); + } + "\"" { // start of a double quoted string + g_stringContext=YY_START; + g_copyString=0; + BEGIN( DoubleQuoteString ); + } + . + \n { yyLineNr++; } +} + { \n{B}/{IDENTIFIER}{BB} { //fprintf(stderr,"indent %d<=%d\n",computeIndent(&yytext[1]),g_indent); @@ -549,47 +598,45 @@ STARTDOCSYMS ^{B}"##"/[^#] unput(yytext[i]); } endOfDef(); + YY_CURRENT_BUFFER->yy_at_bol=TRUE; BEGIN(Search); } else { yyLineNr++; + current->program+=yytext; } } - \n/{B}"##" { - unput('\n'); - endOfDef(); - BEGIN(Search); + \n{B}/"##" { + if (computeIndent(&yytext[1])<=g_indent) + { + int i; + for (i=yyleng-1;i>=0;i--) + { + unput(yytext[i]); + } + endOfDef(); + YY_CURRENT_BUFFER->yy_at_bol=TRUE; + BEGIN(Search); + } + else + { + yyLineNr++; + current->program+=yytext; + } } <> { endOfDef(); yyterminate(); } - "self."{IDENTIFIER}/{B}"=" { - if (g_insideConstructor) - { - current->name=&yytext[5]; - current->section=Entry::VARIABLE_SEC; - current->fileName = yyFileName; - current->startLine = yyLineNr; - current->bodyLine = yyLineNr; - current->type.resize(0); - if (!current->name.isEmpty() && current->name.at(0)=='_') // mark as private - { - current->protection=Private; - } - else - { - current->protection=Public; - } - newEntry(); - } - } ^{BB}\n { // skip empty line + current->program+=yytext; yyLineNr++; } ^{BB} { // something at indent >0 - if (computeIndent(yytext)<=g_indent) + current->program+=yytext; + g_curIndent = computeIndent(yytext); + if (g_curIndent<=g_indent) // jumped out of the function { endOfDef(); @@ -597,26 +644,34 @@ STARTDOCSYMS ^{B}"##"/[^#] } } "'" { // start of a single quoted string + current->program+=yytext; g_stringContext=YY_START; g_specialBlock = FALSE; - g_copyString=0; + g_copyString=¤t->program; BEGIN( SingleQuoteString ); } "\"" { // start of a double quoted string + current->program+=yytext; g_stringContext=YY_START; g_specialBlock = FALSE; - g_copyString=0; + g_copyString=¤t->program; BEGIN( DoubleQuoteString ); } [^ \t\n#'".]+ { // non-special stuff + current->program+=yytext; g_specialBlock = FALSE; } ^{POUNDCOMMENT} { // normal comment + current->program+=yytext; } "#".* { // comment half way + current->program+=yytext; } - {NEWLINE} { yyLineNr++; } + {NEWLINE} { yyLineNr++; + current->program+=yytext; + } . { // any character + current->program+=*yytext; g_specialBlock = FALSE; } @@ -651,13 +706,13 @@ STARTDOCSYMS ^{B}"##"/[^#] { current->protection = Private; } - if ((current_root->section&Entry::SCOPE_MASK) && - current->name=="__init__") // constructor - { + //if ((current_root->section&Entry::SCOPE_MASK) && + // current->name=="__init__") // constructor + //{ g_insideConstructor = TRUE; - g_constructorEntry = current; - newEntry(); - } + // g_constructorEntry = current; + // newEntry(); + //} } {B}"(" { @@ -692,7 +747,7 @@ STARTDOCSYMS ^{B}"##"/[^#] ":" { lineCount(); g_specialBlock = TRUE; // expecting a docstring - + bodyEntry = current; BEGIN( FunctionBody ); } @@ -717,11 +772,15 @@ STARTDOCSYMS ^{B}"##"/[^#] yyterminate(); } ^{BB} { // something at indent >0 - if (computeIndent(yytext)<=g_indent) + g_curIndent=computeIndent(yytext); + //fprintf(stderr,"g_curIndent=%d g_indent=%d\n",g_curIndent,g_indent); + if (g_curIndent<=g_indent) // jumped out of the class { endOfDef(); - g_indent=computeIndent(yytext); + g_indent=g_curIndent; + // make sure the next rule matches ^... + YY_CURRENT_BUFFER->yy_at_bol=TRUE; BEGIN(Search); } else @@ -832,9 +891,11 @@ STARTDOCSYMS ^{B}"##"/[^#] } ^{BB} { - // Remember indentation level for later funcs current->program=yytext; current->startLine = yyLineNr; + g_curIndent=computeIndent(yytext); + bodyEntry = current; + //fprintf(stderr,"setting indent %d\n",g_curIndent); //printf("current->program=[%s]\n",current->program.data()); BEGIN( ClassBody ); } @@ -982,7 +1043,7 @@ STARTDOCSYMS ^{B}"##"/[^#] { {TRIDOUBLEQUOTE} | {TRISINGLEQUOTE} { - //printf("Expected module block %d special=%d\n",g_expectModuleDocs,g_specialBlock); + // printf("Expected module block %d special=%d\n",g_expectModuleDocs,g_specialBlock); if (g_doubleQuote==(yytext[0]=='"')) { if (g_specialBlock || g_expectModuleDocs) @@ -992,12 +1053,13 @@ STARTDOCSYMS ^{B}"##"/[^#] actualDoc.append("\\endverbatim "); if (g_expectModuleDocs) { - actualDoc.prepend("\\file \\_linebr "); + actualDoc.prepend("\\namespace "+g_moduleScope+"\\_linebr "); } handleCommentBlock(actualDoc, FALSE); } g_expectModuleDocs=FALSE; - if (docBlockContext==ClassBody) + if (docBlockContext==ClassBody || + docBlockContext==FunctionBody) { current->program+=docBlock; current->program+=yytext; @@ -1011,8 +1073,21 @@ STARTDOCSYMS ^{B}"##"/[^#] } - ({LONGSTRINGBLOCK}) { - lineCount(); + ^{BB} { // leading whitespace + int indent = computeIndent(yytext); + if (indent>=g_curIndent) + { // strip g_curIndent amount of whitespace + int i; + for (i=0;iprogram; inputPosition = 0; pyscanYYrestart( pyscanYYin ) ; - BEGIN( Search ) ; - current_root = ce ; + if (ce->section&Entry::COMPOUND_MASK) + { + current_root = ce ; + BEGIN( Search ); + } + else if (ce->parent) + { + current_root = ce->parent; + //printf("Searching for member variables in %s parent=%s\n", + // ce->name.data(),ce->parent->name.data()); + BEGIN( SearchMemVars ); + } yyFileName = ce->fileName; yyLineNr = ce->startLine ; if (current) delete current; @@ -1209,15 +1299,15 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) msg("Parsing file %s...\n",yyFileName.data()); QFileInfo fi(fileName); - QCString moduleScope = findPackageScope(fileName); - if (!moduleScope.isEmpty()) + g_moduleScope = findPackageScope(fileName); + if (!g_moduleScope.isEmpty()) { - moduleScope+="::"; + g_moduleScope+="::"; } - moduleScope+=fi.baseName(); + g_moduleScope+=fi.baseName(); current = new Entry; - current->name = moduleScope; + current->name = g_moduleScope; current->section = Entry::NAMESPACE_SEC; current->type = "namespace"; current->fileName = yyFileName; @@ -1278,7 +1368,7 @@ static void parsePrototype(const QCString &text) inputPosition = 0; pyscanYYrestart( pyscanYYin ); - BEGIN( Search ); + BEGIN( FunctionDec ); pyscanYYlex(); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index ab2b6ac..1989800 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -404,7 +404,7 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << rtf_Style_Reset << getStyle("CodeExample"); QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(), inc->isExample(), @@ -417,7 +417,7 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(),inc->isExample(), inc->exampleFile()); diff --git a/src/scanner.l b/src/scanner.l index 54a7060..edb1253 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -4040,9 +4040,20 @@ IDLATTR ("["[^\]]*"]"){BN}* ("@@"|"\\\\"){ID}/[^a-z_A-Z0-9] { // escaped command docBlock+=yytext; } -{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"dot"|"code")/[^a-z_A-Z0-9] { // verbatim command (which could contain nested comments!) +{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code"|"f$"|"f["|"f{")/[^a-z_A-Z0-9] { // verbatim command (which could contain nested comments!) docBlock+=yytext; - docBlockName=&yytext[1]; + if (yytext[2]=='[') + { + docBlockName="f]"; + } + else if (yytext[2]=='}') + { + docBlockName="f}"; + } + else + { + docBlockName=&yytext[1]; + } BEGIN(DocCopyBlock); } [^@*\/\\\n]+ { // any character that isn't special @@ -4058,8 +4069,12 @@ IDLATTR ("["[^\]]*"]"){BN}* /* ---- Copy verbatim sections ------ */ -[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block +[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddot"|"endcode"|"f$"|"f]"|"f}")/[^a-z_A-Z0-9] { // end of verbatim block docBlock+=yytext; + if (yytext[1]=='f') // end of formula + { + BEGIN(DocBlock); + } if (&yytext[4]==docBlockName) { BEGIN(DocBlock); @@ -4561,7 +4576,9 @@ static void parsePrototype(const QCString &text) current->section = Entry::VARIABLEDOC_SEC; // restore original scanner state + YY_BUFFER_STATE tmpState = YY_CURRENT_BUFFER; yy_switch_to_buffer(orgState); + yy_delete_buffer(tmpState); inputString = orgInputString; inputPosition = orgInputPosition; g_inputFromFile = orgInputFromFile; diff --git a/src/translator_tw.h b/src/translator_tw.h index 520bef1..1ee6523 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -41,7 +41,7 @@ // Translator class (by the local maintainer) when the localized // translator is made up-to-date again. -class TranslatorChinesetraditional : public TranslatorAdapter_1_3_8 +class TranslatorChinesetraditional : public Translator { public: @@ -1527,6 +1527,72 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_3_8 return "符合:"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.8 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in HTML as the title of page with source code for file filename + */ + virtual QCString trSourceFile(QCString& filename) + { + return filename + " 原始程式檔"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "目錄階層"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "目錄說明文件"; } + + /*! This is used as the title of the directory index and also in the + * Quick links of a HTML page, to link to the directory hierarchy. + */ + virtual QCString trDirectories() + { return "目錄"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "這個目錄階層經過簡略的字母排序: "; + } + + /*! This returns the title of a directory page. The name of the + * directory is passed via \a dirName. + */ + virtual QCString trDirReference(const char *dirName) + { QCString result=dirName; result+=" 目錄參考文件"; return result; } + + /*! This returns the word directory with or without starting capital + * (\a first_capital) and in sigular or plural form (\a singular). + */ + virtual QCString trDir(bool /*first_capital*/, bool /*singular*/) + { + return QCString("目錄"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.1 +////////////////////////////////////////////////////////////////////////// + + /*! This text is added to the documentation when the \\overload command + * is used for a overloaded function. + */ + virtual QCString trOverloadText() + { + return "這是一個為了便利性所提供 overload 成員函數," + "只有在接受的參數上,與前一個函數不同."; + } }; #endif diff --git a/src/util.cpp b/src/util.cpp index 637a45d..09dee55 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1120,8 +1120,8 @@ ClassDef *getResolvedClassRec(Definition *scope, int count=0; for (dli.toFirst();(d=dli.current());++dli,++count) // foreach definition { - //printf(" found type %x name=%s (%d/%d)\n", - // d->definitionType(),d->name().data(),count,dl->count()); + //printf(" found type %x name=%s (%d/%d) d=%p\n", + // d->definitionType(),d->name().data(),count,dl->count(),d); // only look at classes and members if (d->definitionType()==Definition::TypeClass || @@ -1136,6 +1136,8 @@ ClassDef *getResolvedClassRec(Definition *scope, // see if we are dealing with a class or a typedef if (d->definitionType()==Definition::TypeClass) // d is a class { + if (!((ClassDef*)d)->isArtificial()) + { if (distancedefinitionType()==Definition::TypeMember) { @@ -2766,7 +2769,10 @@ static QCString getCanonicalTypeForIdentifier( // fs?fs->name().data():"" // ); - //printf(">>>> word '%s' => '%s' templSpec=%s ts=%s\n",(word+templSpec).data(),cd?cd->qualifiedNameWithTemplateParameters().data():"",templSpec.data(),ts.data()); + //printf(">>>> word '%s' => '%s' templSpec=%s ts=%s\n", + // (word+templSpec).data(), + // cd?cd->qualifiedNameWithTemplateParameters().data():"", + // templSpec.data(),ts.data()); if (cd) // known type { //result = cd->qualifiedNameWithTemplateParameters(); @@ -5148,7 +5154,7 @@ static void latin1ToLatex(QTextStream &t,unsigned char c) case 252: t << "\\\"{u}"; break; case 253: t << "\\'{y}"; break; case 255: t << "\\\"{y}"; break; - default: t << c; + default: t << (char)c; } } @@ -5161,35 +5167,35 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) switch (c) { case 0xA1: t << "\\k{A}"; break; - case 0xA2: t << c; break; + case 0xA2: t << (char)c; break; case 0xA3: t << "\\L{}"; break; - case 0xA4: t << c; break; - case 0xA5: t << c; break; + case 0xA4: t << (char)c; break; + case 0xA5: t << (char)c; break; case 0xA6: t << "\\'{S}"; break; - case 0xA7: t << c; break; - case 0xA8: t << c; break; + case 0xA7: t << (char)c; break; + case 0xA8: t << (char)c; break; case 0xA9: t << "\\v{S}"; break; case 0xAA: t << "\\c{S}"; break; case 0xAB: t << "\\v{T}"; break; case 0xAC: t << "\\'{Z}"; break; - case 0xAD: t << c; break; + case 0xAD: t << (char)c; break; case 0xAE: t << "\\v{Z}"; break; case 0xAF: t << "\\.{Z}"; break; - case 0xB0: t << c; break; + case 0xB0: t << (char)c; break; case 0xB1: t << "\\k{a}"; break; - case 0xB2: t << c; break; + case 0xB2: t << (char)c; break; case 0xB3: t << "\\l{}"; break; - case 0xB4: t << c; break; - case 0xB5: t << c; break; + case 0xB4: t << (char)c; break; + case 0xB5: t << (char)c; break; case 0xB6: t << "\\'{s}"; break; - case 0xB7: t << c; break; - case 0xB8: t << c; break; + case 0xB7: t << (char)c; break; + case 0xB8: t << (char)c; break; case 0xB9: t << "\\v{s}"; break; case 0xBA: t << "\\c{s}"; break; case 0xBB: t << "\\v{t}"; break; case 0xBC: t << "\\'{z}"; break; - case 0xBD: t << c; break; + case 0xBD: t << (char)c; break; case 0xBE: t << "\\v{z}"; break; case 0xBF: t << "\\.{z}"; break; @@ -5217,9 +5223,9 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) case 0xD4: t << "\\^{O}"; break; case 0xD5: t << "\\H{O}"; break; case 0xD6: t << "\\\"{O}"; break; - case 0xD7: t << c; break; + case 0xD7: t << (char)c; break; case 0xD8: t << "\\v{R}"; break; - case 0xD9: t << c; break; + case 0xD9: t << (char)c; break; case 0xDA: t << "\\'{U}"; break; case 0xDB: t << "\\H{U}"; break; case 0xDC: t << "\\\"{U}"; break; @@ -5230,7 +5236,7 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) case 0xE0: t << "\\'{r}"; break; case 0xE1: t << "\\'{a}"; break; case 0xE2: t << "\\^{a}"; break; - case 0xE3: t << c; break; + case 0xE3: t << (char)c; break; case 0xE4: t << "\\\"{a}"; break; case 0xE5: t << "\\'{l}"; break; case 0xE6: t << "\\'{c}"; break; @@ -5251,17 +5257,17 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) case 0xF4: t << "\\^{o}"; break; case 0xF5: t << "\\H{o}"; break; case 0xF6: t << "\\\"{o}"; break; - case 0xF7: t << c; break; + case 0xF7: t << (char)c; break; case 0xF8: t << "\\v{r}"; break; - case 0xF9: t << c; break; + case 0xF9: t << (char)c; break; case 0xFA: t << "\\'{u}"; break; case 0xFB: t << "\\H{u}"; break; case 0xFC: t << "\\\"{u}"; break; case 0xFD: t << "\\'{y}"; break; - case 0xFE: t << c; break; - case 0xFF: t << c; break; + case 0xFE: t << (char)c; break; + case 0xFF: t << (char)c; break; - default: t << c; + default: t << (char)c; } } @@ -5275,6 +5281,7 @@ void filterLatexString(QTextStream &t,const char *str, theTranslator->idLanguage()=="korean-en"; static bool isRussian = theTranslator->idLanguage()=="russian"; static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; + static bool isSlovene = theTranslator->idLanguage()=="solvene"; static bool isChinese = theTranslator->idLanguage()=="chinese" || theTranslator->idLanguage()=="chinese-traditional"; static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; @@ -5382,7 +5389,7 @@ void filterLatexString(QTextStream &t,const char *str, t << (char)c; } } - else if (isCzech || isRussian || isUkrainian) + else if (isCzech || isRussian || isUkrainian || isSlovene) { if (c>=128) { diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 01e5a06..04bfbe3 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -221,7 +221,7 @@ void XmlDocVisitor::visit(DocInclude *inc) m_t << ""; QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(), inc->isExample(), @@ -231,7 +231,7 @@ void XmlDocVisitor::visit(DocInclude *inc) break; case DocInclude::Include: m_t << ""; - Doxygen::parserManager->getParser(m_langExt) + Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text().latin1(), inc->isExample(), diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 63a5f44..0126cc6 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1588,7 +1588,7 @@ static void generateXMLForPage(PageDef *pd,QTextStream &ti,bool isExample) t << " " << convertToXML(pd->name()) << "" << endl; - SectionInfo *si = Doxygen::sectionDict.find(pageName); + SectionInfo *si = Doxygen::sectionDict.find(pd->name()); if (si) { t << " " << convertToXML(si->title) << "" << endl; -- cgit v0.12