Skip to content

Commit

Permalink
cache anonymous into ClassDefImpl::isAnonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
groleo committed Aug 4, 2014
1 parent d460173 commit 34a5a05
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/classdef.cpp
Expand Up @@ -187,6 +187,8 @@ class ClassDefImpl

bool isGeneric;

bool isAnonymous;

uint64 spec;
};

Expand Down Expand Up @@ -248,6 +250,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name,
isLocal=FALSE;
}
isGeneric = lang==SrcLangExt_CSharp && QCString(name).find('<')!=-1;
isAnonymous = QCString(name).find('@')!=-1;
}

ClassDefImpl::ClassDefImpl() : vhdlSummaryTitles(17)
Expand Down Expand Up @@ -1772,7 +1775,7 @@ bool ClassDef::visibleInParentsDeclList() const
static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES");
static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES");
bool linkable = isLinkable();
return (name().find('@')==-1 && !isExtension() &&
return (!isAnonymous() && !isExtension() &&
(protection()!=::Private || extractPrivate) &&
(linkable || (!hideUndocClasses && (!isLocal() || extractLocalClasses)))
);
Expand Down Expand Up @@ -2597,7 +2600,7 @@ bool ClassDef::isLinkableInProject() const
{
return !name().isEmpty() && /* has a name */
!isArtificial() && !isHidden() && /* not hidden */
name().find('@')==-1 && /* not anonymous */
!isAnonymous() && /* not anonymous */
protectionLevelVisible(m_impl->prot) && /* private/internal */
(!m_impl->isLocal || extractLocal) && /* local */
(hasDocumentation() || !hideUndoc) && /* documented */
Expand Down Expand Up @@ -2629,7 +2632,7 @@ bool ClassDef::isVisibleInHierarchy()
return // show all classes or a subclass is visible
(allExternals || hasNonReferenceSuperClass()) &&
// and not an anonymous compound
name().find('@')==-1 &&
!isAnonymous() &&
// not an artificially introduced class
/*!isArtificial() &&*/ // 1.8.2: allowed these to appear
// and not privately inherited
Expand Down Expand Up @@ -4603,3 +4606,13 @@ bool ClassDef::subGrouping() const
return m_impl->subGrouping;
}

void ClassDef::setName(const char *name)
{
m_impl->isAnonymous = QCString(name).find('@')!=-1;
Definition::setName(name);
}

bool ClassDef::isAnonymous() const
{
return m_impl->isAnonymous;
}
2 changes: 2 additions & 0 deletions src/classdef.h
Expand Up @@ -307,6 +307,7 @@ class ClassDef : public Definition
bool isJavaEnum() const;

bool isGeneric() const;
bool isAnonymous() const;
const ClassSDict *innerClasses() const;
QCString title() const;

Expand Down Expand Up @@ -357,6 +358,7 @@ class ClassDef : public Definition

void addTaggedInnerClass(ClassDef *cd);
void setTagLessReference(ClassDef *cd);
void setName(const char *name);

//-----------------------------------------------------------------------------------
// --- actions ----
Expand Down

0 comments on commit 34a5a05

Please sign in to comment.