summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classdef.cpp22
-rw-r--r--src/classdef.h4
-rw-r--r--src/context.cpp8
-rw-r--r--src/context.h8
-rw-r--r--src/doctokenizer.l1
-rw-r--r--src/doxygen.cpp2
-rw-r--r--src/ftvhelp.cpp4
-rw-r--r--src/index.cpp597
-rw-r--r--src/markdown.cpp12
-rw-r--r--src/util.cpp75
-rw-r--r--src/util.h5
11 files changed, 372 insertions, 366 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index e797b05e..91730a0 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -82,9 +82,9 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef
virtual CompoundType compoundType() const;
virtual QCString compoundTypeString() const;
virtual BaseClassList baseClasses() const;
- virtual void updateBaseClasses(BaseClassList bcd);
+ virtual void updateBaseClasses(const BaseClassList &bcd);
virtual BaseClassList subClasses() const;
- virtual void updateSubClasses(BaseClassList bcd);
+ virtual void updateSubClasses(const BaseClassList &bcd);
virtual const MemberNameInfoLinkedMap &memberNameInfoLinkedMap() const;
virtual Protection protection() const;
virtual bool isLinkableInProject() const;
@@ -512,8 +512,8 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
virtual void addGroupedInheritedMembers(OutputList &,MemberListType,
const ClassDef *,const QCString &) const {}
virtual void writeTagFile(FTextStream &) {}
- virtual void updateBaseClasses(BaseClassList) {}
- virtual void updateSubClasses(BaseClassList) {}
+ virtual void updateBaseClasses(const BaseClassList &) {}
+ virtual void updateSubClasses(const BaseClassList &) {}
virtual void setVisited(bool visited) const { m_visited = visited; }
virtual bool isVisited() const { return m_visited; }
@@ -3420,16 +3420,14 @@ bool ClassDefImpl::isLinkable() const
/*! the class is visible in a class diagram, or class hierarchy */
bool ClassDefImpl::isVisibleInHierarchy() const
{
- static bool allExternals = Config_getBool(ALLEXTERNALS);
- static bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
- static bool extractStatic = Config_getBool(EXTRACT_STATIC);
+ bool allExternals = Config_getBool(ALLEXTERNALS);
+ bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
+ bool extractStatic = Config_getBool(EXTRACT_STATIC);
return // show all classes or a subclass is visible
- (allExternals || hasNonReferenceSuperClass()) &&
+ ((allExternals && !isArtificial()) || hasNonReferenceSuperClass()) &&
// and not an anonymous compound
!isAnonymous() &&
- // not an artificially introduced class
- /*!isArtificial() &&*/ // 1.8.2: allowed these to appear
// and not privately inherited
protectionLevelVisible(m_impl->prot) &&
// documented or shown anyway or documentation is external
@@ -4752,7 +4750,7 @@ BaseClassList ClassDefImpl::baseClasses() const
return m_impl->inherits;
}
-void ClassDefImpl::updateBaseClasses(BaseClassList bcd)
+void ClassDefImpl::updateBaseClasses(const BaseClassList &bcd)
{
m_impl->inherits = bcd;
}
@@ -4762,7 +4760,7 @@ BaseClassList ClassDefImpl::subClasses() const
return m_impl->inheritedBy;
}
-void ClassDefImpl::updateSubClasses(BaseClassList bcd)
+void ClassDefImpl::updateSubClasses(const BaseClassList &bcd)
{
m_impl->inheritedBy = bcd;
}
diff --git a/src/classdef.h b/src/classdef.h
index bd06323..faaf0f6 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -160,14 +160,14 @@ class ClassDef : virtual public Definition
virtual BaseClassList baseClasses() const = 0;
/** Update the list of base classes to the one passed */
- virtual void updateBaseClasses(BaseClassList bcd) = 0;
+ virtual void updateBaseClasses(const BaseClassList &bcd) = 0;
/** Returns the list of sub classes that directly derive from this class
*/
virtual BaseClassList subClasses() const = 0;
/** Update the list of sub classes to the one passed */
- virtual void updateSubClasses(BaseClassList bcd) = 0;
+ virtual void updateSubClasses(const BaseClassList &bcd) = 0;
/** Returns a dictionary of all members. This includes any inherited
* members. Members are sorted alphabetically.
diff --git a/src/context.cpp b/src/context.cpp
index 614cc2d..5a9ab38 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -6541,7 +6541,7 @@ class NestingContext::Private : public GenericNodeListContext
if (!nd->isAnonymous() &&
(!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
{
- bool hasChildren = namespaceHasVisibleChild(nd,addClasses,false,ClassDef::Class);
+ bool hasChildren = namespaceHasNestedNamespace(nd);
bool isLinkable = nd->isLinkableInProject();
if (isLinkable || hasChildren)
{
@@ -6670,7 +6670,7 @@ class NestingContext::Private : public GenericNodeListContext
}
}
}
- void addDerivedClasses(BaseClassList bcl,bool hideSuper)
+ void addDerivedClasses(const BaseClassList &bcl,bool hideSuper)
{
for (const auto &bcd : bcl)
{
@@ -6812,7 +6812,7 @@ void NestingContext::addClassHierarchy(const ClassSDict &classSDict,bool rootOnl
p->addClassHierarchy(classSDict,rootOnly);
}
-void NestingContext::addDerivedClasses(BaseClassList bcl,bool hideSuper)
+void NestingContext::addDerivedClasses(const BaseClassList &bcl,bool hideSuper)
{
p->addDerivedClasses(bcl,hideSuper);
}
@@ -8533,7 +8533,7 @@ class InheritanceListContext::Private : public GenericNodeListContext
}
};
-InheritanceListContext::InheritanceListContext(BaseClassList list, bool baseClasses) : RefCountedContext("InheritanceListContext")
+InheritanceListContext::InheritanceListContext(const BaseClassList &list, bool baseClasses) : RefCountedContext("InheritanceListContext")
{
p = new Private;
for (const auto &bcd : list)
diff --git a/src/context.h b/src/context.h
index 473c72f..c785664 100644
--- a/src/context.h
+++ b/src/context.h
@@ -452,7 +452,7 @@ class ClassInheritanceNodeContext : public RefCountedContext, public TemplateStr
virtual int addRef() { return RefCountedContext::addRef(); }
virtual int release() { return RefCountedContext::release(); }
- void addChildren(BaseClassList bcl,bool hideSuper);
+ void addChildren(const BaseClassList &bcl,bool hideSuper);
private:
ClassInheritanceNodeContext(const ClassDef *);
@@ -550,7 +550,7 @@ class NestingContext : public RefCountedContext, public TemplateListIntf
void addModules(const GroupSDict &modules);
void addModules(const GroupList &modules);
void addClassHierarchy(const ClassSDict &clDict,bool rootOnly);
- void addDerivedClasses(BaseClassList bcl,bool hideSuper);
+ void addDerivedClasses(const BaseClassList &bcl,bool hideSuper);
private:
NestingContext(const NestingNodeContext *parent,int level);
@@ -926,7 +926,7 @@ class InheritanceNodeContext : public RefCountedContext, public TemplateStructIn
class InheritanceListContext : public RefCountedContext, public TemplateListIntf
{
public:
- static InheritanceListContext *alloc(BaseClassList list,bool baseClasses)
+ static InheritanceListContext *alloc(const BaseClassList &list,bool baseClasses)
{ return new InheritanceListContext(list,baseClasses); }
// TemplateListIntf
@@ -937,7 +937,7 @@ class InheritanceListContext : public RefCountedContext, public TemplateListIntf
virtual int release() { return RefCountedContext::release(); }
private:
- InheritanceListContext(BaseClassList list,bool baseClasses);
+ InheritanceListContext(const BaseClassList &list,bool baseClasses);
~InheritanceListContext();
class Private;
Private *p;
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 1774788..5b72b77 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -568,7 +568,6 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
}
<St_Para>{BLANK}*(\n|"\\ilinebr"){OLISTITEM} { /* list item on next line */
- lineCount(yytext,yyleng);
if (!g_markdownSupport || g_insidePre)
{
REJECT;
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 4d0ae19..7c350d4 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -4469,7 +4469,7 @@ static bool findClassRelation(
if (baseClassTypeDef==0)
{
//printf(" => findTemplateInstanceRelation: %p\n",baseClassTypeDef);
- findTemplateInstanceRelation(root,context,baseClass,templSpec,templateNames,isArtificial);
+ findTemplateInstanceRelation(root,context,baseClass,templSpec,templateNames,baseClass->isArtificial());
}
}
else if (mode==DocumentedOnly || mode==Undocumented)
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 6fc14bf..b34f644 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -167,7 +167,7 @@ void FTVHelp::finalize()
*/
void FTVHelp::incContentsDepth()
{
- //printf("incContentsDepth() indent=%d\n",m_indent);
+ //printf("%p: incContentsDepth() indent=%d\n",this,m_indent);
m_indent++;
ASSERT(m_indent<MAX_INDENT);
}
@@ -178,7 +178,7 @@ void FTVHelp::incContentsDepth()
*/
void FTVHelp::decContentsDepth()
{
- //printf("decContentsDepth() indent=%d\n",m_indent);
+ //printf("%p: decContentsDepth() indent=%d\n",this,m_indent);
ASSERT(m_indent>0);
if (m_indent>0)
{
diff --git a/src/index.cpp b/src/index.cpp
index e46a578..5dcdf82 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -326,6 +326,66 @@ void endFileWithNavPath(const Definition *d,OutputList &ol)
}
//----------------------------------------------------------------------
+
+static bool memberVisibleInIndex(const MemberDef *md)
+{
+ bool isAnonymous = md->isAnonymous();
+ bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
+ bool extractStatic = Config_getBool(EXTRACT_STATIC);
+ return (!isAnonymous &&
+ (!hideUndocMembers || md->hasDocumentation()) &&
+ (!md->isStatic() || extractStatic)
+ );
+}
+
+static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool addToIndex)
+{
+ bool isAnonymous = md->isAnonymous();
+ bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
+ const MemberList *enumList = md->enumFieldList();
+ bool isDir = enumList!=0 && md->isEnumerate();
+ if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
+ {
+ Doxygen::indexList->addContentsItem(isDir,
+ md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
+ }
+ else // inherited member
+ {
+ Doxygen::indexList->addContentsItem(isDir,
+ md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
+ }
+ if (isDir)
+ {
+ if (!isAnonymous)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
+ MemberListIterator emli(*enumList);
+ MemberDef *emd;
+ for (emli.toFirst();(emd=emli.current());++emli)
+ {
+ if (!hideUndocMembers || emd->hasDocumentation())
+ {
+ if (emd->getOuterScope()==def || emd->getOuterScope()==Doxygen::globalScope)
+ {
+ Doxygen::indexList->addContentsItem(FALSE,
+ emd->name(),emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
+ }
+ else // inherited member
+ {
+ Doxygen::indexList->addContentsItem(FALSE,
+ emd->name(),def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
+ }
+ }
+ }
+ if (!isAnonymous)
+ {
+ Doxygen::indexList->decContentsDepth();
+ }
+ }
+}
+
+//----------------------------------------------------------------------
template<class T>
void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
const QCString &name,const QCString &anchor,
@@ -366,55 +426,9 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
MemberDef *md;
for (mi.toFirst();(md=mi.current());++mi)
{
- const MemberList *enumList = md->enumFieldList();
- bool isDir = enumList!=0 && md->isEnumerate();
- bool isAnonymous = md->isAnonymous();
- static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
- static bool extractStatic = Config_getBool(EXTRACT_STATIC);
- if (!isAnonymous &&
- (!hideUndocMembers || md->hasDocumentation()) &&
- (!md->isStatic() || extractStatic)
- )
+ if (memberVisibleInIndex(md))
{
- if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
- {
- Doxygen::indexList->addContentsItem(isDir,
- md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
- }
- else // inherited member
- {
- Doxygen::indexList->addContentsItem(isDir,
- md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
- }
- }
- if (isDir)
- {
- if (!isAnonymous)
- {
- Doxygen::indexList->incContentsDepth();
- }
- MemberListIterator emli(*enumList);
- MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
- {
- if (!hideUndocMembers || emd->hasDocumentation())
- {
- if (emd->getOuterScope()==def || emd->getOuterScope()==Doxygen::globalScope)
- {
- Doxygen::indexList->addContentsItem(FALSE,
- emd->name(),emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
- }
- else // inherited member
- {
- Doxygen::indexList->addContentsItem(FALSE,
- emd->name(),def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
- }
- }
- }
- if (!isAnonymous)
- {
- Doxygen::indexList->decContentsDepth();
- }
+ writeMemberToIndex(def,md,addToIndex);
}
}
}
@@ -451,7 +465,7 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
//----------------------------------------------------------------------------
/*! Generates HTML Help tree of classes */
-static void writeClassTree(OutputList &ol,BaseClassList bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex)
+static void writeClassTree(OutputList &ol,const BaseClassList &bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex)
{
if (bcl.empty()) return;
bool started=FALSE;
@@ -1554,7 +1568,7 @@ static int countNamespaces()
//----------------------------------------------------------------------------
-void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
+static void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
{
static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
if (clDict)
@@ -1629,10 +1643,64 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
}
}
+static int countVisibleMembers(const NamespaceDef *nd)
+{
+ int count=0;
+ QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
+ LayoutDocEntry *lde;
+ for (eli.toFirst();(lde=eli.current());++eli)
+ {
+ if (lde->kind()==LayoutDocEntry::MemberDef)
+ {
+ LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ MemberList *ml = nd->getMemberList(lmd->type);
+ if (ml)
+ {
+ MemberListIterator mi(*ml);
+ MemberDef *md;
+ for (mi.toFirst();(md=mi.current());++mi)
+ {
+ if (memberVisibleInIndex(md))
+ {
+ count++;
+ }
+ }
+ }
+ }
+ }
+ return count;
+}
+
+static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
+{
+ QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
+ LayoutDocEntry *lde;
+ for (eli.toFirst();(lde=eli.current());++eli)
+ {
+ if (lde->kind()==LayoutDocEntry::MemberDef)
+ {
+ LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ MemberList *ml = nd->getMemberList(lmd->type);
+ if (ml)
+ {
+ MemberListIterator mi(*ml);
+ MemberDef *md;
+ for (mi.toFirst();(md=mi.current());++mi)
+ {
+ //printf(" member %s visible=%d\n",md->name().data(),memberVisibleInIndex(md));
+ if (memberVisibleInIndex(md))
+ {
+ writeMemberToIndex(nd,md,addToIndex);
+ }
+ }
+ }
+ }
+ }
+}
+
static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
- bool rootOnly,bool showClasses,bool addToIndex,ClassDef::CompoundType ct)
+ bool rootOnly,bool addToIndex)
{
- static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
if (nsDict)
{
NamespaceSDict::Iterator nli(*nsDict);
@@ -1643,8 +1711,11 @@ static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
(!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
{
- bool hasChildren = namespaceHasVisibleChild(nd,showClasses,sliceOpt,ct);
+ bool hasChildren = namespaceHasNestedNamespace(nd);
bool isLinkable = nd->isLinkableInProject();
+ int visibleMembers = countVisibleMembers(nd);
+
+ //printf("namespace %s hasChildren=%d visibleMembers=%d\n",nd->name().data(),hasChildren,visibleMembers);
QCString ref;
QCString file;
@@ -1658,45 +1729,113 @@ static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
}
}
- if ((isLinkable && !showClasses) || hasChildren)
+ bool isDir = hasChildren || visibleMembers>0;
+ if ((isLinkable) || isDir)
{
ftv->addContentsItem(hasChildren,nd->localName(),ref,file,0,FALSE,TRUE,nd);
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(hasChildren,nd->localName(),ref,file,QCString(),
+ Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
hasChildren && !file.isEmpty(),addToIndex);
}
+ if (addToIndex && isDir)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
- //printf("*** writeNamespaceTree count=%d addToIndex=%d showClasses=%d classCount=%d\n",
- // count,addToIndex,showClasses,classCount);
- if (hasChildren)
+ //printf("*** writeNamespaceTree count=%d addToIndex=%d false=%d classCount=%d\n",
+ // count,addToIndex,false,classCount);
+ if (isDir)
{
- if (addToIndex) Doxygen::indexList->incContentsDepth();
ftv->incContentsDepth();
- writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,showClasses,addToIndex,ct);
- if (showClasses)
+ writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,addToIndex);
+ writeNamespaceMembers(nd,addToIndex);
+ ftv->decContentsDepth();
+ }
+ if (addToIndex && isDir)
+ {
+ Doxygen::indexList->decContentsDepth();
+ }
+ }
+ }
+ }
+ }
+}
+
+static void writeClassTreeInsideNamespace(const NamespaceSDict *nsDict,FTVHelp *ftv,
+ bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
+{
+ static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
+ if (nsDict)
+ {
+ NamespaceSDict::Iterator nli(*nsDict);
+ const NamespaceDef *nd;
+ for (nli.toFirst();(nd=nli.current());++nli)
+ {
+ if (!nd->isAnonymous() &&
+ (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
+ {
+ bool isDir = namespaceHasNestedClass(nd,sliceOpt,ct);
+ bool isLinkable = nd->isLinkableInProject();
+
+ //printf("namespace %s isDir=%d\n",nd->name().data(),isDir);
+
+ QCString ref;
+ QCString file;
+ if (isLinkable)
+ {
+ ref = nd->getReference();
+ file = nd->getOutputFileBase();
+ if (nd->getLanguage()==SrcLangExt_VHDL) // UGLY HACK
+ {
+ file=file.replace(0,qstrlen("namespace"),"class");
+ }
+ }
+
+ if (isDir)
+ {
+ ftv->addContentsItem(isDir,nd->localName(),ref,file,0,FALSE,TRUE,nd);
+
+ if (addToIndex)
+ {
+ // the namespace entry is already shown under the namespace list so don't
+ // add it to the nav index and don't create a separate index file for it otherwise
+ // it will overwrite the one written for the namespace list.
+ Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
+ false, // separateIndex
+ false // addToNavIndex
+ );
+ }
+ if (addToIndex)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
+
+ ftv->incContentsDepth();
+ writeClassTreeInsideNamespace(nd->getNamespaceSDict(),ftv,FALSE,addToIndex,ct);
+ ClassSDict *d = nd->getClassSDict();
+ if (sliceOpt)
+ {
+ if (ct == ClassDef::Interface)
{
- ClassSDict *d = nd->getClassSDict();
- if (sliceOpt)
- {
- if (ct == ClassDef::Interface)
- {
- d = nd->getInterfaceSDict();
- }
- else if (ct == ClassDef::Struct)
- {
- d = nd->getStructSDict();
- }
- else if (ct == ClassDef::Exception)
- {
- d = nd->getExceptionSDict();
- }
- }
- writeClassTree(d,ftv,addToIndex,FALSE,ct);
+ d = nd->getInterfaceSDict();
+ }
+ else if (ct == ClassDef::Struct)
+ {
+ d = nd->getStructSDict();
+ }
+ else if (ct == ClassDef::Exception)
+ {
+ d = nd->getExceptionSDict();
}
- ftv->decContentsDepth();
- if (addToIndex) Doxygen::indexList->decContentsDepth();
+ }
+ writeClassTree(d,ftv,addToIndex,FALSE,ct);
+ ftv->decContentsDepth();
+
+ if (addToIndex)
+ {
+ Doxygen::indexList->decContentsDepth();
}
}
}
@@ -1794,7 +1933,7 @@ static void writeNamespaceIndex(OutputList &ol)
Doxygen::indexList->incContentsDepth();
}
FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,FALSE,addToIndex,ClassDef::Class);
+ writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,addToIndex);
QGString outStr;
FTextStream t(&outStr);
ftv->generateTreeViewInline(t);
@@ -2424,26 +2563,50 @@ static void writeAlphabeticalExceptionIndex(OutputList &ol)
//----------------------------------------------------------------------------
-static void writeAnnotatedIndex(OutputList &ol)
+struct AnnotatedIndexContext
+{
+ AnnotatedIndexContext(int numAnno,int numPrint,
+ LayoutNavEntry::Kind lk,LayoutNavEntry::Kind fk,
+ const QCString &title,const QCString &intro,
+ ClassDef::CompoundType ct,
+ const QCString &fn,
+ HighlightedItem hi) :
+ numAnnotated(numAnno), numPrinted(numPrint),
+ listKind(lk), fallbackKind(fk),
+ listDefaultTitleText(title), listDefaultIntroText(intro),
+ compoundType(ct),fileBaseName(fn),
+ hiItem(hi) { }
+
+ const int numAnnotated;
+ const int numPrinted;
+ const LayoutNavEntry::Kind listKind;
+ const LayoutNavEntry::Kind fallbackKind;
+ const QCString listDefaultTitleText;
+ const QCString listDefaultIntroText;
+ const ClassDef::CompoundType compoundType;
+ const QCString fileBaseName;
+ const HighlightedItem hiItem;
+};
+
+static void writeAnnotatedIndexGeneric(OutputList &ol,const AnnotatedIndexContext ctx)
{
//printf("writeAnnotatedIndex: count=%d printed=%d\n",
// annotatedClasses,annotatedClassesPrinted);
- if (annotatedClasses==0) return;
+ if (ctx.numAnnotated==0) return;
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
- if (annotatedClassesPrinted==0)
+ if (ctx.numPrinted==0)
{
ol.disable(OutputGenerator::Latex);
ol.disable(OutputGenerator::RTF);
}
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes); // fall back
- QCString title = lne ? lne->title() : theTranslator->trCompoundList();
+ LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(ctx.listKind);
+ if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(ctx.fallbackKind); // fall back
+ QCString title = lne ? lne->title() : ctx.listDefaultTitleText;
bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotated",0,title,HLI_AnnotatedClasses);
+ startFile(ol,ctx.fileBaseName,0,title,ctx.hiItem);
startTitle(ol,0);
ol.parseText(title);
@@ -2452,7 +2615,7 @@ static void writeAnnotatedIndex(OutputList &ol)
ol.startContents();
ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trCompoundListDescription());
+ ol.parseText(lne ? lne->intro() : ctx.listDefaultIntroText);
ol.endTextBlock();
// ---------------
@@ -2462,7 +2625,7 @@ static void writeAnnotatedIndex(OutputList &ol)
ol.disable(OutputGenerator::Html);
Doxygen::indexList->disable();
- writeAnnotatedClassList(ol, ClassDef::Class);
+ writeAnnotatedClassList(ol, ctx.compoundType);
Doxygen::indexList->enable();
ol.popGeneratorState();
@@ -2476,17 +2639,16 @@ static void writeAnnotatedIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,0,ctx.fileBaseName,0,TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Class);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Class);
+ FTVHelp ftv(false);
+ writeClassTreeInsideNamespace(Doxygen::namespaceSDict,&ftv,TRUE,addToIndex,ctx.compoundType);
+ writeClassTree(Doxygen::classSDict,&ftv,addToIndex,TRUE,ctx.compoundType);
QGString outStr;
FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
+ ftv.generateTreeViewInline(t);
ol.writeString(outStr);
- delete ftv;
if (addToIndex)
{
Doxygen::indexList->decContentsDepth();
@@ -2502,233 +2664,58 @@ static void writeAnnotatedIndex(OutputList &ol)
//----------------------------------------------------------------------------
-static void writeAnnotatedInterfaceIndex(OutputList &ol)
+static void writeAnnotatedIndex(OutputList &ol)
{
- //printf("writeAnnotatedInterfaceIndex: count=%d printed=%d\n",
- // annotatedInterfaces,annotatedInterfacesPrinted);
- if (annotatedInterfaces==0) return;
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedClasses,annotatedClassesPrinted,
+ LayoutNavEntry::ClassList,LayoutNavEntry::Classes,
+ theTranslator->trCompoundList(),theTranslator->trCompoundListDescription(),
+ ClassDef::Class,
+ "annotated",
+ HLI_AnnotatedClasses));
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- if (annotatedInterfacesPrinted==0)
- {
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- }
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Interfaces); // fall back
- QCString title = lne ? lne->title() : theTranslator->trInterfaceList();
- bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotatedinterfaces",0,title,HLI_AnnotatedInterfaces);
-
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
-
- ol.startContents();
-
- ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trInterfaceListDescription());
- ol.endTextBlock();
-
- // ---------------
- // Linear interface index for Latex/RTF
- // ---------------
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- Doxygen::indexList->disable();
-
- writeAnnotatedClassList(ol, ClassDef::Interface);
-
- Doxygen::indexList->enable();
- ol.popGeneratorState();
-
- // ---------------
- // Hierarchical interface index for HTML
- // ---------------
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
+}
- {
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedinterfaces",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Interface);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Interface);
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
- delete ftv;
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- }
+//----------------------------------------------------------------------------
- ol.popGeneratorState();
- // ------
+static void writeAnnotatedInterfaceIndex(OutputList &ol)
+{
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedInterfaces,annotatedInterfacesPrinted,
+ LayoutNavEntry::InterfaceList,LayoutNavEntry::Interfaces,
+ theTranslator->trInterfaceList(),theTranslator->trInterfaceListDescription(),
+ ClassDef::Interface,
+ "annotatedinterfaces",
+ HLI_AnnotatedInterfaces));
- endFile(ol); // contains ol.endContents()
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------
static void writeAnnotatedStructIndex(OutputList &ol)
{
- //printf("writeAnnotatedStructIndex: count=%d printed=%d\n",
- // annotatedStructs,annotatedStructsPrinted);
- if (annotatedStructs==0) return;
-
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- if (annotatedStructsPrinted==0)
- {
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- }
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::StructList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Structs); // fall back
- QCString title = lne ? lne->title() : theTranslator->trStructList();
- bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotatedstructs",0,title,HLI_AnnotatedStructs);
-
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
-
- ol.startContents();
-
- ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trStructListDescription());
- ol.endTextBlock();
-
- // ---------------
- // Linear struct index for Latex/RTF
- // ---------------
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- Doxygen::indexList->disable();
-
- writeAnnotatedClassList(ol, ClassDef::Struct);
-
- Doxygen::indexList->enable();
- ol.popGeneratorState();
-
- // ---------------
- // Hierarchical struct index for HTML
- // ---------------
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
-
- {
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedstructs",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Struct);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Struct);
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
- delete ftv;
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- }
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedStructs,annotatedStructsPrinted,
+ LayoutNavEntry::StructList,LayoutNavEntry::Structs,
+ theTranslator->trStructList(),theTranslator->trStructListDescription(),
+ ClassDef::Struct,
+ "annotatedstructs",
+ HLI_AnnotatedStructs));
- ol.popGeneratorState();
- // ------
-
- endFile(ol); // contains ol.endContents()
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------
static void writeAnnotatedExceptionIndex(OutputList &ol)
{
- //printf("writeAnnotatedExceptionIndex: count=%d printed=%d\n",
- // annotatedExceptions,annotatedExceptionsPrinted);
- if (annotatedExceptions==0) return;
-
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- if (annotatedExceptionsPrinted==0)
- {
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- }
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Exceptions); // fall back
- QCString title = lne ? lne->title() : theTranslator->trExceptionList();
- bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotatedexceptions",0,title,HLI_AnnotatedExceptions);
-
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
-
- ol.startContents();
-
- ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trExceptionListDescription());
- ol.endTextBlock();
-
- // ---------------
- // Linear interface index for Latex/RTF
- // ---------------
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- Doxygen::indexList->disable();
-
- writeAnnotatedClassList(ol, ClassDef::Exception);
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedExceptions,annotatedExceptionsPrinted,
+ LayoutNavEntry::ExceptionList,LayoutNavEntry::Exceptions,
+ theTranslator->trExceptionList(),theTranslator->trExceptionListDescription(),
+ ClassDef::Exception,
+ "annotatedexceptions",
+ HLI_AnnotatedExceptions));
- Doxygen::indexList->enable();
- ol.popGeneratorState();
-
- // ---------------
- // Hierarchical interface index for HTML
- // ---------------
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
-
- {
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedexceptions",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Exception);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Exception);
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
- delete ftv;
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- }
-
- ol.popGeneratorState();
- // ------
-
- endFile(ol); // contains ol.endContents()
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 15e18bc..930efd6 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -808,6 +808,7 @@ int Markdown::processLink(const char *data,int,int size)
}
contentStart=i;
int level=1;
+ int nlTotal=0;
int nl=0;
// find the matching ]
while (i<size)
@@ -831,6 +832,8 @@ int Markdown::processLink(const char *data,int,int size)
}
i++;
}
+ nlTotal += nl;
+ nl = 0;
if (i>=size) return 0; // premature end of comment -> no link
contentEnd=i;
convertStringFragment(content,data+contentStart,contentEnd-contentStart);
@@ -843,9 +846,12 @@ int Markdown::processLink(const char *data,int,int size)
if (i<size && data[i]=='\n') // one newline allowed here
{
i++;
+ nl++;
// skip more whitespace
while (i<size && data[i]==' ') i++;
}
+ nlTotal += nl;
+ nl = 0;
bool explicitTitle=FALSE;
if (i<size && data[i]=='(') // inline link
@@ -854,7 +860,6 @@ int Markdown::processLink(const char *data,int,int size)
while (i<size && data[i]==' ') i++;
if (i<size && data[i]=='<') i++;
linkStart=i;
- nl=0;
int braceCount=1;
while (i<size && data[i]!='\'' && data[i]!='"' && braceCount>0)
{
@@ -876,6 +881,8 @@ int Markdown::processLink(const char *data,int,int size)
i++;
}
}
+ nlTotal += nl;
+ nl = 0;
if (i>=size || data[i]=='\n') return 0;
convertStringFragment(link,data+linkStart,i-linkStart);
link = link.stripWhiteSpace();
@@ -985,6 +992,8 @@ int Markdown::processLink(const char *data,int,int size)
{
return 0;
}
+ nlTotal += nl;
+ nl = 0;
if (isToc) // special case for [TOC]
{
int toc_level = Config_getInt(TOC_INCLUDE_HEADINGS);
@@ -1066,6 +1075,7 @@ int Markdown::processLink(const char *data,int,int size)
m_out.addStr("<a href=\"");
m_out.addStr(link);
m_out.addStr("\"");
+ for (int ii = 0; ii < nlTotal; ii++) m_out.addStr("\n");
if (!title.isEmpty())
{
m_out.addStr(" title=\"");
diff --git a/src/util.cpp b/src/util.cpp
index 6045bac..dd25284 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -2595,7 +2595,7 @@ exit:
return prot;
}
-void trimBaseClassScope(BaseClassList bcl,QCString &s,int level=0)
+void trimBaseClassScope(const BaseClassList &bcl,QCString &s,int level=0)
{
//printf("trimBaseClassScope level=%d '%s'\n",level,s.data());
for (const auto &bcd : bcl)
@@ -4581,7 +4581,7 @@ int getPrefixIndex(const QCString &name)
//----------------------------------------------------------------------------
-static void initBaseClassHierarchy(BaseClassList bcl)
+static void initBaseClassHierarchy(const BaseClassList &bcl)
{
for (const auto &bcd : bcl)
{
@@ -4636,7 +4636,7 @@ void initClassHierarchy(ClassSDict *cl)
//----------------------------------------------------------------------------
-bool hasVisibleRoot(BaseClassList bcl)
+bool hasVisibleRoot(const BaseClassList &bcl)
{
for (const auto &bcd : bcl)
{
@@ -8031,54 +8031,65 @@ uint getUtf8CodeToUpper( const QCString& s, int idx )
}
//--------------------------------------------------------------------------------------
+//
+bool namespaceHasNestedNamespace(const NamespaceDef *nd)
+{
+ NamespaceSDict::Iterator cnli(*nd->getNamespaceSDict());
+ const NamespaceDef *cnd;
+ for (cnli.toFirst();(cnd=cnli.current());++cnli)
+ {
+ if (cnd->isLinkableInProject() && !cnd->isAnonymous())
+ {
+ return true;
+ }
+ }
+ return false;
+}
-bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct)
+bool namespaceHasNestedClass(const NamespaceDef *nd,bool filterClasses,ClassDef::CompoundType ct)
{
+ //printf(">namespaceHasVisibleChild(%s,includeClasses=%d)\n",nd->name().data(),includeClasses);
if (nd->getNamespaceSDict())
{
NamespaceSDict::Iterator cnli(*nd->getNamespaceSDict());
const NamespaceDef *cnd;
for (cnli.toFirst();(cnd=cnli.current());++cnli)
{
- if (cnd->isLinkableInProject() && !cnd->isAnonymous())
- {
- return TRUE;
- }
- else if (namespaceHasVisibleChild(cnd,includeClasses,filterClasses,ct))
+ if (namespaceHasNestedClass(cnd,filterClasses,ct))
{
+ //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case2\n",nd->name().data(),includeClasses);
return TRUE;
}
}
}
- if (includeClasses)
+
+ const ClassSDict *d = nd->getClassSDict();
+ if (filterClasses)
{
- const ClassSDict *d = nd->getClassSDict();
- if (filterClasses)
+ if (ct == ClassDef::Interface)
{
- if (ct == ClassDef::Interface)
- {
- d = nd->getInterfaceSDict();
- }
- else if (ct == ClassDef::Struct)
- {
- d = nd->getStructSDict();
- }
- else if (ct == ClassDef::Exception)
- {
- d = nd->getExceptionSDict();
- }
+ d = nd->getInterfaceSDict();
}
+ else if (ct == ClassDef::Struct)
+ {
+ d = nd->getStructSDict();
+ }
+ else if (ct == ClassDef::Exception)
+ {
+ d = nd->getExceptionSDict();
+ }
+ }
- if (d)
+ if (d)
+ {
+ ClassSDict::Iterator cli(*d);
+ const ClassDef *cd;
+ for (;(cd=cli.current());++cli)
{
- ClassSDict::Iterator cli(*d);
- const ClassDef *cd;
- for (;(cd=cli.current());++cli)
+ if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
- if (cd->isLinkableInProject() && cd->templateMaster()==0)
- {
- return TRUE;
- }
+ //printf("<namespaceHasVisibleChild(%s,includeClasses=%d): case3\n",nd->name().data(),includeClasses);
+ return TRUE;
}
}
}
diff --git a/src/util.h b/src/util.h
index 09b1d22..bc4b025 100644
--- a/src/util.h
+++ b/src/util.h
@@ -310,9 +310,10 @@ QCString replaceAnonymousScopes(const QCString &s,const char *replacement=0);
void initClassHierarchy(ClassSDict *cl);
-bool hasVisibleRoot(BaseClassList bcl);
+bool hasVisibleRoot(const BaseClassList &bcl);
bool classHasVisibleChildren(const ClassDef *cd);
-bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct);
+bool namespaceHasNestedNamespace(const NamespaceDef *nd);
+bool namespaceHasNestedClass(const NamespaceDef *nd,bool filterClasses,ClassDef::CompoundType ct);
bool classVisibleInIndex(const ClassDef *cd);
int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level=0);