diff options
Diffstat (limited to 'src/memberdef.cpp')
-rw-r--r-- | src/memberdef.cpp | 83 |
1 files changed, 75 insertions, 8 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 8f57802..a2fcf69 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -484,7 +484,7 @@ class MemberDefImpl void init(Definition *def,const char *t,const char *a,const char *e, Protection p,Specifier v,bool s,Relationship r, MemberType mt,const ArgumentList *tal, - const ArgumentList *al + const ArgumentList *al,const char *meta ); ClassDef *classDef; // member of or related to @@ -539,6 +539,8 @@ class MemberDefImpl QList<ArgumentList> *defTmpArgLists; // lists of template argument lists // (for template functions in nested template classes) + QCString metaData; // Slice metadata. + ClassDef *cachedAnonymousType; // if the member has an anonymous compound // as its type then this is computed by // getClassDefOfAnonymousType() and @@ -628,7 +630,7 @@ void MemberDefImpl::init(Definition *def, const char *t,const char *a,const char *e, Protection p,Specifier v,bool s,Relationship r, MemberType mt,const ArgumentList *tal, - const ArgumentList *al + const ArgumentList *al,const char *meta ) { classDef=0; @@ -713,6 +715,7 @@ void MemberDefImpl::init(Definition *def, { declArgList = 0; } + metaData = meta; templateMaster = 0; classSectionSDict = 0; docsForDefinition = TRUE; @@ -752,17 +755,18 @@ void MemberDefImpl::init(Definition *def, * \param tal The template arguments of this member. * \param al The arguments of this member. This is a structured form of * the string past as argument \a a. + * \param meta Slice metadata. */ MemberDef::MemberDef(const char *df,int dl,int dc, const char *t,const char *na,const char *a,const char *e, Protection p,Specifier v,bool s,Relationship r,MemberType mt, - const ArgumentList *tal,const ArgumentList *al + const ArgumentList *tal,const ArgumentList *al,const char *meta ) : Definition(df,dl,dc,removeRedundantWhiteSpace(na)), visited(FALSE) { //printf("MemberDef::MemberDef(%s)\n",na); m_impl = new MemberDefImpl; - m_impl->init(this,t,a,e,p,v,s,r,mt,tal,al); + m_impl->init(this,t,a,e,p,v,s,r,mt,tal,al,meta); number_of_flowkw = 1; m_isLinkableCached = 0; m_isConstructorCached = 0; @@ -1405,7 +1409,7 @@ bool MemberDef::isBriefSectionVisible() const QCString MemberDef::getDeclType() const { QCString ltype(m_impl->type); - if (m_impl->mtype==MemberType_Typedef) + if (isTypedef() && getLanguage() != SrcLangExt_Slice) { ltype.prepend("typedef "); } @@ -1515,7 +1519,10 @@ void MemberDef::writeDeclaration(OutputList &ol, // *** write type QCString ltype(m_impl->type); - if (m_impl->mtype==MemberType_Typedef) ltype.prepend("typedef "); + if (isTypedef() && getLanguage() != SrcLangExt_Slice) + { + ltype.prepend("typedef "); + } if (isAlias()) { ltype="using"; @@ -2430,6 +2437,10 @@ QCString MemberDef::displayDefinition() const else { ldef.prepend("enum "); + if (isSliceLocal()) + { + ldef.prepend("local "); + } } } else if (isEnumValue()) @@ -2607,6 +2618,10 @@ void MemberDef::writeDocumentation(MemberList *ml, else { ldef.prepend("enum "); + if (isSliceLocal()) + { + ldef.prepend("local "); + } } } else if (isEnumValue()) @@ -2623,6 +2638,17 @@ void MemberDef::writeDocumentation(MemberList *ml, int i=0,l; static QRegExp r("@[0-9]+"); + if (lang == SrcLangExt_Slice) + { + // Remove the container scope from the member name. + QCString prefix = scName + sep; + int pos = ldef.findRev(prefix.data()); + if(pos != -1) + { + ldef.remove(pos, prefix.length()); + } + } + //---------------------------------------- ol.pushGeneratorState(); @@ -2678,6 +2704,13 @@ void MemberDef::writeDocumentation(MemberList *ml, ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); ol.startMemberDoc(ciname,name(),memAnchor,title,memCount,memTotal,showInline); + if (!m_impl->metaData.isEmpty() && getLanguage()==SrcLangExt_Slice) + { + ol.startMemberDocPrefixItem(); + ol.docify(m_impl->metaData); + ol.endMemberDocPrefixItem(); + } + ClassDef *cd=getClassDef(); NamespaceDef *nd=getNamespaceDef(); if (!Config_getBool(HIDE_SCOPE_NAMES)) @@ -2782,6 +2815,21 @@ void MemberDef::writeDocumentation(MemberList *ml, { hasParameterList=VhdlDocGen::writeVHDLTypeDocumentation(this,scopedContainer,ol); } + else if (lang==SrcLangExt_Slice) + { + // Eliminate the self-reference. + int pos = ldef.findRev(' '); + linkifyText(TextGeneratorOLImpl(ol), + scopedContainer, + getBodyDef(), + this, + ldef.left(pos) + ); + ol.docify(ldef.mid(pos)); + Definition *scope = cd; + if (scope==0) scope = nd; + hasParameterList=writeDefArgumentList(ol,scope,this); + } else { linkifyText(TextGeneratorOLImpl(ol), @@ -3086,7 +3134,7 @@ QCString MemberDef::fieldType() const type = m_impl->type; } - if (isTypedef()) type.prepend("typedef "); + if (isTypedef() && getLanguage() != SrcLangExt_Slice) type.prepend("typedef "); return simplifyTypeForTable(type); } @@ -3203,6 +3251,8 @@ QCString MemberDef::memberTypeName() const case MemberType_Event: return "event"; case MemberType_Interface: return "interface"; case MemberType_Service: return "service"; + case MemberType_Sequence: return "sequence"; + case MemberType_Dictionary: return "dictionary"; default: return "unknown"; } } @@ -3465,7 +3515,7 @@ MemberDef *MemberDef::createTemplateInstanceMember( methodName, substituteTemplateArgumentsInString(m_impl->args,formalArgs,actualArgs), m_impl->exception, m_impl->prot, - m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0 + m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0, "" ); imd->setArgumentList(actualArgList); imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def,formalArgs,actualArgs)); @@ -3627,6 +3677,8 @@ void MemberDef::writeTagFile(FTextStream &tagFile) case MemberType_Slot: tagFile << "slot"; break; case MemberType_Interface: tagFile << "interface"; break; case MemberType_Service: tagFile << "service"; break; + case MemberType_Sequence: tagFile << "sequence"; break; + case MemberType_Dictionary: tagFile << "dictionary"; break; } if (m_impl->prot!=Public) { @@ -4201,6 +4253,16 @@ bool MemberDef::isTypedef() const return m_impl->mtype==MemberType_Typedef; } +bool MemberDef::isSequence() const +{ + return m_impl->mtype==MemberType_Sequence; +} + +bool MemberDef::isDictionary() const +{ + return m_impl->mtype==MemberType_Dictionary; +} + bool MemberDef::isFunction() const { return m_impl->mtype==MemberType_Function; @@ -4538,6 +4600,11 @@ bool MemberDef::livesInsideEnum() const return m_impl->livesInsideEnum; } +bool MemberDef::isSliceLocal() const +{ + return (m_impl->memSpec&Entry::Local)!=0; +} + MemberList *MemberDef::enumFieldList() const { return m_impl->enumFields; |