From b7473cd86e57053b866a719f160cd4d01e92f092 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 28 Sep 2004 18:26:46 +0000 Subject: Release-1.3.8-20040928 --- INSTALL | 4 +- README | 4 +- VERSION | 2 +- addon/doxmlparser/include/doxmlintf.h | 70 +++++++++--- addon/doxmlparser/src/compoundhandler.cpp | 81 +++++++++++++- addon/doxmlparser/src/compoundhandler.h | 40 +++++++ addon/doxmlparser/src/dochandler.cpp | 76 ++++++++----- addon/doxmlparser/src/dochandler.h | 53 +++++++-- addon/doxmlparser/src/doxmlintf.h | 70 +++++++++--- addon/doxmlparser/src/mainhandler.cpp | 9 +- addon/doxmlparser/src/memberhandler.cpp | 97 ++++++++++++++-- addon/doxmlparser/src/memberhandler.h | 41 +++++++ addon/doxmlparser/src/paramhandler.cpp | 19 +++- addon/doxmlparser/src/paramhandler.h | 4 + addon/doxmlparser/test/main.cpp | 21 +++- addon/doxywizard/expert.cpp | 7 ++ doc/commands.doc | 24 ++-- doc/language.doc | 10 +- doc/translator_report.txt | 38 +------ packages/rpm/doxygen.spec | 2 +- src/code.l | 42 ++++--- src/compound.xsd | 30 +++-- src/compound_xsd.h | 30 +++-- src/config.l | 1 + src/defargs.l | 4 +- src/dirdef.cpp | 46 ++++++-- src/dirdef.h | 6 +- src/dot.cpp | 35 +++++- src/doxygen.cpp | 17 ++- src/filedef.cpp | 7 +- src/filedef.h | 1 + src/groupdef.cpp | 63 ++++++++++- src/groupdef.h | 10 +- src/htmlgen.cpp | 14 +-- src/index.cpp | 15 +-- src/memberdef.cpp | 36 ++++-- src/memberlist.cpp | 7 +- src/namespacedef.cpp | 1 + src/pre.l | 3 +- src/scanner.l | 30 ++++- src/search_php.h | 1 - src/tagreader.cpp | 58 ++++++++++ src/translator_cn.h | 65 ++++++++++- src/translator_cz.h | 56 +++++++++- src/translator_de.h | 69 ++++++++++-- src/translator_es.h | 2 +- src/translator_hr.h | 50 ++++++++- src/translator_hu.h | 48 +++++++- src/translator_it.h | 48 +++++++- src/translator_pl.h | 48 +++++++- src/translator_ru.h | 50 ++++++++- src/translator_se.h | 61 +++++++++- src/util.cpp | 180 ++++++++++++++++++------------ src/xmldocvisitor.cpp | 6 +- src/xmlgen.cpp | 4 +- 55 files changed, 1476 insertions(+), 340 deletions(-) diff --git a/INSTALL b/INSTALL index 34dbf8f..b021333 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.3.8-20040913 +DOXYGEN Version 1.3.8-20040928 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (13 September 2004) +Dimitri van Heesch (28 September 2004) diff --git a/README b/README index 7db65d1..b06c141 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3.8_20040913 +DOXYGEN Version 1.3.8_20040928 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (13 September 2004) +Dimitri van Heesch (dimitri@stack.nl) (28 September 2004) diff --git a/VERSION b/VERSION index 2cb5476..414daa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.8-20040913 +1.3.8-20040928 diff --git a/addon/doxmlparser/include/doxmlintf.h b/addon/doxmlparser/include/doxmlintf.h index 7296b6e..cd6beba 100644 --- a/addon/doxmlparser/include/doxmlintf.h +++ b/addon/doxmlparser/include/doxmlintf.h @@ -33,6 +33,7 @@ class ICompound; class ISection; class INode; class IDocInternal; +class IDocRoot; /*! \brief Read only interface to a string. */ @@ -51,6 +52,11 @@ class IString virtual int length() const = 0; }; +/*! \brief Base interface for hyperlinked text + * + * Depending on the result of kind() the interface is extended by + * ILT_Text or ILT_Ref. + */ class ILinkedText { public: @@ -58,12 +64,16 @@ class ILinkedText virtual Kind kind() const = 0; }; +/*! \brief Plain text fragment. + */ class ILT_Text : public ILinkedText { public: virtual const IString *text() const = 0; }; +/*! \brief Reference to an object. + */ class ILT_Ref : public ILinkedText { public: @@ -74,6 +84,8 @@ class ILT_Ref : public ILinkedText virtual const IString *text() const = 0; }; +/*! \brief Iterates over a list of ILinkedText fragments. + */ class ILinkedTextIterator { public: @@ -85,6 +97,7 @@ class ILinkedTextIterator virtual void release() = 0; }; +/*! \brief Representation of a parameter of a function. */ class IParam { public: @@ -94,6 +107,7 @@ class IParam virtual const IString * attrib() const = 0; virtual const IString * arraySpecifier() const = 0; virtual ILinkedTextIterator *defaultValue() const = 0; + virtual IDocRoot *briefDescription() const = 0; }; class IParamIterator @@ -171,7 +185,8 @@ class IDoc Anchor, // 34 -> IDocAnchor Symbol, // 35 -> IDocSymbol Internal, // 36 -> IDocInternal - Root // 37 -> IDocRoot + Root, // 37 -> IDocRoot + ParameterItem // 38 -> IDocParameterItem }; virtual Kind kind() const = 0; }; @@ -238,15 +253,21 @@ class IDocParameterList : public IDoc { public: enum Types { Param, RetVal, Exception }; - virtual Types listType() const = 0; + virtual Types sectType() const = 0; virtual IDocIterator *params() const = 0; }; +class IDocParameterItem : public IDoc +{ + public: + virtual IDocIterator *paramNames() const = 0; + virtual IDocPara *description() const = 0; +}; + class IDocParameter : public IDoc { public: virtual const IString * name() const = 0; - virtual IDocPara *description() const = 0; }; class IDocTitle : public IDoc @@ -562,8 +583,18 @@ class IMember virtual ILinkedTextIterator *type() const = 0; virtual const IString * typeString() const = 0; virtual const IString * name() const = 0; + virtual const IString * readAccessor() const = 0; + virtual const IString * writeAccessor() const = 0; + virtual const IString * definition() const = 0; + virtual const IString * argsstring() const = 0; virtual bool isConst() const = 0; virtual bool isVolatile() const = 0; + virtual bool isStatic() const = 0; + virtual bool isExplicit() const = 0; + virtual bool isInline() const = 0; + virtual bool isMutable() const = 0; + virtual bool isReadable() const = 0; + virtual bool isWritable() const = 0; virtual IParamIterator *parameters() const = 0; virtual IParamIterator *templateParameters() const = 0; virtual ILinkedTextIterator *initializer() const = 0; @@ -578,6 +609,7 @@ class IMember virtual IMemberReferenceIterator *reimplementedBy() const = 0; virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0; + virtual IDocRoot *inbodyDescription() const = 0; }; class IDefine : public IMember @@ -636,19 +668,26 @@ class IEnumValue : public IMember virtual const IString * name() const = 0; }; -#if 0 -class IEnumValueIterator +/*! \brief Include relation + */ +class IInclude { public: - virtual IEnumValue *toFirst() = 0; - virtual IEnumValue *toLast() = 0; - virtual IEnumValue *toNext() = 0; - virtual IEnumValue *toPrev() = 0; - virtual IEnumValue *current() const = 0; - virtual void release() = 0; + virtual const IString * name() const = 0; + virtual const IString * refId() const = 0; + virtual bool isLocal() const = 0; }; -#endif +class IIncludeIterator +{ + public: + virtual IInclude *toFirst() = 0; + virtual IInclude *toLast() = 0; + virtual IInclude *toNext() = 0; + virtual IInclude *toPrev() = 0; + virtual IInclude *current() const = 0; + virtual void release() = 0; +}; class IMemberIterator { @@ -936,6 +975,7 @@ class IInterface : public ICompound virtual IRelatedCompoundIterator *derivedCompounds() const = 0; }; + /*! \brief The interface to a Java/IDL exception in the object model. */ class IException : public ICompound @@ -960,9 +1000,9 @@ class IFile : public ICompound virtual IDocProgramListing *source() const = 0; virtual ICompoundIterator *nestedCompounds() const = 0; - // file: - // includes() - // includedBy() + virtual IIncludeIterator *includes() const = 0; + virtual IIncludeIterator *includedBy() const = 0; + // ICompound *innerNamespaces() // ICompoundIterator *innerClasses() }; diff --git a/addon/doxmlparser/src/compoundhandler.cpp b/addon/doxmlparser/src/compoundhandler.cpp index f75b330..26f0848 100644 --- a/addon/doxmlparser/src/compoundhandler.cpp +++ b/addon/doxmlparser/src/compoundhandler.cpp @@ -25,6 +25,33 @@ //---------------------------------------------------------------------------- +IncludeHandler::IncludeHandler(IBaseHandler *parent,const char *endtag) : + m_parent(parent) +{ + addEndHandler(endtag,this,&IncludeHandler::endInclude); +} + +IncludeHandler::~IncludeHandler() +{ +} + +void IncludeHandler::startInclude(const QXmlAttributes &attrib) +{ + m_curString = ""; + m_refId = attrib.value("refid"); + m_isLocal = attrib.value("local")=="yes"; + m_parent->setDelegate(this); +} + +void IncludeHandler::endInclude() +{ + m_name = m_curString; + m_parent->setDelegate(0); + debug(2,"Found include %s\n",m_name.data()); +} + +//---------------------------------------------------------------------------- + class CompoundIdIterator : public ICompoundIterator, public QListIterator { @@ -107,11 +134,15 @@ class CompoundTypeMap 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("exception",new int(ICompound::Exception)); - m_map.insert("namespace",new int(ICompound::Namespace)); 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)); } virtual ~CompoundTypeMap() { @@ -157,6 +188,8 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) m_memberNameDict.setAutoDelete(TRUE); m_innerCompounds.setAutoDelete(TRUE); m_params.setAutoDelete(TRUE); + m_includes.setAutoDelete(TRUE); + m_includedBy.setAutoDelete(TRUE); addStartHandler("doxygen"); addEndHandler("doxygen"); @@ -175,13 +208,16 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) addStartHandler("derivedcompoundref",this,&CompoundHandler::addSubClass); addEndHandler("derivedcompoundref"); - // includes - // includedby - + addStartHandler("includes",this,&CompoundHandler::startIncludes); + addStartHandler("includedby",this,&CompoundHandler::startIncludedBy); + addStartHandler("incdepgraph",this,&CompoundHandler::startIncludeDependencyGraph); addStartHandler("invincdepgraph",this,&CompoundHandler::startIncludedByDependencyGraph); + addStartHandler("innerdir",this,&CompoundHandler::startInnerDir); + addEndHandler("innerdir"); + addStartHandler("innerfile",this,&CompoundHandler::startInnerFile); addEndHandler("innerfile"); @@ -191,7 +227,8 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) addStartHandler("innernamespace",this,&CompoundHandler::startInnerNamespace); addEndHandler("innernamespace"); - // innerpage + addStartHandler("innerpage",this,&CompoundHandler::startInnerPage); + addEndHandler("innerpage"); addStartHandler("innergroup",this,&CompoundHandler::startInnerGroup); addEndHandler("innergroup"); @@ -259,6 +296,20 @@ void CompoundHandler::startProgramListing(const QXmlAttributes& attrib) m_programListing = plHandler; } +void CompoundHandler::startIncludes(const QXmlAttributes& attrib) +{ + IncludeHandler *inc = new IncludeHandler(this,"includes"); + m_includes.append(inc); + inc->startInclude(attrib); +} + +void CompoundHandler::startIncludedBy(const QXmlAttributes& attrib) +{ + IncludeHandler *inc = new IncludeHandler(this,"includedby"); + m_includedBy.append(inc); + inc->startInclude(attrib); +} + void CompoundHandler::startCompound(const QXmlAttributes& attrib) { m_id = attrib.value("id"); @@ -307,6 +358,16 @@ void CompoundHandler::startInnerGroup(const QXmlAttributes& attrib) m_innerCompounds.append(new QString(attrib.value("refid"))); } +void CompoundHandler::startInnerPage(const QXmlAttributes& attrib) +{ + m_innerCompounds.append(new QString(attrib.value("refid"))); +} + +void CompoundHandler::startInnerDir(const QXmlAttributes& attrib) +{ + m_innerCompounds.append(new QString(attrib.value("refid"))); +} + void CompoundHandler::startTemplateParamList(const QXmlAttributes& attrib) { m_templateParamList = new TemplateParamListHandler(this); @@ -539,6 +600,16 @@ IDocProgramListing *CompoundHandler::source() const return m_programListing; } +IIncludeIterator *CompoundHandler::includes() const +{ + return new IncludeIterator(m_includes); +} + +IIncludeIterator *CompoundHandler::includedBy() const +{ + return new IncludeIterator(m_includedBy); +} + IParamIterator *CompoundHandler::templateParameters() const { return m_templateParamList ? m_templateParamList->templateParams() : 0; diff --git a/addon/doxmlparser/src/compoundhandler.h b/addon/doxmlparser/src/compoundhandler.h index 82cb13a..d3e25e6 100644 --- a/addon/doxmlparser/src/compoundhandler.h +++ b/addon/doxmlparser/src/compoundhandler.h @@ -36,6 +36,38 @@ class TemplateParamListHandler; class TitleHandler; class ListOfAllMembersHandler; +class IncludeHandler : public IInclude, public BaseHandler\ +{ + public: + IncludeHandler(IBaseHandler *parent,const char *endtag); + virtual ~IncludeHandler(); + + void startInclude(const QXmlAttributes &attrib); + void endInclude(); + + // IInclude + virtual const IString * name() const + { return &m_name; } + virtual const IString * refId() const + { return &m_refId; } + virtual bool isLocal() const + { return &m_isLocal; } + + private: + IBaseHandler *m_parent; + StringImpl m_name; + StringImpl m_refId; + bool m_isLocal; +}; + +class IncludeIterator : public BaseIterator +{ + public: + IncludeIterator(const QList &list) : + BaseIterator(list) {} +}; + + class RelatedCompound : public IRelatedCompound { public: @@ -94,10 +126,14 @@ class CompoundHandler : public IClass, virtual void startCollaborationGraph(const QXmlAttributes& attrib); virtual void startIncludeDependencyGraph(const QXmlAttributes& attrib); virtual void startIncludedByDependencyGraph(const QXmlAttributes& attrib); + virtual void startIncludes(const QXmlAttributes& attrib); + virtual void startIncludedBy(const QXmlAttributes& attrib); + virtual void startInnerDir(const QXmlAttributes& attrib); virtual void startInnerClass(const QXmlAttributes& attrib); virtual void startInnerNamespace(const QXmlAttributes& attrib); virtual void startInnerFile(const QXmlAttributes& attrib); virtual void startInnerGroup(const QXmlAttributes& attrib); + virtual void startInnerPage(const QXmlAttributes& attrib); virtual void startTitle(const QXmlAttributes& attrib); virtual void startTemplateParamList(const QXmlAttributes& attrib); virtual void startListOfAllMembers(const QXmlAttributes& attrib); @@ -140,6 +176,8 @@ class CompoundHandler : public IClass, IGraph *includeDependencyGraph() const; IGraph *includedByDependencyGraph() const; IDocProgramListing *source() const; + IIncludeIterator *includes() const; + IIncludeIterator *includedBy() const; // IPage implementation const IDocTitle *title() const; @@ -149,6 +187,8 @@ class CompoundHandler : public IClass, QList m_subClasses; QList m_sections; QList m_params; + QList m_includes; + QList m_includedBy; DocHandler* m_brief; DocHandler* m_detailed; ProgramListingHandler* m_programListing; diff --git a/addon/doxmlparser/src/dochandler.cpp b/addon/doxmlparser/src/dochandler.cpp index 6b85d59..517e70c 100644 --- a/addon/doxmlparser/src/dochandler.cpp +++ b/addon/doxmlparser/src/dochandler.cpp @@ -551,16 +551,13 @@ void TocItemHandler::endTocItem() //---------------------------------------------------------------------- ParameterHandler::ParameterHandler(IBaseHandler *parent) : - m_parent(parent), m_description(0) + m_parent(parent) { addEndHandler("parametername",this,&ParameterHandler::endParameterName); - addEndHandler("parameterdescription",this,&ParameterHandler::endParameterDescription); - addStartHandler("para",this,&ParameterHandler::startParagraph); } ParameterHandler::~ParameterHandler() { - delete m_description; } void ParameterHandler::startParameterName(const QXmlAttributes& /*attrib*/) @@ -576,23 +573,57 @@ void ParameterHandler::endParameterName() m_parent->setDelegate(0); } -void ParameterHandler::startParameterDescription(const QXmlAttributes& /*attrib*/) +//---------------------------------------------------------------------- +// ParameterListHandler +//---------------------------------------------------------------------- + +ParameterItemHandler::ParameterItemHandler(IBaseHandler *parent) + : m_parent(parent) +{ + addEndHandler("parameteritem",this,&ParameterItemHandler::endParameterItem); + addStartHandler("parameternamelist"); + addEndHandler("parameternamelist"); + addStartHandler("parametername",this,&ParameterItemHandler::startParameterName); + addStartHandler("parameterdescription"); + addEndHandler("parameterdescription"); + addStartHandler("para",this,&ParameterItemHandler::startParagraph); + m_parameters.setAutoDelete(TRUE); + m_description = 0; +} + +ParameterItemHandler::~ParameterItemHandler() +{ + delete m_description; +} + +void ParameterItemHandler::startParameterItem(const QXmlAttributes&) { m_parent->setDelegate(this); } -void ParameterHandler::endParameterDescription() +void ParameterItemHandler::endParameterItem() { m_parent->setDelegate(0); } -void ParameterHandler::startParagraph(const QXmlAttributes& attrib) +void ParameterItemHandler::startParameterName(const QXmlAttributes& attrib) +{ + ParameterHandler *param = new ParameterHandler(this); + m_parameters.append(param); + param->startParameterName(attrib); +} + +void ParameterItemHandler::startParagraph(const QXmlAttributes& attrib) { - ASSERT(m_description==0); m_description = new ParagraphHandler(this); m_description->startParagraph(attrib); } +IDocIterator *ParameterItemHandler::paramNames() const +{ + return new ParameterItemIterator(*this); +} + //---------------------------------------------------------------------- // ParameterListHandler //---------------------------------------------------------------------- @@ -601,12 +632,8 @@ ParameterListHandler::ParameterListHandler(IBaseHandler *parent) : m_parent(parent) { addEndHandler("parameterlist",this,&ParameterListHandler::endParameterList); - addStartHandler("parametername",this,&ParameterListHandler::startParameterName); - addStartHandler("parameterdescription",this,&ParameterListHandler::startParameterDescription); - addStartHandler("title"); - addEndHandler("title"); - m_parameters.setAutoDelete(TRUE); - m_curParam=0; + addStartHandler("parameteritem",this,&ParameterListHandler::startParameterItem); + m_paramItems.setAutoDelete(TRUE); } ParameterListHandler::~ParameterListHandler() @@ -632,17 +659,11 @@ void ParameterListHandler::endParameterList() m_parent->setDelegate(0); } -void ParameterListHandler::startParameterName(const QXmlAttributes& attrib) -{ - m_curParam = new ParameterHandler(this); - m_parameters.append(m_curParam); - m_curParam->startParameterName(attrib); -} - -void ParameterListHandler::startParameterDescription(const QXmlAttributes& attrib) +void ParameterListHandler::startParameterItem(const QXmlAttributes& attrib) { - ASSERT(m_curParam!=0); - m_curParam->startParameterDescription(attrib); + ParameterItemHandler *paramItem = new ParameterItemHandler(this); + m_paramItems.append(paramItem); + paramItem->startParameterItem(attrib); } IDocIterator *ParameterListHandler::params() const @@ -1734,9 +1755,9 @@ void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib) void ParagraphHandler::startParameterList(const QXmlAttributes& attrib) { addTextNode(); - ParameterListHandler *parListHandler = new ParameterListHandler(this); - parListHandler->startParameterList(attrib); - m_children.append(parListHandler); + ParameterListHandler *listHandler = new ParameterListHandler(this); + listHandler->startParameterList(attrib); + m_children.append(listHandler); } void ParagraphHandler::startSimpleSect(const QXmlAttributes& attrib) @@ -2148,6 +2169,7 @@ DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent) addEndHandler("briefdescription",this,&DocHandler::endDoc); addEndHandler("detaileddescription",this,&DocHandler::endDoc); + addEndHandler("inbodydescription",this,&DocHandler::endDoc); addEndHandler("internal"); addStartHandler("para",this,&DocHandler::startParagraph); diff --git a/addon/doxmlparser/src/dochandler.h b/addon/doxmlparser/src/dochandler.h index be577aa..6977254 100644 --- a/addon/doxmlparser/src/dochandler.h +++ b/addon/doxmlparser/src/dochandler.h @@ -45,6 +45,7 @@ DEFINE_CLS_IMPL(DocItemizedList); DEFINE_CLS_IMPL(DocOrderedList); DEFINE_CLS_IMPL(DocListItem); DEFINE_CLS_IMPL(DocParameterList); +DEFINE_CLS_IMPL(DocParameterItem); DEFINE_CLS_IMPL(DocParameter); DEFINE_CLS_IMPL(DocTitle); DEFINE_CLS_IMPL(DocSimpleSect); @@ -418,24 +419,54 @@ class ParameterHandler : public DocParameterImpl, virtual ~ParameterHandler(); virtual void startParameterName(const QXmlAttributes& attrib); virtual void endParameterName(); - virtual void startParameterDescription(const QXmlAttributes& attrib); - virtual void endParameterDescription(); - virtual void startParagraph(const QXmlAttributes& attrib); // IDocParameter virtual Kind kind() const { return DocImpl::Parameter; } virtual const IString *name() const { return &m_name; } - virtual IDocPara *description() const { return m_description; } private: IBaseHandler *m_parent; StringImpl m_name; +}; + +//----------------------------------------------------------------------------- + +/* \brief Node representing a list of param names with a single description. + * + */ +class ParameterItemHandler : public DocParameterItemImpl, + public BaseHandler +{ + friend class ParameterItemIterator; + public: + ParameterItemHandler(IBaseHandler *parent); + virtual ~ParameterItemHandler(); + virtual void startParameterItem(const QXmlAttributes& attrib); + virtual void endParameterItem(); + virtual void startParameterName(const QXmlAttributes& attrib); + virtual void startParagraph(const QXmlAttributes& attrib); + + // IDocParameterItem + virtual Kind kind() const { return DocImpl::ParameterItem; } + virtual IDocIterator *paramNames() const; + virtual IDocPara *description() const { return m_description; } + + private: + IBaseHandler *m_parent; + QList m_parameters; ParagraphHandler *m_description; }; +class ParameterItemIterator : public BaseIteratorVia +{ + public: + ParameterItemIterator(const ParameterItemHandler &handler) : + BaseIteratorVia(handler.m_parameters) {} +}; + //----------------------------------------------------------------------------- -/* \brief Node representing a parameter list. +/* \brief Node representing a parameter section. * */ class ParameterListHandler : public DocParameterListImpl, @@ -447,26 +478,24 @@ class ParameterListHandler : public DocParameterListImpl, virtual ~ParameterListHandler(); virtual void startParameterList(const QXmlAttributes& attrib); virtual void endParameterList(); - virtual void startParameterName(const QXmlAttributes& attrib); - virtual void startParameterDescription(const QXmlAttributes& attrib); + virtual void startParameterItem(const QXmlAttributes& attrib); // IDocParameterList virtual Kind kind() const { return DocImpl::ParameterList; } - virtual Types listType() const { return m_type; } + virtual Types sectType() const { return m_type; } virtual IDocIterator *params() const; private: IBaseHandler *m_parent; - QList m_parameters; - ParameterHandler *m_curParam; + QList m_paramItems; Types m_type; }; -class ParameterListIterator : public BaseIteratorVia +class ParameterListIterator : public BaseIteratorVia { public: ParameterListIterator(const ParameterListHandler &handler) : - BaseIteratorVia(handler.m_parameters) {} + BaseIteratorVia(handler.m_paramItems) {} }; //----------------------------------------------------------------------------- diff --git a/addon/doxmlparser/src/doxmlintf.h b/addon/doxmlparser/src/doxmlintf.h index 7296b6e..cd6beba 100644 --- a/addon/doxmlparser/src/doxmlintf.h +++ b/addon/doxmlparser/src/doxmlintf.h @@ -33,6 +33,7 @@ class ICompound; class ISection; class INode; class IDocInternal; +class IDocRoot; /*! \brief Read only interface to a string. */ @@ -51,6 +52,11 @@ class IString virtual int length() const = 0; }; +/*! \brief Base interface for hyperlinked text + * + * Depending on the result of kind() the interface is extended by + * ILT_Text or ILT_Ref. + */ class ILinkedText { public: @@ -58,12 +64,16 @@ class ILinkedText virtual Kind kind() const = 0; }; +/*! \brief Plain text fragment. + */ class ILT_Text : public ILinkedText { public: virtual const IString *text() const = 0; }; +/*! \brief Reference to an object. + */ class ILT_Ref : public ILinkedText { public: @@ -74,6 +84,8 @@ class ILT_Ref : public ILinkedText virtual const IString *text() const = 0; }; +/*! \brief Iterates over a list of ILinkedText fragments. + */ class ILinkedTextIterator { public: @@ -85,6 +97,7 @@ class ILinkedTextIterator virtual void release() = 0; }; +/*! \brief Representation of a parameter of a function. */ class IParam { public: @@ -94,6 +107,7 @@ class IParam virtual const IString * attrib() const = 0; virtual const IString * arraySpecifier() const = 0; virtual ILinkedTextIterator *defaultValue() const = 0; + virtual IDocRoot *briefDescription() const = 0; }; class IParamIterator @@ -171,7 +185,8 @@ class IDoc Anchor, // 34 -> IDocAnchor Symbol, // 35 -> IDocSymbol Internal, // 36 -> IDocInternal - Root // 37 -> IDocRoot + Root, // 37 -> IDocRoot + ParameterItem // 38 -> IDocParameterItem }; virtual Kind kind() const = 0; }; @@ -238,15 +253,21 @@ class IDocParameterList : public IDoc { public: enum Types { Param, RetVal, Exception }; - virtual Types listType() const = 0; + virtual Types sectType() const = 0; virtual IDocIterator *params() const = 0; }; +class IDocParameterItem : public IDoc +{ + public: + virtual IDocIterator *paramNames() const = 0; + virtual IDocPara *description() const = 0; +}; + class IDocParameter : public IDoc { public: virtual const IString * name() const = 0; - virtual IDocPara *description() const = 0; }; class IDocTitle : public IDoc @@ -562,8 +583,18 @@ class IMember virtual ILinkedTextIterator *type() const = 0; virtual const IString * typeString() const = 0; virtual const IString * name() const = 0; + virtual const IString * readAccessor() const = 0; + virtual const IString * writeAccessor() const = 0; + virtual const IString * definition() const = 0; + virtual const IString * argsstring() const = 0; virtual bool isConst() const = 0; virtual bool isVolatile() const = 0; + virtual bool isStatic() const = 0; + virtual bool isExplicit() const = 0; + virtual bool isInline() const = 0; + virtual bool isMutable() const = 0; + virtual bool isReadable() const = 0; + virtual bool isWritable() const = 0; virtual IParamIterator *parameters() const = 0; virtual IParamIterator *templateParameters() const = 0; virtual ILinkedTextIterator *initializer() const = 0; @@ -578,6 +609,7 @@ class IMember virtual IMemberReferenceIterator *reimplementedBy() const = 0; virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0; + virtual IDocRoot *inbodyDescription() const = 0; }; class IDefine : public IMember @@ -636,19 +668,26 @@ class IEnumValue : public IMember virtual const IString * name() const = 0; }; -#if 0 -class IEnumValueIterator +/*! \brief Include relation + */ +class IInclude { public: - virtual IEnumValue *toFirst() = 0; - virtual IEnumValue *toLast() = 0; - virtual IEnumValue *toNext() = 0; - virtual IEnumValue *toPrev() = 0; - virtual IEnumValue *current() const = 0; - virtual void release() = 0; + virtual const IString * name() const = 0; + virtual const IString * refId() const = 0; + virtual bool isLocal() const = 0; }; -#endif +class IIncludeIterator +{ + public: + virtual IInclude *toFirst() = 0; + virtual IInclude *toLast() = 0; + virtual IInclude *toNext() = 0; + virtual IInclude *toPrev() = 0; + virtual IInclude *current() const = 0; + virtual void release() = 0; +}; class IMemberIterator { @@ -936,6 +975,7 @@ class IInterface : public ICompound virtual IRelatedCompoundIterator *derivedCompounds() const = 0; }; + /*! \brief The interface to a Java/IDL exception in the object model. */ class IException : public ICompound @@ -960,9 +1000,9 @@ class IFile : public ICompound virtual IDocProgramListing *source() const = 0; virtual ICompoundIterator *nestedCompounds() const = 0; - // file: - // includes() - // includedBy() + virtual IIncludeIterator *includes() const = 0; + virtual IIncludeIterator *includedBy() const = 0; + // ICompound *innerNamespaces() // ICompoundIterator *innerClasses() }; diff --git a/addon/doxmlparser/src/mainhandler.cpp b/addon/doxmlparser/src/mainhandler.cpp index c610f04..d2422ed 100644 --- a/addon/doxmlparser/src/mainhandler.cpp +++ b/addon/doxmlparser/src/mainhandler.cpp @@ -133,6 +133,7 @@ void MainHandler::endName() else { m_curCompound->name = m_curString; + m_compoundNameDict.insert(m_curString,m_curCompound); } } @@ -230,16 +231,16 @@ ICompound *MainHandler::compoundById(const char *id) const // unchanged. MainHandler *that = (MainHandler *)this; ch->initialize(that); - printf("loading compound %s in memory\n",id); + //printf("loading compound %s in memory\n",id); that->m_compoundsLoaded.insert(id,ch); return ch->toICompound(); } void MainHandler::unloadCompound(CompoundHandler *ch) { - printf("unloading compound %s from memory\n",ch->id()->latin1()); + //printf("unloading compound %s from memory\n",ch->id()->latin1()); bool result = m_compoundsLoaded.remove(ch->id()->latin1()); - if (!result) printf("Failed to unload!\n"); + if (!result) debug(1,"Failed to unload component!\n"); } ICompound *MainHandler::compoundByName(const char *name) const @@ -257,7 +258,7 @@ ICompound *MainHandler::memberById(const char *id) const if (ids.isEmpty()) return 0; MemberEntry *me = m_memberDict[id]; if (me==0) return 0; // id not found - return compoundById(me->id); + return compoundById(me->compound->id); } ICompoundIterator *MainHandler::memberByName(const char *name) const diff --git a/addon/doxmlparser/src/memberhandler.cpp b/addon/doxmlparser/src/memberhandler.cpp index 55c8a58..dc1f6bc 100644 --- a/addon/doxmlparser/src/memberhandler.cpp +++ b/addon/doxmlparser/src/memberhandler.cpp @@ -154,7 +154,7 @@ void EnumValueHandler::startDetailedDesc(const QXmlAttributes& attrib) //------------------------------------------------------------------------------ MemberHandler::MemberHandler(IBaseHandler *parent) - : m_parent(parent), m_compound(0), m_brief(0), m_detailed(0) + : m_parent(parent), m_compound(0), m_brief(0), m_detailed(0), m_inbody(0) { //printf("MemberHandler::MemberHandler() %p\n",this); addEndHandler("memberdef",this,&MemberHandler::endMember); @@ -163,11 +163,22 @@ MemberHandler::MemberHandler(IBaseHandler *parent) addEndHandler("templateparamlist",this,&MemberHandler::endTemplateParamList); addStartHandler("type",this,&MemberHandler::startType); - // definition - // argsstring + + addStartHandler("definition",this,&MemberHandler::startDefinition); + addEndHandler("definition",this,&MemberHandler::endDefinition); + + addStartHandler("argsstring",this,&MemberHandler::startArgsString); + addEndHandler("argsstring",this,&MemberHandler::endArgsString); + addStartHandler("name",this,&MemberHandler::startName); addEndHandler("name",this,&MemberHandler::endName); + addStartHandler("read",this,&MemberHandler::startRead); + addEndHandler("read",this,&MemberHandler::endRead); + + addStartHandler("write",this,&MemberHandler::startWrite); + addEndHandler("write",this,&MemberHandler::endWrite); + addStartHandler("reimplements",this,&MemberHandler::startReimplements); addEndHandler("reimplements",this,&MemberHandler::endReimplements); @@ -180,13 +191,13 @@ MemberHandler::MemberHandler(IBaseHandler *parent) addEndHandler("enumvalue",this,&MemberHandler::endMember); addStartHandler("initializer",this,&MemberHandler::startInitializer); - addStartHandler("exception",this,&MemberHandler::startException); + addStartHandler("exceptions",this,&MemberHandler::startException); addStartHandler("briefdescription",this,&MemberHandler::startBriefDesc); addStartHandler("detaileddescription",this,&MemberHandler::startDetailedDesc); - // inbodydescription + addStartHandler("inbodydescription",this,&MemberHandler::startInbodyDesc); addStartHandler("location",this,&MemberHandler::startLocation); addEndHandler("location"); @@ -219,6 +230,7 @@ MemberHandler::~MemberHandler() debug(2,"MemberHandler::~MemberHandler() %p\n",this); delete m_brief; delete m_detailed; + delete m_inbody; delete m_linkedTextHandler; delete m_reimplements; } @@ -230,10 +242,17 @@ void MemberHandler::startMember(const QXmlAttributes& attrib) //printf("startMember kindString=`%s'\n",m_kindString.data()); m_kind = s_typeMap->map(m_kindString); m_id = attrib.value("id"); - m_virtualness = attrib.value("virt"); m_protection = attrib.value("prot"); + m_isStatic = attrib.value("static")=="yes"; m_isConst = attrib.value("const")=="yes"; + m_isExplicit = attrib.value("explicit")=="yes"; + m_isInline = attrib.value("inline")=="yes"; + m_virtualness = attrib.value("virt"); m_isVolatile = attrib.value("volatile")=="yes"; + m_isMutable = attrib.value("mutable")=="yes"; + m_isReadable = attrib.value("readable")=="yes"; + m_isWritable = attrib.value("writable")=="yes"; + debug(2,"member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n", m_kindString.data(),m_id.data(),m_protection.data(),m_virtualness.data()); } @@ -245,10 +264,16 @@ void MemberHandler::startEnumValue(const QXmlAttributes& attrib) //printf("startEnumValue kindString=`%s'\n",m_kindString.data()); m_kind = s_typeMap->map(m_kindString); m_id = attrib.value("id"); - m_virtualness = "non-virtual"; m_protection = attrib.value("prot"); + m_isStatic = FALSE; m_isConst = FALSE; + m_isExplicit = FALSE; + m_isInline = FALSE; + m_virtualness = "non-virtual"; m_isVolatile = FALSE; + m_isMutable = FALSE; + m_isReadable = FALSE; + m_isWritable = FALSE; debug(2,"member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n", m_kindString.data(),m_id.data(),m_protection.data(),m_virtualness.data()); } @@ -275,6 +300,13 @@ void MemberHandler::startDetailedDesc(const QXmlAttributes& attrib) m_detailed = docHandler; } +void MemberHandler::startInbodyDesc(const QXmlAttributes& attrib) +{ + DocHandler *docHandler = new DocHandler(this); + docHandler->startDoc(attrib); + m_inbody = docHandler; +} + void MemberHandler::startLocation(const QXmlAttributes& attrib) { m_defFile = attrib.value("file"); @@ -364,7 +396,7 @@ void MemberHandler::startException(const QXmlAttributes &) debug(2,"startException!\n"); delete m_linkedTextHandler; m_linkedTextHandler = new LinkedTextHandler(this,m_exception); - m_linkedTextHandler->start("exception"); + m_linkedTextHandler->start("exceptions"); } void MemberHandler::startName(const QXmlAttributes &) @@ -378,6 +410,50 @@ void MemberHandler::endName() debug(2,"member name=`%s'\n",m_name.data()); } +void MemberHandler::startRead(const QXmlAttributes &) +{ + m_curString=""; +} + +void MemberHandler::endRead() +{ + m_read = m_curString.stripWhiteSpace(); + debug(2,"member read=`%s'\n",m_read.data()); +} + +void MemberHandler::startWrite(const QXmlAttributes &) +{ + m_curString=""; +} + +void MemberHandler::endWrite() +{ + m_write = m_curString.stripWhiteSpace(); + debug(2,"member write=`%s'\n",m_write.data()); +} + +void MemberHandler::startDefinition(const QXmlAttributes&) +{ + m_curString=""; +} + +void MemberHandler::endDefinition() +{ + m_definition = m_curString.stripWhiteSpace(); + debug(2,"definition=%s\n",m_definition.data()); +} + +void MemberHandler::startArgsString(const QXmlAttributes&) +{ + m_curString=""; +} + +void MemberHandler::endArgsString() +{ + m_argsstring = m_curString.stripWhiteSpace(); + debug(2,"arggstring=%s\n",m_argsstring.data()); +} + void MemberHandler::startParam(const QXmlAttributes& attrib) { ParamHandler *paramHandler = new ParamHandler(this); @@ -515,3 +591,8 @@ IDocRoot *MemberHandler::detailedDescription() const return m_detailed; } +IDocRoot *MemberHandler::inbodyDescription() const +{ + return m_inbody; +} + diff --git a/addon/doxmlparser/src/memberhandler.h b/addon/doxmlparser/src/memberhandler.h index 4897fa2..f1af61e 100644 --- a/addon/doxmlparser/src/memberhandler.h +++ b/addon/doxmlparser/src/memberhandler.h @@ -129,8 +129,17 @@ class MemberHandler : public IDefine, virtual void startType(const QXmlAttributes& attrib); virtual void startName(const QXmlAttributes& attrib); virtual void endName(); + virtual void startRead(const QXmlAttributes& attrib); + virtual void endRead(); + virtual void startWrite(const QXmlAttributes& attrib); + virtual void endWrite(); + virtual void startDefinition(const QXmlAttributes& attrib); + virtual void endDefinition(); + virtual void startArgsString(const QXmlAttributes& attrib); + virtual void endArgsString(); virtual void startBriefDesc(const QXmlAttributes& attrib); virtual void startDetailedDesc(const QXmlAttributes& attrib); + virtual void startInbodyDesc(const QXmlAttributes& attrib); virtual void startLocation(const QXmlAttributes& attrib); virtual void startReferences(const QXmlAttributes& attrib); virtual void endReferences(); @@ -165,10 +174,30 @@ class MemberHandler : public IDefine, { return &m_virtualness; } virtual const IString *name() const { return &m_name; } + virtual const IString *readAccessor() const + { return &m_read; } + virtual const IString *writeAccessor() const + { return &m_write; } + virtual const IString *definition() const + { return &m_definition; } + virtual const IString *argsstring() const + { return &m_argsstring; } virtual bool isConst() const { return m_isConst; } virtual bool isVolatile() const { return m_isVolatile; } + virtual bool isStatic() const + { return m_isStatic; } + virtual bool isExplicit() const + { return m_isExplicit; } + virtual bool isInline() const + { return m_isInline; } + virtual bool isMutable() const + { return m_isMutable; } + virtual bool isReadable() const + { return m_isReadable; } + virtual bool isWritable() const + { return m_isWritable; } virtual ILinkedTextIterator *type() const; virtual const IString *typeString() const; virtual IParamIterator *parameters() const; @@ -190,6 +219,7 @@ class MemberHandler : public IDefine, virtual IMemberReferenceIterator *reimplementedBy() const; virtual IDocRoot *briefDescription() const; virtual IDocRoot *detailedDescription() const; + virtual IDocRoot *inbodyDescription() const; // IEnum virtual IMemberIterator *enumValues() const; @@ -212,8 +242,13 @@ class MemberHandler : public IDefine, 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; @@ -230,6 +265,12 @@ class MemberHandler : public IDefine, 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; }; class MemberIterator : public BaseIteratorViastartDoc(attrib); + m_brief = docHandler; +} + ILinkedTextIterator *ParamHandler::type() const { return new LinkedTextIterator(m_type); @@ -138,4 +149,10 @@ ILinkedTextIterator *ParamHandler::defaultValue() const return new LinkedTextIterator(m_defVal); } +IDocRoot *ParamHandler::briefDescription() const +{ + return m_brief; +} + + diff --git a/addon/doxmlparser/src/paramhandler.h b/addon/doxmlparser/src/paramhandler.h index ee88a70..c4c4c10 100644 --- a/addon/doxmlparser/src/paramhandler.h +++ b/addon/doxmlparser/src/paramhandler.h @@ -27,6 +27,7 @@ class LinkedTextImpl; class LinkedTextHandler; +class DocHandler; class ParamHandler : public IParam, public BaseHandler @@ -40,6 +41,7 @@ class ParamHandler : public IParam, public BaseHandler virtual void endAttrib(); virtual void endArray(); virtual void startDefVal(const QXmlAttributes& attrib); + virtual void startBriefDesc(const QXmlAttributes& attrib); ParamHandler(IBaseHandler *parent); virtual ~ParamHandler(); @@ -51,9 +53,11 @@ class ParamHandler : public IParam, public BaseHandler virtual const IString * attrib() const { return &m_attrib; } virtual const IString * arraySpecifier() const { return &m_array; } virtual ILinkedTextIterator *defaultValue() const; + virtual IDocRoot *briefDescription() const; private: IBaseHandler *m_parent; + DocHandler *m_brief; QList m_type; StringImpl m_declName; StringImpl m_defName; diff --git a/addon/doxmlparser/test/main.cpp b/addon/doxmlparser/test/main.cpp index d203285..8bf9dd2 100644 --- a/addon/doxmlparser/test/main.cpp +++ b/addon/doxmlparser/test/main.cpp @@ -130,10 +130,25 @@ void DumpDoc(IDoc *doc,int level) InPrint(("\n")); } break; + case IDoc::ParameterItem: + { + IDocParameterItem *item = dynamic_cast(doc); + InPrint(("\n")); + IDocIterator *di = item->paramNames(); + IDoc *pdoc; + for (di->toFirst();(pdoc=di->current());di->toNext()) + { + DumpDoc(pdoc,level+1); + } + di->release(); + DumpDoc(item->description(),level+1); + InPrint(("\n")); + } + break; case IDoc::ParameterList: { IDocParameterList *list = dynamic_cast(doc); - InPrint(("\n",list->listType())); + InPrint(("\n",list->sectType())); IDocIterator *di = list->params(); IDoc *pdoc; for (di->toFirst();(pdoc=di->current());di->toNext()) @@ -149,9 +164,7 @@ void DumpDoc(IDoc *doc,int level) { IDocParameter *par = dynamic_cast(doc); ASSERT(par!=0); - InPrint(("\n",par->name()->latin1())); - DumpDoc(par->description(),level+1); - InPrint(("\n")); + InPrint(("\n",par->name()->latin1())); } break; case IDoc::SimpleSect: diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp index 8e439e7..084ad95 100644 --- a/addon/doxywizard/expert.cpp +++ b/addon/doxywizard/expert.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "expert.h" #include "inputbool.h" @@ -71,6 +72,7 @@ Expert::Expert( QWidget *parent ) : QTabDialog( parent ) view->addChild(page); addTab(view,option->name()); QWhatsThis::add(page, option->docs().simplifyWhiteSpace() ); + QToolTip::add(page, option->docs() ); } break; case ConfigOption::O_String: @@ -91,6 +93,7 @@ Expert::Expert( QWidget *parent ) : QTabDialog( parent ) ); pageLayout->addWidget(inputString); QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace() ); + QToolTip::add(inputString,option->docs()); connect(inputString,SIGNAL(changed()),SIGNAL(changed())); m_inputWidgets->insert(option->name(),inputString); addDependency(m_switches,option->dependsOn(),option->name()); @@ -113,6 +116,7 @@ Expert::Expert( QWidget *parent ) : QTabDialog( parent ) } inputString->init(); QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace() ); + QToolTip::add(inputString, option->docs()); connect(inputString,SIGNAL(changed()),SIGNAL(changed())); m_inputWidgets->insert(option->name(),inputString); addDependency(m_switches,option->dependsOn(),option->name()); @@ -137,6 +141,7 @@ Expert::Expert( QWidget *parent ) : QTabDialog( parent ) ); pageLayout->addWidget(inputStrList); QWhatsThis::add(inputStrList, option->docs().simplifyWhiteSpace() ); + QToolTip::add(inputStrList, option->docs()); connect(inputStrList,SIGNAL(changed()),SIGNAL(changed())); m_inputWidgets->insert(option->name(),inputStrList); addDependency(m_switches,option->dependsOn(),option->name()); @@ -153,6 +158,7 @@ Expert::Expert( QWidget *parent ) : QTabDialog( parent ) ); pageLayout->addWidget(inputBool); QWhatsThis::add(inputBool, option->docs().simplifyWhiteSpace() ); + QToolTip::add(inputBool, option->docs() ); connect(inputBool,SIGNAL(changed()),SIGNAL(changed())); m_inputWidgets->insert(option->name(),inputBool); addDependency(m_switches,option->dependsOn(),option->name()); @@ -170,6 +176,7 @@ Expert::Expert( QWidget *parent ) : QTabDialog( parent ) ); pageLayout->addWidget(inputInt); QWhatsThis::add(inputInt, option->docs().simplifyWhiteSpace() ); + QToolTip::add(inputInt, option->docs() ); connect(inputInt,SIGNAL(changed()),SIGNAL(changed())); m_inputWidgets->insert(option->name(),inputInt); addDependency(m_switches,option->dependsOn(),option->name()); diff --git a/doc/commands.doc b/doc/commands.doc index 17f02eb..b3af6d0 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -1986,25 +1986,22 @@ class C {}; \section cmdamp \& \addindex \\\& - This command writes the \& character to the HTML and - \f$\mbox{\LaTeX}\f$ output. This character has to be escaped because - it has a special meaning in HTML. + This command writes the \& character to output. + This character has to be escaped because it has a special meaning in HTML.
\section cmddollar \$ \addindex \\\$ - This command writes the \$ character to the HTML and - \f$\mbox{\LaTeX}\f$ output. This - character has to be escaped in some cases, because it is used to expand + This command writes the \$ character to the output. + This character has to be escaped in some cases, because it is used to expand environment variables.
\section cmdhash \# \addindex \\\# - This command writes the \# character to the HTML and - \f$\mbox{\LaTeX}\f$ output. This + This command writes the \# character to the output. This character has to be escaped in some cases, because it is used to refer to documented entities. @@ -2012,23 +2009,20 @@ class C {}; \section cmdlt \< \addindex \\\< - This command writes the \< character to the HTML and - \f$\mbox{\LaTeX}\f$ output. This - character has to be escaped because it has a special meaning in HTML. + This command writes the \< character to the output. + This character has to be escaped because it has a special meaning in HTML.
\section cmdgt \> \addindex \\\> - This command writes the \> character to the HTML and - \f$\mbox{\LaTeX}\f$ output. This + This command writes the \> character to the output. This character has to be escaped because it has a special meaning in HTML. \section cmdperc \% \addindex \\\% - This command writes the \% character to the HTML and - \f$\mbox{\LaTeX}\f$ output. This + This command writes the \% character to the output. This character has to be escaped in some cases, because it is used to prevent auto-linking to word that is also a documented class or struct. diff --git a/doc/language.doc b/doc/language.doc index 3da32a9..a56a419 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration file (with default name and known as Doxyfile). -Currently (version 1.3.8-20040907), 30 languages +Currently (version 1.3.8-20040913), 30 languages are supported (sorted alphabetically): Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, @@ -90,7 +90,7 @@ when the translator was updated. Czech Petr Přikryl prikrylp at skil dot cz - 1.3.9 + up-to-date Danish @@ -186,7 +186,7 @@ when the translator was updated. Polish Piotr Kaminski
Grzegorz Kowal Piotr.Kaminski at ctm dot gdynia dot pl
g_kowal at poczta dot onet dot pl - 1.3.9 + up-to-date Portuguese @@ -271,7 +271,7 @@ when the translator was updated. \hline Croatian & Boris Bralo & {\tt\tiny boris.bralo@zg.htnet.hr} & 1.3.9 \\ \hline - Czech & Petr P\v{r}ikryl & {\tt\tiny prikrylp@skil.cz} & 1.3.9 \\ + Czech & Petr P\v{r}ikryl & {\tt\tiny prikrylp@skil.cz} & up-to-date \\ \hline Danish & Erik S\o{}e S\o{}rensen & {\tt\tiny eriksoe+doxygen@daimi.au.dk} & 1.3.9 \\ \hline @@ -309,7 +309,7 @@ when the translator was updated. \hline Norwegian & Lars Erik Jordet & {\tt\tiny lejordet@gmail.com} & 1.3.9 \\ \hline - Polish & Piotr Kaminski & {\tt\tiny Piotr.Kaminski@ctm.gdynia.pl} & 1.3.9 \\ + Polish & Piotr Kaminski & {\tt\tiny Piotr.Kaminski@ctm.gdynia.pl} & up-to-date \\ ~ & Grzegorz Kowal & {\tt\tiny g\_kowal@poczta.onet.pl} & ~ \\ \hline Portuguese & Rui Godinho Lopes & {\tt\tiny ruiglopes@yahoo.com} & 1.3.3 \\ diff --git a/doc/translator_report.txt b/doc/translator_report.txt index 1ad728c..924252f 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -1,4 +1,4 @@ -(1.3.8-20040907) +(1.3.8-20040913) Doxygen supports the following 30 languages (sorted alphabetically): @@ -8,7 +8,7 @@ German, Greek, Hungarian, Italian, Japanese (+En), Korean (+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. -Of them, 2 translators are up-to-date, 28 translators are based on +Of them, 4 translators are up-to-date, 26 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -17,8 +17,10 @@ alphabetically). This means that they derive from the Translator class and they implement all 201 of the required methods. Anyway, there still may be some details listed even for them: + TranslatorCzech TranslatorDutch TranslatorEnglish + TranslatorPolish ---------------------------------------------------------------------- The following translator classes need some maintenance (the most @@ -27,14 +29,12 @@ version when the class was last updated and number of methods that must be implemented to become up-to-date: TranslatorRussian 1.3.9 6 methods to implement - TranslatorPolish 1.3.9 6 methods to implement TranslatorNorwegian 1.3.9 6 methods to implement TranslatorJapanese 1.3.9 6 methods to implement TranslatorItalian 1.3.9 6 methods to implement TranslatorHungarian 1.3.9 6 methods to implement TranslatorGerman 1.3.9 6 methods to implement TranslatorDanish 1.3.9 6 methods to implement - TranslatorCzech 1.3.9 6 methods to implement TranslatorCroatian 1.3.9 6 methods to implement TranslatorChinese 1.3.9 6 methods to implement TranslatorBrazilian 1.3.9 6 methods to implement @@ -175,21 +175,6 @@ TranslatorCroatian (TranslatorAdapter_1_3_9) 6 methods to implement virtual QCString trDir(bool first_capital, bool singular) -TranslatorCzech (TranslatorAdapter_1_3_9) 6 methods to implement ---------------- - - Implements 195 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trDirIndex() - virtual QCString trDirDocumentation() - virtual QCString trDirectories() - virtual QCString trDirDescription() - virtual QCString trDirReference(const char * dirName) - virtual QCString trDir(bool first_capital, bool singular) - - TranslatorDanish (TranslatorAdapter_1_3_9) 6 methods to implement ---------------- @@ -511,21 +496,6 @@ TranslatorNorwegian (TranslatorAdapter_1_3_9) 6 methods to implement virtual QCString trDir(bool first_capital, bool singular) -TranslatorPolish (TranslatorAdapter_1_3_9) 6 methods to implement ----------------- - - Implements 195 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trDirIndex() - virtual QCString trDirDocumentation() - virtual QCString trDirectories() - virtual QCString trDirDescription() - virtual QCString trDirReference(const char * dirName) - virtual QCString trDir(bool first_capital, bool singular) - - TranslatorPortuguese (TranslatorAdapter_1_3_3) 11 methods to implement -------------------- diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 4cb6d0a..d71a65d 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.3.8_20040913 +Version: 1.3.8_20040928 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/code.l b/src/code.l index 73f432c..a343058 100644 --- a/src/code.l +++ b/src/code.l @@ -297,9 +297,12 @@ class CallContext virtual ~CallContext() {} void setClass(ClassDef *cd) { - DBG_CTX((stderr,"** Set call context %s (%p)\n",cd==0 ? "" : cd->name().data(),cd)); - m_classList.removeLast(); - m_classList.append(cd); + if (cd) + { + DBG_CTX((stderr,"** Set call context %s (%p)\n",cd==0 ? "" : cd->name().data(),cd)); + m_classList.removeLast(); + m_classList.append(cd); + } } void pushScope() { @@ -744,11 +747,11 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, { className+="-p"; } - ClassDef *cd=0; + ClassDef *cd=0,*lcd=0; MemberDef *md=0; - //printf("generateClassOrGlobalLink(className=%s)\n",className.data()); - if (!g_theVarContext.findVariable(className)) // not a local variable + //fprintf(stderr,"generateClassOrGlobalLink(className=%s)\n",className.data()); + if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable { Definition *d = g_currentDefinition; //printf("d=%p g_sourceFileDef=%p\n",d,g_currentDefinition); @@ -761,11 +764,12 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, } else { - //printf("is a local variable!\n"); + if (lcd!=VariableContext::dummyContext) g_theCallContext.setClass(lcd); + //fprintf(stderr,"is a local variable!\n"); } if (cd && cd->isLinkable()) // is it a linkable class { - //printf("is linkable class %s\n",clName); + //fprintf(stderr,"is linkable class %s\n",clName); if (g_exampleBlock) { QCString anchor; @@ -926,7 +930,9 @@ static bool generateClassMemberLink(BaseCodeDocInterface &ol,ClassDef *mcd,const } } - g_theCallContext.setClass(stripClassName(xmd->typeString())); + ClassDef *typeClass = stripClassName(xmd->typeString()); + //fprintf(stderr,"%s -> typeName=%p\n",xmd->typeString(),typeClass); + g_theCallContext.setClass(typeClass); Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ? xmd->getBodyDef() : xmd->getOuterScope(); @@ -1755,7 +1761,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) BEGIN( Body ); } [*&]+ { - addType(); + g_type=g_curClassName; + g_name.resize(0); g_code->codify(yytext); BEGIN( Body ); // variable of type struct * } @@ -2121,6 +2128,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) {SCOPENAME}/{B}* { if (g_theCallContext.getClass()) { + //fprintf(stderr,"g_theCallContext.getClass()=%p\n",g_theCallContext.getClass()); if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext)) { g_code->codify(yytext); @@ -2130,6 +2138,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) } else { + //fprintf(stderr,"no class context!\n"); g_code->codify(yytext); addToSearchIndex(yytext); g_name.resize(0); @@ -2167,7 +2176,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) g_code->codify(yytext); g_saveName = g_name.copy(); g_saveType = g_type.copy(); - if (!g_type.isEmpty()) + if (*yytext!='[' && !g_type.isEmpty()) { if (g_scopeStack.top()!=CLASSBLOCK) { @@ -2175,7 +2184,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) } g_name.resize(0); } - if (*yytext==';') + if (*yytext==';' || *yytext=='=') { g_type.resize(0); g_name.resize(0); @@ -2388,7 +2397,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) BEGIN( SkipInits ); } } -({BN}"const"|"volatile")*{BN}*"{" { +("const"|"volatile")({BN}+("const"|"volatile"))*{BN}*/";" { + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + } +("const"|"volatile")*({BN}+("const"|"volatile"))*"{" { if (g_insideBody) { g_theVarContext.pushScope(); @@ -2878,6 +2892,7 @@ static void restoreObjCContext() void initParseCodeContext() { + //printf("***initParseCodeContext()\n"); g_theVarContext.clear(); g_codeClassSDict.setAutoDelete(TRUE); g_codeClassSDict.clear(); @@ -2889,6 +2904,7 @@ void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s, bool exBlock, const char *exName,FileDef *fd, int startLine,int endLine,bool inlineFragment) { + //printf("***parseCode()\n"); if (s.isEmpty()) return; g_code = &od; g_inputString = s; diff --git a/src/compound.xsd b/src/compound.xsd index c35c917..bdbf498 100644 --- a/src/compound.xsd +++ b/src/compound.xsd @@ -216,12 +216,12 @@ - + - + @@ -528,12 +528,25 @@ - + - + + + + + + + + - + + + + + + + @@ -543,13 +556,6 @@ - - - - - - - diff --git a/src/compound_xsd.h b/src/compound_xsd.h index f7a6381..a938f18 100644 --- a/src/compound_xsd.h +++ b/src/compound_xsd.h @@ -216,12 +216,12 @@ "\n" " \n" " \n" -" \n" +" \n" " \n" "\n" " \n" " \n" -" \n" +" \n" " \n" " \n" "\n" @@ -528,12 +528,25 @@ " \n" " \n" "\n" -" \n" +" \n" " \n" -" \n" +" \n" +" \n" +" \n" +" \n" +"\n" +" \n" +" \n" +" \n" " \n" " \n" -" \n" +" \n" +"\n" +" \n" +" \n" +" \n" +" \n" +" \n" "\n" " \n" " \n" @@ -543,13 +556,6 @@ " \n" " \n" "\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -"\n" " \n" " \n" " \n" diff --git a/src/config.l b/src/config.l index 96357a5..1b73bbd 100644 --- a/src/config.l +++ b/src/config.l @@ -1113,6 +1113,7 @@ void Config::check() filePatternList.append("*.inc"); filePatternList.append("*.m"); filePatternList.append("*.mm"); + filePatternList.append("*.dox"); #if !defined(_WIN32) // unix => case sensitive match => also include useful uppercase versions filePatternList.append("*.C"); diff --git a/src/defargs.l b/src/defargs.l index 0a5d5ec..da76d9c 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -283,7 +283,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* if (fi>=0) { a->type = g_curArgTypeName.left(fi+1); - a->name = g_curArgTypeName.mid(fi+1,bi-fi-1); + a->name = g_curArgTypeName.mid(fi+1,bi-fi-1).stripWhiteSpace(); a->array = g_curArgTypeName.right(l-bi); } else @@ -294,7 +294,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* else if (i>=0 && g_curArgTypeName.at(i)!=':') { // type contains a name a->type = removeRedundantWhiteSpace(g_curArgTypeName.left(i+1)); - a->name = g_curArgTypeName.right(l-i-1); + a->name = g_curArgTypeName.right(l-i-1).stripWhiteSpace(); } else // assume only the type was specified, try to determine name later { diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 66ab173..6e192af 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -127,6 +127,14 @@ void DirDef::writeDocumentation(OutputList &ol) ol.popGeneratorState(); } + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + Doxygen::tagFile << " " << endl; + Doxygen::tagFile << " " << convertToXML(displayName()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(name()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; + } + ol.startMemberSections(); // write subdir list @@ -144,6 +152,10 @@ void DirDef::writeDocumentation(OutputList &ol) ol.insertMemberAlign(); ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName()); ol.endMemberItem(); + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + Doxygen::tagFile << " " << convertToXML(dd->displayName()) << "" << endl; + } if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { ol.startMemberDescription(); @@ -156,7 +168,6 @@ void DirDef::writeDocumentation(OutputList &ol) ol.endMemberList(); } - // write file list if (m_fileList->count()>0) @@ -169,13 +180,22 @@ void DirDef::writeDocumentation(OutputList &ol) while (fd) { ol.startMemberItem(0); - ol.docify("file "); + ol.docify(theTranslator->trFile(FALSE,TRUE)+" "); ol.insertMemberAlign(); - ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name()); - //if (!Config_getString("GENERATE_TAGFILE").isEmpty()) - //{ - // Doxygen::tagFile << " " << convertToXML(fd->name()) << "" << endl; - //} + if (fd->isLinkable()) + { + ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name()); + } + else + { + ol.startBold(); + ol.writeString(fd->name()); + ol.endBold(); + } + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + Doxygen::tagFile << " " << convertToXML(fd->name()) << "" << endl; + } ol.endMemberItem(); if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { @@ -190,13 +210,17 @@ void DirDef::writeDocumentation(OutputList &ol) } ol.endMemberSections(); - if (!Config_getBool("DETAILS_AT_TOP")) + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { - writeDetailedDocumentation(ol); + writeDocAnchorsToTagFile(); + Doxygen::tagFile << " " << endl; } - // write details (if !DETAILS_AT_TOP) + if (!Config_getBool("DETAILS_AT_TOP")) + { + writeDetailedDocumentation(ol); + } endFile(ol); ol.popGeneratorState(); @@ -293,7 +317,7 @@ void buildDirectories() for (;(fd=fni.current());++fni) { //printf("buildDirectories %s\n",fd->name().data()); - if (fd->getReference().isEmpty()) + if (fd->getReference().isEmpty() && !fd->isDocumentationFile()) { DirDef *dir; if ((dir=Doxygen::directories.find(fd->getPath()))==0) // new directory diff --git a/src/dirdef.h b/src/dirdef.h index 0f24646..90ede70 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -32,7 +32,7 @@ class OutputList; class DirDef; -class DirDefList : public QList +class DirList : public QList { public: int compareItems(GCI item1,GCI item2); @@ -67,7 +67,7 @@ class DirDef : public Definition static DirDef *createNewDir(const char *path); static bool matchPath(const QCString &path,QStrList &l); - DirDefList m_subdirs; + DirList m_subdirs; QCString m_dispName; QCString m_shortName; FileList *m_fileList; // list of files in the group @@ -75,7 +75,7 @@ class DirDef : public Definition int m_dirCount; }; -inline int DirDefList::compareItems(GCI item1,GCI item2) +inline int DirList::compareItems(GCI item1,GCI item2) { return stricmp(((DirDef *)item1)->shortName(),((DirDef *)item2)->shortName()); } diff --git a/src/dot.cpp b/src/dot.cpp index 4b9f11b..670911e 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -33,6 +33,10 @@ #include #include +// Enable this for transparent images +// It doesn't seems to work very well with edge labels so I disabled it. +//#define DOT_TRANSPARENT + //-------------------------------------------------------------------- static const int maxCmdLine = 40960; @@ -68,6 +72,9 @@ static void writeGraphHeader(QTextStream &t) { t << "digraph G" << endl; t << "{" << endl; +#if defined(DOT_TRANSPARENT) + t << " bgcolor=\"transparent\"" << endl; +#endif t << " edge [fontname=\"Helvetica\",fontsize=10," "labelfontname=\"Helvetica\",labelfontsize=10];\n"; t << " node [fontname=\"Helvetica\",fontsize=10,shape=record];\n"; @@ -586,7 +593,11 @@ void DotNode::writeBox(QTextStream &t, } else { +#if defined(DOT_TRANSPARENT) + t << ",color=\"" << labCol << "\", fillcolor=\"white\", style=\"filled\""; +#else t << ",color=\"" << labCol << "\""; +#endif if (!m_url.isEmpty()) { int anchorPos = m_url.findRev('#'); @@ -2327,8 +2338,30 @@ bool DotCallGraph::isTrivial() const //------------------------------------------------------------- -DotDirDeps::DotDirDeps(DirDef *) +DotDirDeps::DotDirDeps(DirDef *dd) { + FileList *fl = dd->getFiles(); + if (fl) + { + QListIterator fli(*fl); + FileDef *fd; + for (fli.toFirst();(fd=fli.current());++fli) // foreach file in dir dd + { + QList *ifl = fd->includeFileList(); + if (ifl) + { + QListIterator ifli(*ifl); + IncludeInfo *ii; + for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file + { + if (ii->fileDef) + { + // add dependency + } + } + } + } + } } DotDirDeps::~DotDirDeps() diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 588f401..6419935 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -4621,6 +4621,7 @@ static void findMember(Entry *root, if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName); ClassDef *tcd=findClassDefinition(fd,nd,scopeName); + //printf("*** cd=%s tcd=%s fd=%s\n",cd->name().data(),tcd->name().data(),fd->name().data()); if (cd && tcd==cd) // member's classes match { @@ -4859,7 +4860,7 @@ static void findMember(Entry *root, } } } - else // member specialization + else if (cd) // member specialization { MemberDef::MemberType mtype=MemberDef::Function; ArgumentList *tArgList = new ArgumentList; @@ -4894,6 +4895,11 @@ static void findMember(Entry *root, cd->insertMember(md); md->setRefItems(root->sli); } + else + { + //printf("Specialized member %s of unknown scope %s%s found!\n", + // scopeName.data(),funcName.data(),funcArgs.data()); + } } else if (overloaded) // check if the function belongs to only one class { @@ -6496,6 +6502,7 @@ static void findDirDocumentation(Entry *root) //printf("Match for with dir %s\n",matchingDir->name().data()); matchingDir->setBriefDescription(root->brief,root->briefFile,root->briefLine); matchingDir->setDocumentation(root->doc,root->docFile,root->docLine); + addDirToGroups(root,matchingDir); } else { @@ -8284,14 +8291,14 @@ void parseInput() msg("Freeing input...\n"); input.resize(0); - msg("Building directory list...\n"); - buildDirectories(); - findDirDocumentation(root); - msg("Building group list...\n"); buildGroupList(root); organizeSubGroups(root); + msg("Building directory list...\n"); + buildDirectories(); + findDirDocumentation(root); + msg("Building namespace list...\n"); buildNamespaceList(root); findUsingDirectives(root); diff --git a/src/filedef.cpp b/src/filedef.cpp index fbadd59..32c0a5f 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1110,4 +1110,9 @@ void FileDef::combineUsingRelations() } } - +bool FileDef::isDocumentationFile() const +{ + return name().right(4)==".doc" || + name().right(4)==".txt" || + name().right(4)==".dox"; +} diff --git a/src/filedef.h b/src/filedef.h index bceb878..2af7f94 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -156,6 +156,7 @@ class FileDef : public Definition void addIncludedUsingDirectives(); void addListReferences(); + bool isDocumentationFile() const; //void generateXML(QTextStream &t); //void generateXMLSection(QTextStream &t,MemberList *ml,const char *type); diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 5a032c2..7fdcd41 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -43,6 +43,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t, namespaceList = new NamespaceList; pageDict = new PageSDict(257); exampleDict = new PageSDict(257); + dirList = new DirList; allMemberList = new MemberList; allMemberNameInfoSDict = new MemberNameInfoSDict(17); if (refFileName) @@ -86,6 +87,7 @@ GroupDef::~GroupDef() delete allMemberList; delete allMemberNameInfoSDict; delete memberGroupSDict; + delete dirList; } void GroupDef::setGroupTitle( const char *t ) @@ -155,6 +157,14 @@ void GroupDef::addNamespace(const NamespaceDef *def) namespaceList->append(def); } +void GroupDef::addDir(const DirDef *def) +{ + if (Config_getBool("SORT_BRIEF_DOCS")) + dirList->inSort(def); + else + dirList->append(def); +} + void GroupDef::addPage(PageDef *def) { //printf("Making page %s part of a group\n",def->name.data()); @@ -516,7 +526,7 @@ void GroupDef::writeDocumentation(OutputList &ol) while (fd) { ol.startMemberItem(0); - ol.docify("file "); + ol.docify(theTranslator->trFile(FALSE,TRUE)+" "); ol.insertMemberAlign(); ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name()); if (!Config_getString("GENERATE_TAGFILE").isEmpty()) @@ -599,6 +609,39 @@ void GroupDef::writeDocumentation(OutputList &ol) ol.endMemberList(); } + // write list of directories + if (dirList->count()>0) + { + ol.startMemberHeader(); + ol.parseText(theTranslator->trDirectories()); + ol.endMemberHeader(); + ol.startMemberList(); + DirDef *dd=dirList->first(); + while (dd) + { + ol.startMemberItem(0); + ol.parseText(theTranslator->trDir(FALSE,TRUE)); + ol.insertMemberAlign(); + ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName()); + ol.endMemberItem(); + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + Doxygen::tagFile << " " << convertToXML(dd->displayName()) << "" << endl; + } + if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) + { + ol.startMemberDescription(); + ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE); + ol.endMemberDescription(); + ol.newParagraph(); + } + dd=dirList->next(); + } + + ol.endMemberList(); + } + + // write list of classes classSDict->writeDeclaration(ol); @@ -719,6 +762,24 @@ void addNamespaceToGroups(Entry *root,NamespaceDef *nd) } } +void addDirToGroups(Entry *root,DirDef *dd) +{ + //printf("*** root->groups->count()=%d\n",root->groups->count()); + QListIterator gli(*root->groups); + Grouping *g; + for (;(g=gli.current());++gli) + { + GroupDef *gd=0; + //printf("group `%s'\n",g->groupname.data()); + if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname])) + { + gd->addDir(dd); + dd->makePartOfGroup(gd); + //printf("Dir %s: in group %s\n",dd->name().data(),g->groupname.data()); + } + } +} + void addGroupToGroups(Entry *root,GroupDef *subGroup) { QListIterator gli(*root->groups); diff --git a/src/groupdef.h b/src/groupdef.h index 879b2a2..86f4e7a 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -37,6 +37,8 @@ class MemberGroupSDict; class MemberNameInfoSDict; class PageSDict; class PageDef; +class DirDef; +class DirList; class GroupDef : public Definition { @@ -53,8 +55,9 @@ class GroupDef : public Definition void addNamespace(const NamespaceDef *def); void addGroup(const GroupDef *def); void addParentGroup(const GroupDef *def); - void addPage(PageDef *def); // pages in this group - void addExample(const PageDef *def); // examples in this group + void addPage(PageDef *def); + void addExample(const PageDef *def); + void addDir(const DirDef *dd); bool insertMember(MemberDef *def,bool docOnly=FALSE); void removeMember(MemberDef *md); bool containsGroup(const GroupDef *def); // true if def is already a subgroup @@ -108,6 +111,7 @@ class GroupDef : public Definition NamespaceList * getNamespaces() const { return namespaceList; } GroupList * getSubGroups() const { return groupList; } PageSDict * getPages() const { return pageDict; } + DirList * getDirs() const { return dirList; } protected: void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); @@ -122,6 +126,7 @@ class GroupDef : public Definition GroupList *groupList; // list of sub groups. PageSDict *pageDict; // list of pages in the group PageSDict *exampleDict; // list of examples in the group + DirList *dirList; // list of directories in the group MemberList *allMemberList; MemberNameInfoSDict *allMemberNameInfoSDict; @@ -153,6 +158,7 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup); void addMemberToGroups(Entry *root,MemberDef *md); void addPageToGroups(Entry *root,PageDef *pd); void addExampleToGroups(Entry *root,PageDef *eg); +void addDirToGroups(Entry *root,DirDef *dd); #endif diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index dac75a1..53e2520 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1375,13 +1375,6 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, t << fixSpaces(theTranslator->trModules()); endQuickIndexItem(t); } - if (Config_getBool("SHOW_DIRECTORIES") && documentedDirs>0) - { - startQuickIndexItem(t,"dirs"+Doxygen::htmlFileExtension, - hli==HLI_Directories,compact,first,relPath); - t << fixSpaces(theTranslator->trDirectories()); - endQuickIndexItem(t); - } if (documentedNamespaces>0) { startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, @@ -1417,6 +1410,13 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, t << fixSpaces(theTranslator->trCompoundList()); endQuickIndexItem(t); } + if (Config_getBool("SHOW_DIRECTORIES") && documentedDirs>0) + { + startQuickIndexItem(t,"dirs"+Doxygen::htmlFileExtension, + hli==HLI_Directories,compact,first,relPath); + t << fixSpaces(theTranslator->trDirectories()); + endQuickIndexItem(t); + } if (documentedHtmlFiles>0) { startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, diff --git a/src/index.cpp b/src/index.cpp index 307ec64..d4d2fc4 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -696,13 +696,6 @@ void writeGraphicalClassHierarchy(OutputList &ol) //---------------------------------------------------------------------------- -static bool nameIsOk(FileDef *fd) -{ - return fd->name().right(4)!=".doc" && - fd->name().right(4)!=".txt" && - fd->name().right(4)!=".dox"; -} - void countFiles(int &htmlFiles,int &files) { htmlFiles=0; @@ -717,7 +710,7 @@ void countFiles(int &htmlFiles,int &files) { bool doc = fd->isLinkableInProject(); bool src = fd->generateSourceFile(); - bool nameOk = nameIsOk(fd); + bool nameOk = !fd->isDocumentationFile(); if (nameOk) { if (doc || src) @@ -823,7 +816,7 @@ void writeFileIndex(OutputList &ol) //printf("Found filedef %s\n",fd->name().data()); bool doc = fd->isLinkableInProject(); bool src = fd->generateSourceFile(); - bool nameOk = nameIsOk(fd); + bool nameOk = !fd->isDocumentationFile(); if (nameOk && (doc || src) && !fd->isReference()) { @@ -2870,13 +2863,13 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count()); if (htmlHelp) { - htmlHelp->addContentsItem(isDir,dd->displayName(),dd->getOutputFileBase()); + htmlHelp->addContentsItem(isDir,dd->shortName(),dd->getOutputFileBase()); htmlHelp->incContentsDepth(); } if (ftvHelp) { ftvHelp->addContentsItem(isDir,dd->getReference(),dd->getOutputFileBase(), - 0,dd->displayName()); + 0,dd->shortName()); ftvHelp->incContentsDepth(); } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 002352c..4d505f4 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -133,16 +133,26 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, while (a) { if (md->isDefine() || first) ol.startParameterType(first,md->isObjCMethod()?"dummy":0); - QRegExp re(")("); - int vp; + QRegExp re(")("),res("(.*\\*"); + int vp=a->type.find(re); + int wp=a->type.find(res); + + // use the following to put the function pointer type before the name + bool hasFuncPtrType=FALSE; + + // or use the following to put the function pointer as it appears in + // the prototype. + // bool hasFuncPtrType=vp!=-1 && wp!=-1 && wpattrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute { ol.docify(a->attrib+" "); } - if ((vp=a->type.find(re))!=-1) // argument type is a function pointer + if (hasFuncPtrType) // argument type is a function pointer { //printf("a->type=`%s' a->name=`%s'\n",a->type.data(),a->name.data()); QCString n=a->type.left(vp); + if (hasFuncPtrType) n=a->type.left(wp); if (md->isObjCMethod()) { n.prepend("("); n.append(")"); } if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); @@ -162,9 +172,16 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ol.endParameterType(); ol.startParameterName(defArgList->count()<2); } + if (hasFuncPtrType) + { + ol.docify(a->type.mid(wp,vp-wp)); + } if (!a->name.isEmpty() || (a->name.isEmpty() && a->type=="...")) // argument has a name { - ol.docify(" "); + if (!hasFuncPtrType); + { + ol.docify(" "); + } ol.disable(OutputGenerator::Man); ol.startEmphasis(); ol.enable(OutputGenerator::Man); @@ -177,8 +194,8 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, { ol.docify(a->array); } - if (vp!=-1) // write the part of the argument type - // that comes after the name + if (hasFuncPtrType) // write the part of the argument type + // that comes after the name { linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(), md->name(),a->type.right(a->type.length()-vp)); @@ -405,6 +422,7 @@ MemberDef::MemberDef(const char *df,int dl, m_cachedTypedefValue = 0; m_inbodyLine = -1; m_implOnly=FALSE; + groupMember = 0; } /*! Destroys the member definition. */ @@ -1783,6 +1801,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, writeSourceReffedBy(ol,cname); writeInlineCode(ol,cname); + ol.endIndent(); + if ((m_hasCallGraph || Config_getBool("CALL_GRAPH")) && isFunction() && Config_getBool("HAVE_DOT") ) @@ -1800,7 +1820,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } } - ol.endIndent(); // enable LaTeX again //if (Config_getBool("EXTRACT_ALL") && !hasDocs) ol.enable(OutputGenerator::Latex); ol.popGeneratorState(); @@ -1976,6 +1995,8 @@ bool MemberDef::hasOneLineInitializer() const bool MemberDef::hasMultiLineInitializer() const { + //printf("initLines=%d userInitLines=%d maxInitLines=%d\n", + // initLines,userInitLines,maxInitLines); return initLines>0 && ((initLines=0 && isspace((uchar)init.at(p))) p--; diff --git a/src/memberlist.cpp b/src/memberlist.cpp index e9ad1e1..5226660 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -76,7 +76,8 @@ void MemberList::countDecMembers() m_funcCnt++,m_numDecMembers++; break; case MemberDef::Enumeration: m_enumCnt++,m_numDecMembers++; break; - case MemberDef::EnumValue: m_enumValCnt++,m_numDecMembers++; break; + case MemberDef::EnumValue: //m_enumValCnt++,m_numDecMembers++; + break; case MemberDef::Typedef: m_typeCnt++,m_numDecMembers++; break; case MemberDef::Prototype: m_protoCnt++,m_numDecMembers++; break; case MemberDef::Define: if (Config_getBool("EXTRACT_ALL") || @@ -92,7 +93,7 @@ void MemberList::countDecMembers() } } } - if (memberGroupList /*&& countSubGroups*/) + if (memberGroupList) { MemberGroupListIterator mgli(*memberGroupList); MemberGroup *mg; @@ -309,10 +310,10 @@ void MemberList::writeDeclarations(OutputList &ol, const char *title,const char *subtitle /*, bool inGroup,bool countSubGroups*/) { - //printf("MemberList::writeDeclaration(title=`%s',subtitle=`%s')\n",title,subtitle); //printf("----- writeDeclaration() ----\n"); countDecMembers(); // count member not in group if (numDecMembers()==0) return; + //printf("MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n",title,subtitle,numDecMembers()); if (title) { ol.startMemberHeader(); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index b11290f..ee4c48b 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -42,6 +42,7 @@ NamespaceDef::NamespaceDef(const char *df,int dl, setReference(lref); memberGroupSDict = new MemberGroupSDict; memberGroupSDict->setAutoDelete(TRUE); + visited=FALSE; } NamespaceDef::~NamespaceDef() diff --git a/src/pre.l b/src/pre.l index 07e8d47..a01b06f 100644 --- a/src/pre.l +++ b/src/pre.l @@ -1055,6 +1055,8 @@ static void readIncludeFile(const QCString &inc) FileDef *oldFileDef = g_yyFileDef; int oldLineNr = g_yyLineNr; //printf("Searching for `%s'\n",incFileName.data()); + + // findFile will overwrite g_yyFileDef if found if ((f=findFile(incFileName,localInclude))) // see if the include file can be found { //printf("Found include file!\n"); @@ -1627,7 +1629,6 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) [^\">\n]+[\">] { g_incName+=yytext; readIncludeFile(g_incName); - BEGIN(Start); } {ID}/"(" { diff --git a/src/scanner.l b/src/scanner.l index 09b6b88..3260974 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -197,6 +197,7 @@ static void initParser() autoGroupStack.setAutoDelete(TRUE); lastDefGroup.groupname.resize(0); insideFormula = FALSE; + insideCode=FALSE; } static void initEntry() @@ -843,6 +844,10 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] %% <*>\x06[^\x06]*\x06 { // new file + if (YY_START==Comment) + { + warn(yyFileName,yyLineNr,"File ended in the middle of a comment block! Perhaps a missing \\endcode?"); + } if (memberGroupId!=DOX_NOGROUP) { warn(yyFileName,yyLineNr,"Warning: Missing //@}"); @@ -1661,6 +1666,10 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] unput(';'); BEGIN(FindMembers); } +"friend"{BN}+("class"|"union"|"struct"){BN}+ { + current->name=yytext; + BEGIN(FindMembers); + } {SCOPENAME} { lineCount(); if (insideIDL && yyleng==9 && strcmp(yytext,"cpp_quote")==0) @@ -2112,7 +2121,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] yyLineNr++; } "@\"" { - printf("insideCS=%d\n",insideCS); + //printf("insideCS=%d\n",insideCS); current->initializer+=yytext; if (!insideCS && !insideObjC) { @@ -2273,7 +2282,6 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->section = Entry::VARIABLE_SEC ; current->fileName = yyFileName; current->startLine = yyLineNr; - //printf("New variable type=`%s' name=`%s' groupId=%d\n",current->type.data(),current->name.data(),current->mGrpId); current_root->addSubEntry( current ) ; } if ( *yytext == ',') @@ -2962,6 +2970,12 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] . { fullArgString+=*yytext; } \n { fullArgString+=*yytext; yyLineNr++; } . { fullArgString+=*yytext; } +{CMD}("brief"|"short"){B}+ { + warn(yyFileName,yyLineNr, + "Warning: Ignoring %cbrief command inside argument documentation",*yytext + ); + fullArgString+=' '; + } "<" { *copyArgString+=*yytext; fullArgString+=*yytext; @@ -3103,8 +3117,10 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] BEGIN(SkipCPP); } "=" { // typically an initialized function pointer - current->args += *yytext; - BEGIN(FuncPtrInit); + //current->args += *yytext; + //BEGIN(FuncPtrInit); + lastInitializerContext=YY_START; + BEGIN(ReadInitializer); } [{;] { unput(*yytext); @@ -4265,7 +4281,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->startLine = yyLineNr; BEGIN( ExampleDocArg1 ); } -{B}*{CMD}"details"{B}+ { /* nop */ +{B}*{CMD}"details"{B}+ { /* nop */ } {CMD}"name"[^\n]*\n { lastDefGroup.groupname.resize(0); @@ -5988,6 +6004,10 @@ void parseMain(Entry *rt) scanYYrestart( scanYYin ); BEGIN( FindMembers ); scanYYlex(); + if (YY_START==Comment) + { + warn(yyFileName,yyLineNr,"File ended in the middle of a comment block! Perhaps a missing \\endcode?"); + } forceEndGroup(); diff --git a/src/search_php.h b/src/search_php.h index 337662c..ffd152a 100644 --- a/src/search_php.h +++ b/src/search_php.h @@ -1,4 +1,3 @@ -"docAnchors.append(m_curString); break; case InMember: m_curMember->docAnchors.append(m_curString); break; case InPackage: m_curPackage->docAnchors.append(m_curString); break; + case InDir: m_curDir->docAnchors.append(m_curString); break; default: err("Error: Unexpected tag `member' found\n"); break; } } @@ -379,6 +400,7 @@ class TagFileParser : public QXmlDefaultHandler switch(m_state) { case InGroup: m_curGroup->fileList.append(m_curString); break; + case InDir: m_curDir->fileList.append(m_curString); break; default: err("Error: Unexpected tag `file' found\n"); break; } } @@ -390,6 +412,14 @@ class TagFileParser : public QXmlDefaultHandler default: err("Error: Unexpected tag `page' found\n"); break; } } + void endDir() + { + switch(m_state) + { + case InDir: m_curDir->subdirList.append(m_curString); break; + default: err("Error: Unexpected tag `page' found\n"); break; + } + } void startStringValue(const QXmlAttributes& ) { m_curString = ""; @@ -414,6 +444,7 @@ class TagFileParser : public QXmlDefaultHandler case InNamespace: m_curNamespace->name = m_curString; break; case InGroup: m_curGroup->name = m_curString; break; case InPage: m_curPage->name = m_curString; break; + case InDir: m_curDir->name = m_curString; break; case InMember: m_curMember->name = m_curString; break; case InPackage: m_curPackage->name = m_curString; break; default: err("Error: Unexpected tag `name' found\n"); break; @@ -510,6 +541,7 @@ class TagFileParser : public QXmlDefaultHandler case InGroup: m_curGroup->filename = m_curString; break; case InPage: m_curPage->filename = m_curString; break; case InPackage: m_curPackage->filename = m_curString; break; + case InDir: m_curDir->filename = m_curString; break; default: err("Error: Unexpected tag `filename' found\n"); break; } } @@ -518,6 +550,7 @@ class TagFileParser : public QXmlDefaultHandler switch (m_state) { case InFile: m_curFile->path = m_curString; break; + case InDir: m_curDir->path = m_curString; break; default: err("Error: Unexpected tag `path' found\n"); break; } } @@ -580,6 +613,7 @@ class TagFileParser : public QXmlDefaultHandler m_curGroup=0; m_curPage=0; m_curPackage=0; + m_curDir=0; m_stateStack.setAutoDelete(TRUE); m_tagFileClasses.setAutoDelete(TRUE); @@ -588,6 +622,7 @@ class TagFileParser : public QXmlDefaultHandler m_tagFileGroups.setAutoDelete(TRUE); m_tagFilePages.setAutoDelete(TRUE); m_tagFilePackages.setAutoDelete(TRUE); + m_tagFileDirs.setAutoDelete(TRUE); m_startElementHandlers.insert("compound", new StartElementHandler(this,&TagFileParser::startCompound)); m_startElementHandlers.insert("member", new StartElementHandler(this,&TagFileParser::startMember)); @@ -603,6 +638,7 @@ class TagFileParser : public QXmlDefaultHandler m_startElementHandlers.insert("class", new StartElementHandler(this,&TagFileParser::startStringValue)); m_startElementHandlers.insert("namespace", new StartElementHandler(this,&TagFileParser::startStringValue)); m_startElementHandlers.insert("file", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("dir", new StartElementHandler(this,&TagFileParser::startStringValue)); m_startElementHandlers.insert("page", new StartElementHandler(this,&TagFileParser::startStringValue)); m_startElementHandlers.insert("docanchor", new StartElementHandler(this,&TagFileParser::startStringValue)); m_startElementHandlers.insert("tagfile", new StartElementHandler(this,&TagFileParser::startIgnoreElement)); @@ -623,6 +659,7 @@ class TagFileParser : public QXmlDefaultHandler m_endElementHandlers.insert("class" , new EndElementHandler(this,&TagFileParser::endClass)); m_endElementHandlers.insert("namespace", new EndElementHandler(this,&TagFileParser::endNamespace)); m_endElementHandlers.insert("file", new EndElementHandler(this,&TagFileParser::endFile)); + m_endElementHandlers.insert("dir", new EndElementHandler(this,&TagFileParser::endDir)); m_endElementHandlers.insert("page", new EndElementHandler(this,&TagFileParser::endPage)); m_endElementHandlers.insert("docanchor", new EndElementHandler(this,&TagFileParser::endDocAnchor)); m_endElementHandlers.insert("tagfile", new EndElementHandler(this,&TagFileParser::endIgnoreElement)); @@ -678,6 +715,7 @@ class TagFileParser : public QXmlDefaultHandler QList m_tagFileGroups; QList m_tagFilePages; QList m_tagFilePackages; + QList m_tagFileDirs; QDict m_startElementHandlers; QDict m_endElementHandlers; TagClassInfo *m_curClass; @@ -686,6 +724,7 @@ class TagFileParser : public QXmlDefaultHandler TagPackageInfo *m_curPackage; TagGroupInfo *m_curGroup; TagPageInfo *m_curPage; + TagDirInfo *m_curDir; TagMemberInfo *m_curMember; TagIncludeInfo *m_curIncludes; QCString m_curString; @@ -872,6 +911,25 @@ void TagFileParser::dump() msg(" title `%s'\n",pd->title.data()); msg(" filename `%s'\n",pd->filename.data()); } + //============== DIRS + QListIterator ldi(m_tagFileDirs); + TagDirInfo *dd; + for (;(dd=ldi.current());++ldi) + { + msg("dir `%s'\n",dd->name.data()); + msg(" path `%s'\n",dd->path.data()); + QStringList::Iterator it; + for ( it = dd->fileList.begin(); + it != dd->fileList.end(); ++it ) + { + msg( " file: %s \n", (*it).latin1() ); + } + for ( it = dd->subdirList.begin(); + it != dd->subdirList.end(); ++it ) + { + msg( " subdir: %s \n", (*it).latin1() ); + } + } } void TagFileParser::addDocAnchors(Entry *e,QStrList &l) diff --git a/src/translator_cn.h b/src/translator_cn.h index def8228..7cefc71 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -24,7 +24,7 @@ */ #define CN_SPC -class TranslatorChinese : public TranslatorAdapter_1_3_9 +class TranslatorChinese : public Translator { public: /*! Used for identification of the language. The identification @@ -1482,6 +1482,69 @@ class TranslatorChinese : public TranslatorAdapter_1_3_9 /* return filename + " Source File"; */ return filename + CN_SPC"Ô´Îļþ"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + /* { return "Directory Hierarchy"; } */ + { + return "$(BL\\¼½á$(DC((B"; + } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + /* { return "Directory Documentation"; } */ + { + return "$(BL\\¼J8[c(B"; + } + + /*! 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 "Directories"; } */ + { + return "$(BL\\¼(B"; + } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() +/* { return "This directory hierarchy is sorted roughly, " */ +/* "but not completely, alphabetically:"; */ +/* } */ + { + return "$(BL\\¼½á$(DC(½ö¾­¹ý$(BBgCWE*GSNs!$VuL$40A40D;zJl˳=x(B"; + } + + /*! 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+=" Directory Reference"; return result; } */ + { + QCString result=dirName; + result+=CN_SPC"$(BL\\¼;29M(B"; + 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, bool) + { + /* QCString result((first_capital ? "Director" : "director")); */ + /* if (singular) result+="y"; else result+="ies"; */ + /* return result; */ + return "$(BL\\¼(B"; + } }; diff --git a/src/translator_cz.h b/src/translator_cz.h index 79f0945..f48a32c 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -130,6 +130,7 @@ // 2004/02/26 - trLegendDocs() updated. // 2004/02/27 - Text inside the trCallGraph() corrected. // 2004/06/16 - The new method "since 1.3.8" implemented. +// 2004/09/14 - The new methods "since 1.3.9" implemented. // Todo // ---- @@ -149,7 +150,7 @@ // Windows version. The version which does not call the function is // probably slightly faster. -class TranslatorCzech : public TranslatorAdapter_1_3_9 +class TranslatorCzech : public Translator { private: /*! The decode() inline assumes the source written in the @@ -1673,6 +1674,59 @@ class TranslatorCzech : public TranslatorAdapter_1_3_9 return decode("Zdrojový soubor ") + filename; } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return decode("Hierarchie adresáøù"); } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return decode("Dokumentace k adresáøùm"); } + + /*! 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 decode("Adresáøe"); } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { + return decode("Následující hierarchie adresáøù je zhruba, " + "ale ne úplnì, øazena podle abecedy:"); + } + + /*! 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 = "Reference k adresáøi "; + result += dirName; + return decode(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) + { + QCString result((first_capital ? "Adresáø" : "adresáø")); + if ( ! singular) + result += "e"; + return decode(result); + } }; #endif // TRANSLATOR_CZ_H diff --git a/src/translator_de.h b/src/translator_de.h index 1f7d995..20b7ffe 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -87,13 +87,22 @@ // 2004/08/01 Jens Seidel (jensseidel@users.sourceforge.net) // - Updated for "new since 1.3.8" version // +// 2004/09/19 Jens Seidel (jensseidel@users.sourceforge.net) +// - Updated for "new since 1.3.9" version +// +// 2004/09/25 Jens Seidel (jensseidel@users.sourceforge.net) +// - changed "Typendefinitionen" to "Typdefinitionen" in +// trFileMembersDescription() and trTypedefs() +// - added a dash after (file, ...) names and in front of description +// - changed "Eigenschaften" to "Propertys" (yeah, not ..."ies") +// // Todo: // - see FIXME #ifndef TRANSLATOR_DE_H #define TRANSLATOR_DE_H -class TranslatorGerman : public TranslatorAdapter_1_3_9 +class TranslatorGerman : public Translator { public: @@ -341,7 +350,7 @@ class TranslatorGerman : public TranslatorAdapter_1_3_9 if (!extractAll) result+="dokumentierten "; if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - result+="Funktionen, Variablen, Makros, Aufzählungen und Typendefinitionen"; + result+="Funktionen, Variablen, Makros, Aufzählungen und Typdefinitionen"; } else { @@ -471,7 +480,7 @@ class TranslatorGerman : public TranslatorAdapter_1_3_9 * list of typedefs */ virtual QCString trTypedefs() - { return "Typendefinitionen"; } + { return "Typdefinitionen"; } /*! This is used in the documentation of a file as a header before the * list of enumerations @@ -685,7 +694,7 @@ class TranslatorGerman : public TranslatorAdapter_1_3_9 virtual QCString trFileReference(const char *fileName) { QCString result=fileName; - result+=" Dateireferenz"; + result+="-Dateireferenz"; return result; } @@ -693,7 +702,7 @@ class TranslatorGerman : public TranslatorAdapter_1_3_9 virtual QCString trNamespaceReference(const char *namespaceName) { QCString result=namespaceName; - result+=" Namensbereichsreferenz"; + result+="-Namensbereichsreferenz"; return result; } @@ -1214,13 +1223,13 @@ class TranslatorGerman : public TranslatorAdapter_1_3_9 /*! Used as a section header for IDL properties */ virtual QCString trProperties() { - return "Eigenschaften"; + return "Propertys"; } /*! Used as a section header for IDL property documentation */ virtual QCString trPropertyDocumentation() { - return "Dokumentation der Eigenschaften"; + return "Dokumentation der Propertys"; } ////////////////////////////////////////////////////////////////////////// @@ -1619,6 +1628,52 @@ class TranslatorGerman : public TranslatorAdapter_1_3_9 return filename + " Quellcode"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "Verzeichnishierarchie"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "Verzeichnisdokumentation"; } + + /*! 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 "Verzeichnisse"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "Diese Verzeichnishierarchie ist -mit Einschränkungen- " + "alphabetisch sortiert:"; + } + + /*! 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+=" Verzeichnisreferenz"; 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, bool singular) + { + QCString result("Verzeichnis"); + if (!singular) result+="se"; + return result; + } + }; #endif diff --git a/src/translator_es.h b/src/translator_es.h index 06bb493..d6f4b48 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -359,7 +359,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_3_8 * for the author section in man pages. */ virtual QCString trAuthor(bool first_capital, bool singular) { - QCString result((first_capital ? "Author" : "author")); + QCString result((first_capital ? "Autor" : "autor")); if (!singular) result+="s"; return result; } diff --git a/src/translator_hr.h b/src/translator_hr.h index 0227f4f..ae2be0c 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -55,11 +55,14 @@ // // 2004/06/21 // - Added strings for 1.3.8 +// +// 2004/09/15 +// - Added strings for 1.3.9 #ifndef TRANSLATOR_HR_H #define TRANSLATOR_HR_H -class TranslatorCroatian : public TranslatorAdapter_1_3_9 +class TranslatorCroatian : public Translator { private: /*! to avoid macro redefinition from translator_cz.h */ @@ -1226,6 +1229,51 @@ class TranslatorCroatian : public TranslatorAdapter_1_3_9 return "Izvorni kod datoteke " + filename; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "Stablo direktorija"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "Dokumentacija direktorija"; } + + /*! 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 "Direktoriji"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "Stablo direktorija sortirano abecednim redom:"; } + + /*! 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= "Opis direktorija "; result += dirName; 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) + { + QCString result((first_capital ? "Direktorij" : "direktorij")); + if (!singular) result+="i"; + return result; + } }; #endif + + diff --git a/src/translator_hu.h b/src/translator_hu.h index 77c5b33..477a1d2 100644 --- a/src/translator_hu.h +++ b/src/translator_hu.h @@ -29,7 +29,7 @@ #ifndef TRANSLATOR_HU_H #define TRANSLATOR_HU_H -class TranslatorHungarian : public TranslatorAdapter_1_3_9 +class TranslatorHungarian : public Translator { private: const char * zed(char c) @@ -1526,6 +1526,52 @@ class TranslatorHungarian : public TranslatorAdapter_1_3_9 return filename + " Forrásfájl"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "Könyvtárhierarchia"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "Könyvtárak dokumentációja"; } + + /*! 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 "Könyvtárak"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "Majdnem (de nem teljesen) betûrendbe szedett " + "könyvtárhierarchia:"; + } + + /*! 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+=" könyvtárreferencia"; 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*/) + { + QCString result((first_capital ? "Könyvtár" : "könyvtár")); + //if (singular) result+="y"; else result+="ies"; + return result; + } + }; #endif diff --git a/src/translator_it.h b/src/translator_it.h index 9e319c6..8159aa8 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -19,6 +19,7 @@ * * Revision history * + * 2004/09: translated new items used since version 1.3.9 * 2004/06: translated new items used since version 1.3.8 * 2003/11: translated new items used since version 1.3.3 * 2003/06: translated new items used since version 1.3.1 @@ -71,7 +72,7 @@ #ifndef TRANSLATOR_IT_H #define TRANSLATOR_IT_H -class TranslatorItalian : public TranslatorAdapter_1_3_9 +class TranslatorItalian : public Translator { public: @@ -1516,6 +1517,51 @@ class TranslatorItalian : public TranslatorAdapter_1_3_9 return " File sorgente " + filename ; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "Gerarchia delle directory"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "Documentazione delle directory"; } + + /*! 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 "Directory"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "Questa gerarchia di directory è ordinata " + "approssimativamente, ma non completamente, in ordine alfabetico:"; + } + + /*! 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="Riferimenti per la directory "; result+=dirName; 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) + { + QCString result((first_capital ? "Directory" : "directory")); + return result; + } + }; #endif diff --git a/src/translator_pl.h b/src/translator_pl.h index 3186ead..f8bab5f 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -13,14 +13,14 @@ * Documents produced by Doxygen are derivative works derived from the * input used in their production; they are not affected by this license. * - * Polish translation was updated to version 1.3.8 by + * Polish translation was updated to version 1.3.9 by * Piotr Kaminski (Piotr.Kaminski@ctm.gdynia.pl) */ #ifndef TRANSLATOR_PL_H #define TRANSLATOR_PL_H -class TranslatorPolish : public TranslatorAdapter_1_3_9 +class TranslatorPolish : public Translator { private: /*! to avoid macro redefinition from translator_pl.h */ @@ -1511,7 +1511,51 @@ class TranslatorPolish : public TranslatorAdapter_1_3_9 return "Plik ¼ród³owy " + filename; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "Struktura katalogów"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "Dokumentacja katalogów"; } + + /*! 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 "Katalogi"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "Ta struktura katalogów jest posortowana jest z grubsza, " + "choæ nie ca³kowicie, alfabetycznie:"; + } + + /*! 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="Dokumentacja katalogu "; result+=dirName; 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) + { + QCString result((first_capital ? "Katalog" : "katalog")); + if (! singular) result+="i"; + return result; + } }; #endif diff --git a/src/translator_ru.h b/src/translator_ru.h index 4a40459..b431953 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -18,7 +18,7 @@ * * Nickolay Semyonov * Andrey V. Stolyarov released Feb 14, 2001 - * Alexandr V. Chelpanov released Jun 16, 2004 + * Alexandr V. Chelpanov released Sep 25, 2004 * * ðÒÉ ÐÅÒÅ×ÏÄÅ ÚÁÇÏÌÏ×ËÏ× ÓÌÏ×Á list É documentation ÕÂÒÁÎÙ. * @@ -49,7 +49,7 @@ #ifndef TRANSLATOR_RU_H #define TRANSLATOR_RU_H -class TranslatorRussian : public TranslatorAdapter_1_3_9 +class TranslatorRussian : public Translator { private: /*! The Decode() inline assumes the source written in the @@ -1570,7 +1570,51 @@ class TranslatorRussian : public TranslatorAdapter_1_3_9 */ virtual QCString trSourceFile(QCString& filename) { - return "éÓÈÏÄÎÙÊ ÆÁÊÌ " + filename; + return decode( "éÓÈÏÄÎÙÊ ÆÁÊÌ " + filename ); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return decode( "äÅÒÅ×Ï ÄÉÒÅËÔÏÒÉÊ" ); } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return decode( "äÉÒÅËÔÏÒÉÉ" ); } + + /*! 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 decode( "áÌÆÁ×ÉÔÎÙÊ ÕËÁÚÁÔÅÌØ ÄÉÒÅËÔÏÒÉÊ" ); } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return decode( "äÅÒÅ×Ï ÄÉÒÅËÔÏÒÉÊ" ); } + + /*! 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=QCString("óÏÄÅÒÖÁÎÉÅ ÄÉÒÅËÔÏÒÉÉ ")+ dirName; return decode( 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) + { + QCString result((first_capital ? "äÉÒÅËÔÏÒÉ" : "ÄÉÒÅËÔÏÒÉ")); + if (singular) result+="Ñ"; else result+="É"; + return decode( result ); } }; diff --git a/src/translator_se.h b/src/translator_se.h index 0d3866f..1307b90 100644 --- a/src/translator_se.h +++ b/src/translator_se.h @@ -69,7 +69,7 @@ Problem! #ifndef TRANSLATOR_SE_H #define TRANSLATOR_SE_H -class TranslatorSwedish : public TranslatorAdapter_1_3_8 +class TranslatorSwedish : public Translator { public: @@ -1401,6 +1401,65 @@ class TranslatorSwedish : public TranslatorAdapter_1_3_8 return "Träffar:"; } +////////////////////////////////////////////////////////////////////////// +// 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 "Källkodsfilen " + filename; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "Katalogstruktur"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "Katalogdokumentation"; } + + /*! 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 "Kataloger"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "Den här katalogen är grovt sorterad, " + "men inte helt, i alfabetisk ordning:"; + } + + /*! 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+=" Katalogreferens"; 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) + { + QCString result((first_capital ? "Katalog" : "katalog")); + if (!singular) result+="er"; + return result; + } + + + }; #endif diff --git a/src/util.cpp b/src/util.cpp index 1d592d4..fba7edb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1041,6 +1041,19 @@ ClassDef *getResolvedClassRec(Definition *scope, // scope, the name to search for and the explicit scope prefix. The speedup // achieved by this simple cache can be enormous. QCString key=scope->name()+"+"+name+"+"+explicitScopePart; + // if a file scope is given and it contains using statements we should + // also use the file part in the key (as a class name can be in + // two different namespaces and a using statement in a file can select + // one of them). + if (fileScope && ((fileScope->getUsedNamespaces() && + fileScope->getUsedNamespaces()->count()>0) || + (fileScope->getUsedClasses() && + fileScope->getUsedClasses()->count()>0)) + ) + { + key+="+"+fileScope->name(); + } + LookupInfo *pval=Doxygen::lookupCache.find(key); //printf("Searching for %s result=%p\n",key.data(),pval); if (pval) @@ -1080,6 +1093,7 @@ ClassDef *getResolvedClassRec(Definition *scope, g_visitedNamespaces.clear(); // test accessibility of definition within scope. int distance = isAccessibleFromWithExpScope(scope,fileScope,d,explicitScopePart); + //printf("distance %s is %d\n",d->name().data(),distance); if (distance!=-1) // definition is accessible { // see if we are dealing with a class or a typedef @@ -1092,6 +1106,26 @@ ClassDef *getResolvedClassRec(Definition *scope, bestTypedef = 0; bestTemplSpec.resize(0); } + else if (distance==minDistance && + fileScope && + fileScope->getUsedNamespaces() && + d->getOuterScope()->definitionType()==Definition::TypeNamespace && + bestMatch->getOuterScope()==Doxygen::globalScope + ) + { + // in case the distance is equal it could be that a class X + // is defined in a namespace and in the global scope. When searched + // in the global scope the distance is 0 in both cases. We have + // to choose one of the definitions: we choose the one in the + // namespace if the fileScope imports namespaces and the definition + // found was in a namespace while the best match so far isn't. + // Just a non-perfect heuristic but it could help in some situations + // (kdecore code is an example). + minDistance=distance; + bestMatch = (ClassDef *)d; + bestTypedef = 0; + bestTemplSpec.resize(0); + } } else if (d->definitionType()==Definition::TypeMember) { @@ -1930,7 +1964,7 @@ static QCString trimTemplateSpecifiers( } //printf("result=%s\n",result.data()); - return result; + return result.stripWhiteSpace(); } /*! @@ -2120,6 +2154,36 @@ static void trimNamespaceScope(QCString &t1,QCString &t2,const QCString &nsName) } #endif +static void stripIrrelevantString(QCString &target,const QCString &str) +{ + if (target==str) { target.resize(0); return; } + int i,p=0; + int l=str.length(); + while ((i=target.find(str,p))!=-1) + { + bool isMatch = (i==0 || !isId(target.at(i-1))) && // not a character before str + (i+l==(int)target.length() || !isId(target.at(i+l))); // not a character after str + if (isMatch) + { + int i1=target.find('*',i+l); + int i2=target.find('&',i+l); + if (i1==-1 && i2==-1) + { + // strip str from target at index i + target=target.left(i)+target.right(target.length()-i-l); + i-=l; + } + else if ((i1!=-1 && i *usingClasses) { - //printf("match argument start %s:%s <-> %s:%s using nsp=%p class=%p\n", + //printf("match argument start `%s|%s' <-> `%s|%s' using nsp=%p class=%p\n", // srcA->type.data(),srcA->name.data(), // dstA->type.data(),dstA->name.data(), // usingNamespaces, @@ -2214,6 +2233,8 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, QCString srcAType=trimTemplateSpecifiers(namespaceName,className,srcA->type); QCString dstAType=trimTemplateSpecifiers(namespaceName,className,dstA->type); + QCString srcAName=srcA->name.stripWhiteSpace(); + QCString dstAName=dstA->name.stripWhiteSpace(); if (srcAType.left(6)=="class ") srcAType=srcAType.right(srcAType.length()-6); if (dstAType.left(6)=="class ") dstAType=dstAType.right(dstAType.length()-6); @@ -2221,23 +2242,25 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, // from a syntactic point of view they would be two names of the same // type "const". This is not fool prove ofcourse, but should at least // catch the most common cases. - if ((srcAType=="const" || srcAType=="volatile") && !srcA->name.isEmpty()) + if ((srcAType=="const" || srcAType=="volatile") && !srcAName.isEmpty()) { srcAType+=" "; - srcAType+=srcA->name; + srcAType+=srcAName; } - if ((dstAType=="const" || dstAType=="volatile") && !dstA->name.isEmpty()) + if ((dstAType=="const" || dstAType=="volatile") && !dstAName.isEmpty()) { dstAType+=" "; - dstAType+=dstA->name; + dstAType+=dstAName; } - if (srcA->name=="const" || srcA->name=="volatile") + if (srcAName=="const" || srcAName=="volatile") { - srcAType+=srcA->name; + srcAType+=srcAName; + srcAName.resize(0); } - if (dstA->name=="const" || dstA->name=="volatile") + else if (dstA->name=="const" || dstA->name=="volatile") { dstAType+=dstA->name; + dstAName.resize(0); } stripIrrelevantConstVolatile(srcAType); @@ -2260,8 +2283,8 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, //srcAType=stripTemplateSpecifiersFromScope(srcAType,FALSE); //dstAType=stripTemplateSpecifiersFromScope(dstAType,FALSE); - //printf("srcA=%s|%s dstA=%s|%s\n",srcAType.data(),srcA->name.data(), - // dstAType.data(),dstA->name.data()); + //printf("srcA=`%s|%s' dstA=`%s|%s'\n",srcAType.data(),srcAName.data(), + // dstAType.data(),dstAName.data()); if (srcA->array!=dstA->array) // nomatch for char[] against char { @@ -2326,17 +2349,17 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, } } - //printf("2. srcA=%s|%s dstA=%s|%s\n",srcAType.data(),srcA->name.data(), - // dstAType.data(),dstA->name.data()); + //printf("2. srcA=%s|%s dstA=%s|%s\n",srcAType.data(),srcAName.data(), + // dstAType.data(),dstAName.data()); - if (!srcA->name.isEmpty() && !dstA->type.isEmpty() && - (srcAType+" "+srcA->name)==dstAType) + if (!srcAName.isEmpty() && !dstA->type.isEmpty() && + (srcAType+" "+srcAName)==dstAType) { MATCH return TRUE; } - else if (!dstA->name.isEmpty() && !srcA->type.isEmpty() && - (dstAType+" "+dstA->name)==srcAType) + else if (!dstAName.isEmpty() && !srcA->type.isEmpty() && + (dstAType+" "+dstAName)==srcAType) { MATCH return TRUE; @@ -2365,7 +2388,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { //printf("partial match srcPos=%d dstPos=%d!\n",srcPos,dstPos); // check if a name if already found -> if no then there is no match - if (!srcA->name.isEmpty() || !dstA->name.isEmpty()) + if (!srcAName.isEmpty() || !dstAName.isEmpty()) { NOMATCH return FALSE; @@ -2404,7 +2427,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { if (!isspace((uchar)dstAType.at(dstPos))) // maybe the names differ { - if (!dstA->name.isEmpty()) // dst has its name separated from its type + if (!dstAName.isEmpty()) // dst has its name separated from its type { NOMATCH return FALSE; @@ -2420,7 +2443,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { dstPos++; while (dstPosname.isEmpty()) + if (dstPos!=dstAType.length() || !srcAName.isEmpty()) { NOMATCH return FALSE; // nope not a name -> no match @@ -2431,7 +2454,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { if (!isspace((uchar)srcAType.at(srcPos))) // maybe the names differ { - if (!srcA->name.isEmpty()) // src has its name separated from its type + if (!srcAName.isEmpty()) // src has its name separated from its type { NOMATCH return FALSE; @@ -2447,7 +2470,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { srcPos++; while (srcPosname.isEmpty()) + if (srcPos!=srcAType.length() || !dstAName.isEmpty()) { NOMATCH return FALSE; // nope not a name -> no match @@ -2588,6 +2611,20 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr //printf("Defval changing `%s'->`%s'\n",dstA->defval.data(),srcA->defval.data()); dstA->defval=srcA->defval.copy(); } + + // fix wrongly detected const or volatile specificiers before merging. + // example: "const A *const" is detected as type="const A *" name="const" + if (srcA->name=="const" || srcA->name=="volatile") + { + srcA->type+=" "+srcA->name; + srcA->name.resize(0); + } + if (dstA->name=="const" || dstA->name=="volatile") + { + dstA->type+=" "+dstA->name; + dstA->name.resize(0); + } + if (srcA->type==dstA->type) { if (srcA->name.isEmpty() && !dstA->name.isEmpty()) @@ -2671,8 +2708,11 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr { dstA->docs = srcA->docs.copy(); } + //printf("Merge argument `%s|%s' `%s|%s'\n", + // srcA->type.data(),srcA->name.data(), + // dstA->type.data(),dstA->name.data()); } - //printf("result mergeArguments `%s', `%s'\n", + //printf("result mergeArguments `%s|%s', `%s|%s'\n", // argListToString(srcAl).data(),argListToString(dstAl).data()); } diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index ae853b4..7f0181e 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -750,6 +750,8 @@ void XmlDocVisitor::visitPost(DocParamSect *) void XmlDocVisitor::visitPre(DocParamList *pl) { if (m_hide) return; + m_t << "" << endl; + m_t << "" << endl; QStrListIterator li(pl->parameters()); const char *s; for (li.toFirst();(s=li.current());++li) @@ -776,13 +778,15 @@ void XmlDocVisitor::visitPre(DocParamList *pl) filter(s); m_t << "" << endl; } + m_t << "" << endl; m_t << "" << endl; } void XmlDocVisitor::visitPost(DocParamList *) { if (m_hide) return; - m_t << ""; + m_t << "" << endl; + m_t << "" << endl; } void XmlDocVisitor::visitPre(DocXRefItem *x) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 27f278a..c5345a6 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -718,7 +718,9 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De t << " " << a->type << "" << endl; } } - if (!md->initializer().isEmpty()) + // avoid that extremely large tables are written to the output. + // todo: it's better to adhere to MAX_INITIALIZER_LINES. + if (!md->initializer().isEmpty() && md->initializer().length()<2000) { t << " "; linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->initializer()); -- cgit v0.12