diff options
-rw-r--r-- | src/classdef.cpp | 27 | ||||
-rw-r--r-- | src/classdef.h | 1 | ||||
-rw-r--r-- | src/classlist.cpp | 6 | ||||
-rw-r--r-- | src/context.cpp | 15 | ||||
-rw-r--r-- | src/definition.cpp | 43 | ||||
-rw-r--r-- | src/definition.h | 5 | ||||
-rw-r--r-- | src/definitionimpl.h | 3 | ||||
-rw-r--r-- | src/doxygen.cpp | 16 | ||||
-rw-r--r-- | src/index.cpp | 6 | ||||
-rw-r--r-- | src/memberdef.cpp | 24 | ||||
-rw-r--r-- | src/perlmodgen.cpp | 4 | ||||
-rw-r--r-- | src/sqlite3gen.cpp | 8 | ||||
-rw-r--r-- | src/tclscanner.l | 7 | ||||
-rw-r--r-- | src/tooltip.cpp | 5 | ||||
-rw-r--r-- | src/util.cpp | 2 | ||||
-rw-r--r-- | src/xmlgen.cpp | 9 | ||||
-rw-r--r-- | testing/071/namespace_a_namespace_1_1_0d0.xml | 8 | ||||
-rw-r--r-- | testing/078/078__xml__namespace__members__in__file__scope_8h.xml | 4 |
18 files changed, 95 insertions, 98 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 7ce6bf1..9c2ab53 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -133,7 +133,6 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual MemberDef *isSmartPointer() const; virtual bool isJavaEnum() const; virtual bool isGeneric() const; - virtual bool isAnonymous() const; virtual const ClassSDict *innerClasses() const; virtual QCString title() const; virtual QCString generatedFromFiles() const; @@ -423,8 +422,6 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef { return getCdAlias()->isJavaEnum(); } virtual bool isGeneric() const { return getCdAlias()->isGeneric(); } - virtual bool isAnonymous() const - { return getCdAlias()->isAnonymous(); } virtual const ClassSDict *innerClasses() const { return getCdAlias()->innerClasses(); } virtual QCString title() const @@ -687,8 +684,6 @@ class ClassDefImpl::IMPL bool isGeneric; - bool isAnonymous; - uint64 spec; QCString metaData; @@ -751,7 +746,6 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name, isLocal=FALSE; } isGeneric = (lang==SrcLangExt_CSharp || lang==SrcLangExt_Java) && QCString(name).find('<')!=-1; - isAnonymous = QCString(name).find('@')!=-1; } ClassDefImpl::IMPL::IMPL() : vhdlSummaryTitles(17) @@ -835,6 +829,10 @@ QCString ClassDefImpl::displayName(bool includeScope) const n=className(); } } + if (isAnonymous()) + { + n = removeAnonymousScopes(n); + } QCString sep=getLanguageSpecificSeparator(lang); if (sep!="::") { @@ -849,14 +847,7 @@ QCString ClassDefImpl::displayName(bool includeScope) const // n = n.left(n.length()-2); //} //printf("ClassDefImpl::displayName()=%s\n",n.data()); - if (n.find('@')!=-1) - { - return removeAnonymousScopes(n); - } - else - { - return n; - } + return n; } // inserts a base/super class in the inheritance list @@ -3077,7 +3068,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n", // name().data(),md->name().data(),cd->name().data(),md->protection(),mi->prot,prot,mi->inherited); - if (cd && !md->name().isEmpty() && md->name()[0]!='@') + if (cd && !md->name().isEmpty() && !md->isAnonymous()) { bool memberWritten=FALSE; if (cd->isLinkable() && md->isLinkable()) @@ -5299,7 +5290,6 @@ bool ClassDefImpl::isSliceLocal() const void ClassDefImpl::setName(const char *name) { - m_impl->isAnonymous = QCString(name).find('@')!=-1; DefinitionImpl::setName(name); } @@ -5308,11 +5298,6 @@ void ClassDefImpl::setMetaData(const char *md) m_impl->metaData = md; } -bool ClassDefImpl::isAnonymous() const -{ - return m_impl->isAnonymous; -} - QCString ClassDefImpl::collaborationGraphFileName() const { return m_impl->collabFileName; diff --git a/src/classdef.h b/src/classdef.h index c9cc806..3158c50 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -302,7 +302,6 @@ class ClassDef : virtual public Definition virtual bool isJavaEnum() const = 0; virtual bool isGeneric() const = 0; - virtual bool isAnonymous() const = 0; virtual const ClassSDict *innerClasses() const = 0; virtual QCString title() const = 0; diff --git a/src/classlist.cpp b/src/classlist.cpp index 6928c52..2b284b1 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -72,7 +72,7 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const ClassDef *cd=0; for (sdi.toFirst();(cd=sdi.current());++sdi) { - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && (filter==0 || *filter==cd->compoundType()) ) { @@ -103,7 +103,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f for (sdi.toFirst();(cd=sdi.current());++sdi) { //printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data()); - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && !cd->isExtension() && (cd->protection()!=Private || extractPrivate) && (filter==0 || *filter==cd->compoundType()) @@ -137,7 +137,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,const Definition * container) // cd->name().data(),cd->getOuterScope(),cd->isLinkableInProject(),cd->isEmbeddedInOuterScope(), // container,cd->partOfGroups() ? cd->partOfGroups()->count() : 0); - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && cd->isLinkableInProject() && cd->isEmbeddedInOuterScope() && !cd->isAlias() && diff --git a/src/context.cpp b/src/context.cpp index 361bfa2..0dd81af 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -2353,7 +2353,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && cd->isLinkableInProject() && cd->isEmbeddedInOuterScope() && cd->partOfGroups()==0 @@ -2941,7 +2941,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && cd->isLinkableInProject() && cd->isEmbeddedInOuterScope() && cd->partOfGroups()==0) @@ -3405,7 +3405,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && cd->isLinkableInProject() && cd->isEmbeddedInOuterScope() && cd->partOfGroups()==0) @@ -4450,8 +4450,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> } TemplateVariant isAnonymous() const { - QCString name = m_memberDef->name(); - return !name.isEmpty() && name.at(0)=='@'; + return m_memberDef->isAnonymous(); } TemplateVariant anonymousType() const { @@ -5725,7 +5724,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { - if (cd->name().find('@')==-1 && + if (!cd->isAnonymous() && cd->isLinkableInProject() && cd->isEmbeddedInOuterScope() && cd->partOfGroups()==0) @@ -6543,7 +6542,7 @@ class NestingContext::Private : public GenericNodeListContext const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (nd->localName().find('@')==-1 && + if (!nd->isAnonymous() && (!rootOnly || nd->getOuterScope()==Doxygen::globalScope)) { bool hasChildren = namespaceHasVisibleChild(nd,addClasses,false,ClassDef::Class); @@ -8799,7 +8798,7 @@ class AllMembersListContext::Private : public GenericNodeListContext { MemberDef *md=mi->memberDef; const ClassDef *cd=md->getClassDef(); - if (cd && !md->name().isEmpty() && md->name()[0]!='@') + if (cd && !md->isAnonymous()) { if ((cd->isLinkable() && md->isLinkable()) || (!cd->isArtificial() && !hideUndocMembers && diff --git a/src/definition.cpp b/src/definition.cpp index 5b2136c..1a166fe 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -51,22 +51,21 @@ class DefinitionImpl::IMPL { public: - IMPL(); ~IMPL(); void init(const char *df, const char *n); void setDefFileName(const QCString &df); - SectionDict *sectionDict; // dictionary of all sections, not accessible + SectionDict *sectionDict = 0; // dictionary of all sections, not accessible - MemberSDict *sourceRefByDict; - MemberSDict *sourceRefsDict; + MemberSDict *sourceRefByDict = 0; + MemberSDict *sourceRefsDict = 0; std::vector<ListItemInfo> xrefListItems; - GroupList *partOfGroups; + GroupList *partOfGroups = 0; - DocInfo *details; // not exported - DocInfo *inbodyDocs; // not exported - BriefInfo *brief; // not exported - BodyInfo *body; // not exported + DocInfo *details = 0; // not exported + DocInfo *inbodyDocs = 0; // not exported + BriefInfo *brief = 0; // not exported + BodyInfo *body = 0; // not exported QCString briefSignatures; QCString docSignatures; @@ -75,16 +74,17 @@ class DefinitionImpl::IMPL QCString qualifiedName; QCString ref; // reference to external documentation - bool hidden; - bool isArtificial; + bool hidden = FALSE; + bool isArtificial = FALSE; + bool isAnonymous = FALSE; - Definition *outerScope; // not owner + Definition *outerScope = 0; // not owner // where the item was defined QCString defFileName; QCString defFileExt; - SrcLangExt lang; + SrcLangExt lang = SrcLangExt_Unknown; QCString id; // clang unique id @@ -96,13 +96,6 @@ class DefinitionImpl::IMPL Cookie *cookie; }; -DefinitionImpl::IMPL::IMPL() - : sectionDict(0), sourceRefByDict(0), sourceRefsDict(0), - partOfGroups(0), - details(0), inbodyDocs(0), brief(0), body(0), hidden(FALSE), isArtificial(FALSE), - outerScope(0), lang(SrcLangExt_Unknown) -{ -} DefinitionImpl::IMPL::~IMPL() { @@ -304,7 +297,7 @@ DefinitionImpl::DefinitionImpl(const char *df,int dl,int dc, const char *d,bool isSymbol) { m_impl = new DefinitionImpl::IMPL; - m_impl->name = name; + setName(name); m_impl->defLine = dl; m_impl->defColumn = dc; m_impl->init(df,name); @@ -406,6 +399,9 @@ void DefinitionImpl::setName(const char *name) { if (name==0) return; m_impl->name = name; + m_impl->isAnonymous = m_impl->name.isEmpty() || + m_impl->name.at(0)=='@' || + m_impl->name.find("::@")!=-1; } void DefinitionImpl::setId(const char *id) @@ -2203,6 +2199,11 @@ QCString DefinitionImpl::name() const return m_impl->name; } +bool DefinitionImpl::isAnonymous() const +{ + return m_impl->isAnonymous; +} + int DefinitionImpl::getDefLine() const { return m_impl->defLine; diff --git a/src/definition.h b/src/definition.h index d458683..b3ece2c 100644 --- a/src/definition.h +++ b/src/definition.h @@ -112,6 +112,11 @@ class Definition : public DefinitionIntf /*! Returns the name of the definition */ virtual QCString name() const = 0; + /*! Returns TRUE iff this definition has an artificially generated name + * (typically starting with a @) that is used for nameless definitions + */ + virtual bool isAnonymous() const = 0; + /*! Returns the name of the definition as it appears in the output */ virtual QCString displayName(bool includeScope=TRUE) const = 0; diff --git a/src/definitionimpl.h b/src/definitionimpl.h index 036c875..2d8886d 100644 --- a/src/definitionimpl.h +++ b/src/definitionimpl.h @@ -32,6 +32,7 @@ class DefinitionImpl : virtual public Definition virtual bool isAlias() const { return FALSE; } virtual QCString name() const; + virtual bool isAnonymous() const; virtual QCString localName() const; virtual QCString qualifiedName() const; virtual QCString symbolName() const; @@ -142,6 +143,8 @@ class DefinitionAliasImpl : virtual public Definition virtual bool isAlias() const { return TRUE; } virtual QCString name() const { return m_def->name(); } + virtual bool isAnonymous() const + { return m_def->isAnonymous(); } virtual QCString localName() const { return m_def->localName(); } virtual QCString qualifiedName() const diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 4f4d13b..bf282b6 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1604,7 +1604,7 @@ static void processTagLessClasses(ClassDef *rootCd, if (type.find(icd->name())!=-1) // matching tag less struct/union { QCString name = md->name(); - if (name.at(0)=='@') name = "__unnamed__"; + if (md->isAnonymous()) name = "__unnamed__"; if (!prefix.isEmpty()) name.prepend(prefix+"."); //printf(" found %s for class %s\n",name.data(),cd->name().data()); ClassDef *ncd = createTagLessInstance(rootCd,icd,name); @@ -2461,7 +2461,7 @@ static MemberDef *addVariableToFile( QCString def; // determine the definition of the global variable - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@' && + if (nd && !nd->isAnonymous() && !Config_getBool(HIDE_SCOPE_NAMES) ) // variable is inside a namespace, so put the scope before the name @@ -2616,7 +2616,7 @@ static MemberDef *addVariableToFile( addMemberToGroups(root,md); md->setRefItems(root->sli); - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + if (nd && !nd->isAnonymous()) { md->setNamespace(nd); nd->insertMember(md); @@ -7027,7 +7027,7 @@ static void findEnums(const Entry *root) mnsd=Doxygen::memberNameSDict; isGlobal=FALSE; } - else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace + else if (nd) // found enum inside namespace { mnsd=Doxygen::functionNameSDict; isGlobal=TRUE; @@ -7076,7 +7076,7 @@ static void findEnums(const Entry *root) baseType.prepend(" : "); } - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + if (nd) { if (isRelated || Config_getBool(HIDE_SCOPE_NAMES)) { @@ -7095,7 +7095,7 @@ static void findEnums(const Entry *root) // even if we have already added the enum to a namespace, we still // also want to add it to other appropriate places such as file // or class. - if (isGlobal) + if (isGlobal && (nd==0 || !nd->isAnonymous())) { if (!defSet) md->setDefinition(name+baseType); if (fd==0 && root->parent()) @@ -7204,7 +7204,7 @@ static void addEnumValuesToEnums(const Entry *root) mnsd=Doxygen::memberNameSDict; isGlobal=FALSE; } - else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace + else if (nd && !nd->isAnonymous()) // found enum inside namespace { //printf("Enum in namespace '%s'::'%s'\n",nd->name().data(),name.data()); mnsd=Doxygen::functionNameSDict; @@ -7312,7 +7312,7 @@ static void addEnumValuesToEnums(const Entry *root) { //printf("found enum value with same name %s in scope %s\n", // fmd->name().data(),fmd->getOuterScope()->name().data()); - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + if (nd && !nd->isAnonymous()) { const NamespaceDef *fnd=fmd->getNamespaceDef(); if (fnd==nd) // enum value is inside a namespace diff --git a/src/index.cpp b/src/index.cpp index 1acd941..edc302b 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -368,7 +368,7 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part, { const MemberList *enumList = md->enumFieldList(); bool isDir = enumList!=0 && md->isEnumerate(); - bool isAnonymous = md->name().find('@')!=-1; + bool isAnonymous = md->isAnonymous(); static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS); static bool extractStatic = Config_getBool(EXTRACT_STATIC); if (!isAnonymous && @@ -1660,7 +1660,7 @@ static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv, const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (nd->localName().find('@')==-1 && + if (!nd->isAnonymous() && (!rootOnly || nd->getOuterScope()==Doxygen::globalScope)) { @@ -4060,7 +4060,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* { const MemberList *enumList = md->enumFieldList(); bool isDir = enumList!=0 && md->isEnumerate(); - if (md->isVisible() && md->name().find('@')==-1) + if (md->isVisible() && !md->isAnonymous()) { Doxygen::indexList->addContentsItem(isDir, md->name(),md->getReference(), diff --git a/src/memberdef.cpp b/src/memberdef.cpp index b79bd50..9b6967b 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -1771,7 +1771,7 @@ QCString MemberDefImpl::getOutputFileBase() const return baseName; } } - else if (nspace && nspace->isLinkableInProject()) + else if (nspace) { baseName=nspace->getOutputFileBase(); } @@ -1877,7 +1877,7 @@ void MemberDefImpl::_computeLinkableInProject() m_isLinkableCached = templateMaster()->isLinkableInProject() ? 2 : 1; return; } - if (name().isEmpty() || name().at(0)=='@') + if (isAnonymous()) { //printf("name invalid\n"); m_isLinkableCached = 1; // not a valid or a dummy name @@ -2257,10 +2257,10 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, ol.startMemberDeclaration(); // start a new member declaration - bool isAnonymous = annoClassDef || m_impl->annMemb || m_impl->annEnumType; + bool isAnonType = annoClassDef || m_impl->annMemb || m_impl->annEnumType; ///printf("startMemberItem for %s\n",name().data()); ol.startMemberItem(anchor(), - isAnonymous ? 1 : !m_impl->tArgList.empty() ? 3 : 0, + isAnonType ? 1 : !m_impl->tArgList.empty() ? 3 : 0, inheritId ); @@ -2301,9 +2301,9 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, // *** write template lists if (m_impl->tArgList.hasParameters() && getLanguage()==SrcLangExt_Cpp) { - if (!isAnonymous) ol.startMemberTemplateParams(); + if (!isAnonType) ol.startMemberTemplateParams(); writeTemplatePrefix(ol,m_impl->tArgList); - if (!isAnonymous) ol.endMemberTemplateParams(anchor(),inheritId); + if (!isAnonType) ol.endMemberTemplateParams(anchor(),inheritId); } // *** write type @@ -2343,7 +2343,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace(); //printf(">>>>>> ltype='%s' varName='%s'\n",ltype.data(),varName.data()); ol.docify("}"); - if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@')) + if (varName.isEmpty() && isAnonymous()) { ol.docify(";"); } @@ -2425,13 +2425,13 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, } // *** write name - if (!name().isEmpty() && name().at(0)!='@') // hide anonymous stuff + if (!isAnonymous()) // hide anonymous stuff { static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); static bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL); static bool extractStatic = Config_getBool(EXTRACT_STATIC); //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation()); - if (!(name().isEmpty() || name().at(0)=='@') && // name valid + if (!name().isEmpty() && // name valid (hasDocumentation() || isReference()) && // has docs !(m_impl->prot==Private && !extractPrivate && (m_impl->virt==Normal || !extractPrivateVirtual) && m_impl->mtype!=MemberType_Friend) && // hidden due to protection !(isStatic() && getClassDef()==0 && !extractStatic) // hidden due to static-ness @@ -2479,7 +2479,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, } // add to index - if (isEnumerate() && name().at(0)=='@') + if (isEnumerate() && isAnonymous()) { // don't add to index } @@ -3202,7 +3202,7 @@ QCString MemberDefImpl::displayDefinition() const QCString title = name(); if (isEnumerate()) { - if (title.at(0)=='@') + if (isAnonymous()) { ldef = title = "anonymous enum"; if (!m_impl->enumBaseType.isEmpty()) @@ -3221,7 +3221,7 @@ QCString MemberDefImpl::displayDefinition() const } else if (isEnumValue()) { - if (ldef.at(0)=='@') + if (isAnonymous()) { ldef=ldef.mid(2); } diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index c8f9273..be226b7 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1792,9 +1792,9 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd) // + standard member sections // + detailed member documentation // - examples using the class - + if (cd->isReference()) return; // skip external references. - if (cd->name().find('@')!=-1) return; // skip anonymous compounds. + if (cd->isAnonymous()) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. m_output.openHash() diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index dc0cc85..cb92788 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -1125,7 +1125,7 @@ static void associateMember(const MemberDef *md, struct Refid member_refid, stru // TODO: skip EnumValue only to guard against recording refids and member records // for enumvalues until we can support documenting them as entities. if (md->memberType()==MemberType_EnumValue) return; - if (md->name().at(0)!='@') // skip anonymous members + if (!md->isAnonymous()) // skip anonymous members { bindIntParameter(member_insert, ":scope_rowid", scope_refid.rowid); bindIntParameter(member_insert, ":memberdef_rowid", member_refid.rowid); @@ -1276,7 +1276,7 @@ static void writeInnerClasses(const ClassSDict *cl, struct Refid outer_refid) const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { - if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes + if (!cd->isHidden() && !cd->isAnonymous()) { struct Refid inner_refid = insertRefid(cd->getOutputFileBase()); @@ -1365,7 +1365,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl, struct Refid outer_re const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes + if (!nd->isHidden() && !nd->isAnonymous()) { struct Refid inner_refid = insertRefid(nd->getOutputFileBase()); @@ -1954,7 +1954,7 @@ static void generateSqlite3ForClass(const ClassDef *cd) if (cd->isReference()) return; // skip external references. if (cd->isHidden()) return; // skip hidden classes. - if (cd->name().find('@')!=-1) return; // skip anonymous compounds. + if (cd->isAnonymous()) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. struct Refid refid = insertRefid(cd->getOutputFileBase()); diff --git a/src/tclscanner.l b/src/tclscanner.l index 4a262bc..45ad9c0 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -535,6 +535,13 @@ static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, Q ns = ""; name = myNm; } + else if (myNm.length()-myStart == 2) + { + // ending with :: so get name equal to last component + ns = myNm.mid(0,myStart); + myStart = ns.findRev("::"); + name = myNm.mid(myStart+2); + } else { ns = myNm.mid(0,myStart); diff --git a/src/tooltip.cpp b/src/tooltip.cpp index a30a85c..8cc1f87 100644 --- a/src/tooltip.cpp +++ b/src/tooltip.cpp @@ -115,10 +115,9 @@ void TooltipManager::writeTooltips(CodeOutputInterface &ol) if (d->definitionType()==Definition::TypeMember) { MemberDef *md = dynamic_cast<MemberDef*>(d); - decl = md->declaration(); - if (!decl.isEmpty() && decl.at(0)=='@') // hide enum values + if (!md->isAnonymous()) { - decl.resize(0); + decl = md->declaration(); } } ol.writeTooltip(di.currentKey(), // id diff --git a/src/util.cpp b/src/util.cpp index 8e0884f..9cdf810 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8646,7 +8646,7 @@ bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool fi const NamespaceDef *cnd; for (cnli.toFirst();(cnd=cnli.current());++cnli) { - if (cnd->isLinkableInProject() && cnd->localName().find('@')==-1) + if (cnd->isLinkableInProject() && !cnd->isAnonymous()) { return TRUE; } diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index dfbf630..4950778 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -514,7 +514,6 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream // enum values are written as part of the enum if (md->memberType()==MemberType_EnumValue) return; if (md->isHidden()) return; - //if (md->name().at(0)=='@') return; // anonymous member // group members are only visible in their group //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return; @@ -1090,7 +1089,7 @@ static void writeListOfAllMembers(const ClassDef *cd,FTextStream &t) for (mii.toFirst();(mi=mii.current());++mii) { const MemberDef *md=mi->memberDef; - if (md->name().at(0)!='@') // skip anonymous members + if (!md->isAnonymous()) { Protection prot = mi->prot; Specifier virt=md->virtualness(); @@ -1132,7 +1131,7 @@ static void writeInnerClasses(const ClassSDict *cl,FTextStream &t) const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { - if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes + if (!cd->isHidden() && !cd->isAnonymous()) { t << " <innerclass refid=\"" << classOutputFileBase(cd) << "\" prot=\""; @@ -1157,7 +1156,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes + if (!nd->isHidden() && !nd->isAnonymous()) { t << " <innernamespace refid=\"" << nd->getOutputFileBase() << "\">" << convertToXML(nd->name()) << "</innernamespace>" << endl; @@ -1247,7 +1246,7 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti) if (cd->isReference()) return; // skip external references. if (cd->isHidden()) return; // skip hidden classes. - if (cd->name().find('@')!=-1) return; // skip anonymous compounds. + if (cd->isAnonymous()) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. if (cd->isArtificial()) return; // skip artificially created classes diff --git a/testing/071/namespace_a_namespace_1_1_0d0.xml b/testing/071/namespace_a_namespace_1_1_0d0.xml index 14f5a51..d439723 100644 --- a/testing/071/namespace_a_namespace_1_1_0d0.xml +++ b/testing/071/namespace_a_namespace_1_1_0d0.xml @@ -3,24 +3,24 @@ <compounddef id="namespace_a_namespace_1_1_0d0" kind="namespace" language="C++"> <compoundname>ANamespace::@0</compoundname> <sectiondef kind="enum"> - <memberdef kind="enum" id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45d" prot="public" static="no" strong="yes"> + <memberdef kind="enum" id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45d" prot="public" static="no" strong="yes"> <type/> <name>Boolean</name> - <enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45daf8320b26d30ab433c5a54546d21f414c" prot="public"> + <enumvalue id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45daf8320b26d30ab433c5a54546d21f414c" prot="public"> <name>False</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> </enumvalue> - <enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45daf827cf462f62848df37c5e1e94a4da74" prot="public"> + <enumvalue id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45daf827cf462f62848df37c5e1e94a4da74" prot="public"> <name>True</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> </enumvalue> - <enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45da2767828026039e8ba7b38973cbb701f2" prot="public"> + <enumvalue id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45da2767828026039e8ba7b38973cbb701f2" prot="public"> <name>FileNotFound</name> <briefdescription> </briefdescription> diff --git a/testing/078/078__xml__namespace__members__in__file__scope_8h.xml b/testing/078/078__xml__namespace__members__in__file__scope_8h.xml index 1198549..078c5ad 100644 --- a/testing/078/078__xml__namespace__members__in__file__scope_8h.xml +++ b/testing/078/078__xml__namespace__members__in__file__scope_8h.xml @@ -4,7 +4,7 @@ <compoundname>078_xml_namespace_members_in_file_scope.h</compoundname> <innernamespace refid="namespace_namespace">Namespace</innernamespace> <sectiondef kind="enum"> - <memberdef kind="enum" id="078__xml__namespace__members__in__file__scope_8h_1add172b93283b1ab7612c3ca6cc5dcfea" prot="public" static="no" strong="yes"> + <memberdef kind="enum" id="namespace_namespace_1add172b93283b1ab7612c3ca6cc5dcfea" prot="public" static="no" strong="yes"> <type/> <name>Enum</name> <briefdescription> @@ -18,7 +18,7 @@ </memberdef> </sectiondef> <sectiondef kind="func"> - <memberdef kind="function" id="078__xml__namespace__members__in__file__scope_8h_1a0f1fe1a972c7c4196988a1bdde63ec77" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> + <memberdef kind="function" id="namespace_namespace_1a0f1fe1a972c7c4196988a1bdde63ec77" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>void</type> <definition>void Namespace::foo</definition> <argsstring>()</argsstring> |