This function tries to find a member (in a documented class/file/namespace) that corresponds to the function/variable declaration given in funcDecl.
5781 "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d," 5782 "isFunc=%d mGrpId=%d tArgList=%p (#=%d) " 5783 "spec=%lld lang=%x\n",
5798 bool isRelated=
FALSE;
5799 bool isMemberOf=
FALSE;
5800 bool isFriend=
FALSE;
5833 while ((sep=funcDecl.
find(
';'))!=-1)
5839 if (!funcDecl.
isEmpty() && funcDecl[0]!=
' ') funcDecl.
prepend(
" ");
5851 if (isFriend && funcDecl.
left(6)==
"class ")
5855 funcName = funcDecl.
copy();
5857 else if (isFriend && funcDecl.
left(7)==
"struct ")
5860 funcName = funcDecl.
copy();
5866 funcArgs,funcTempList,exceptions
5900 if (!scopeName.isEmpty() &&
5903 scopeName = joinedName;
5921 for (nsdi.toFirst();(fnd=nsdi.current());++nsdi)
5923 joinedName = fnd->
name()+
"::"+scopeName;
5926 scopeName=joinedName;
5956 if (namespaceName.
find(
'@')!=-1)
return;
5960 scopeName.resize(0);
5965 scopeName=namespaceName;
5977 else if (!className.
isEmpty())
5994 tempScopeName=scopeName+funcSpec;
6002 if (!scopeName.isEmpty() && !isRelated && !isFriend && !
Config_getBool(
"HIDE_SCOPE_NAMES"))
6008 funcDecl=funcType+
" "+tempScopeName+
"::"+funcName+
funcTempList;
6012 funcDecl=funcType+
" "+tempScopeName+
"::"+funcName+funcArgs;
6023 funcDecl=tempScopeName+
"::"+funcName+funcArgs;
6037 funcDecl=funcType+
" "+funcName+funcArgs;
6048 funcDecl=funcName+funcArgs;
6053 if (funcType==
"template class" && !funcTempList.
isEmpty())
6057 "findMember() Parse results:\n" 6058 " namespaceName=`%s'\n" 6064 " funcTempList=`%s'\n" 6067 " exceptions=`%s'\n" 6082 "1. funcName=`%s'\n",funcName.
data());
6083 if (funcName.
left(9)==
"operator ")
6085 funcName =
substitute(funcName,className+
"::",
"");
6095 if (!isRelated && mn)
6098 "2. member name exists (%d members with this name)\n",mn->
count());
6107 bool memFound=
FALSE;
6108 for (mni.toFirst();!memFound && (md=mni.current());++mni)
6112 "3. member definition found, " 6113 "scope needed=`%s' scope=`%s' args=`%s' fileName=%s\n",
6115 qPrint(md->argsString()),
6137 "4. class definition %s found\n",cd->
name().
data());
6145 declTemplArgs.
append(templAl);
6153 bool substDone=
FALSE;
6160 if (declTemplArgs.count()>0 && defTemplArgs &&
6161 declTemplArgs.
count()==defTemplArgs->
count() &&
6182 "5. matching `%s'<=>`%s' className=%s namespaceName=%s\n",
6188 md->isVariable() || md->isTypedef() ||
6191 md->getClassDef(),md->getFileDef(),argList,
6201 if (md->templateArguments()!=0 && root->
tArgLists!=0)
6203 QCString memType = md->typeString();
6210 "5b. Comparing return types '%s'<->'%s' #args %d<->%d\n",
6222 bool mdIsTemplate = md->templateArguments()!=0;
6223 bool classOrMdIsTemplate = mdIsTemplate || classIsTemplate;
6224 bool rootIsTemplate = root->
tArgLists!=0;
6226 if (!rootIsUserDoc &&
6227 (mdIsTemplate || rootIsTemplate) &&
6228 ((classOrMdIsTemplate && !rootIsTemplate) || (!classOrMdIsTemplate && rootIsTemplate))
6234 "5b. Comparing return types: template v.s. non-template\n");
6240 "6. match results of matchArguments2 = %d\n",matching);
6246 md->setDefinitionTemplateParameterLists(root->
tArgLists);
6247 md->setArgumentList(argList);
6251 if (!funcTempList.
isEmpty() &&
6273 else if (cd && cd!=tcd)
6279 if (count==0 && rootNav->
parent() &&
6282 goto localObjCMethod;
6284 if (count==0 && !(isFriend && funcType==
"class"))
6292 for (mni.toFirst();(md=mni.current());++mni)
6311 "7. new candidate className=%s scope=%s args=%s exact match\n",
6319 "7. new candidate className=%s scope=%s args=%s no match\n",
6326 static bool strictProtoMatching =
Config_getBool(
"STRICT_PROTO_MATCHING");
6327 if (!strictProtoMatching)
6329 if (candidates==1 && ucd && umd)
6336 else if (candidates>1 && ecd && emd)
6347 if (noMatchCount>1) warnMsg+=
"uniquely ";
6348 warnMsg+=
"matching class member found for \n";
6354 for (;(al=alli.current());++alli)
6356 warnMsg+=
" template ";
6365 warnMsg+=fullFuncDecl;
6370 warnMsg+=
"Possible candidates:\n";
6371 for (mni.toFirst();(md=mni.current());++mni)
6379 warnMsg+=
" 'template ";
6384 if (md->typeString())
6386 warnMsg+=md->typeString();
6391 warnMsg+=qScope+
"::"+md->name();
6392 if (md->argsString())
6393 warnMsg+=md->argsString();
6397 " of file "+md->getDefFileName();
6412 for (mni.toFirst();(md=mni.current());++mni)
6426 funcType,funcName,funcArgs,exceptions,
6462 else if (overloaded)
6475 for (;(md=mni.current());++mni)
6478 if (className!=cd->
name()) unique=
FALSE;
6494 funcType,funcName,funcArgs,exceptions,
6496 mtype,tArgList,root->
argList);
6497 md->setTagInfo(rootNav->
tagInfo());
6498 md->setLanguage(root->
lang);
6499 md->setId(root->
id);
6501 md->setMemberClass(cd);
6502 md->setDefinition(funcDecl);
6511 md->setDocsForDefinition(!root->
proto);
6512 md->setPrototype(root->
proto);
6513 md->addSectionsToDefinition(root->
anchors);
6517 md->setMemberSpecifiers(root->
spec);
6518 md->setMemberGroupId(root->
mGrpId);
6522 md->setRefItems(root->
sli);
6527 if (!
findGlobalMember(rootNav,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl))
6532 "Cannot determine class for function\n%s",
6541 " scopeName=%s className=%s\n",
qPrint(scopeName),
qPrint(className));
6547 bool newMember=
TRUE;
6548 bool newMemberName=
FALSE;
6550 bool isDefine=
FALSE;
6556 mdDefine = mni.current();
6557 while (mdDefine && !isDefine)
6559 isDefine = isDefine || mdDefine->
isDefine();
6560 if (!isDefine) { ++mni; mdDefine=mni.current(); }
6576 while ((rmd=mni.current()) && newMember)
6585 if (newMember) ++mni;
6587 if (!newMember && rmd)
6609 if (isDefine && mdDefine)
6614 funcDecl=funcType +
" " + funcName;
6628 funcType,funcName,funcArgs,exceptions,
6630 root->
stat && !isMemberOf,
6636 if (isDefine && mdDefine)
6671 while ((rmd=rmni.current()) && !found)
6720 cd->insertMember(md);
6721 cd->insertUsedFile(fd);
6738 if (!
findGlobalMember(rootNav,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl))
6743 "Cannot determine file/namespace for relatedalso function\n%s",
6752 "class `%s' for related function `%s' is not " 6770 funcType,funcName,funcArgs,exceptions,
6813 bool globMem =
findGlobalMember(rootNav,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl);
6814 if (className.
isEmpty() && !globMem)
6817 "class for member `%s' cannot " 6818 "be found.", funcName.
data()
6821 else if (!className.
isEmpty() && !globMem)
6824 "member `%s' of class `%s' cannot be found",
6833 "member with no name found.");
bool callGraph
do we need to draw the call graph?
static MemberNameSDict * functionNameSDict
void setRelatedAlso(ClassDef *cd)
EntryNav * parent() const
void setDefinition(const char *d)
This class represents an function or template argument list.
QCString stripWhiteSpace() const
bool matchArguments2(Definition *srcScope, FileDef *srcFileScope, ArgumentList *srcAl, Definition *dstScope, FileDef *dstFileScope, ArgumentList *dstAl, bool checkCV)
uint64 spec
class/member specifiers
void setTagInfo(TagInfo *i)
static const uint64 Mutable
static bool scopeIsTemplate(Definition *d)
void setBodyDef(FileDef *fd)
void append(const type *d)
void addMemberToGroups(Entry *root, MemberDef *md)
Protection protection() const
void setLanguage(SrcLangExt lang)
FileDef * getBodyDef() const
QCString argListToString(ArgumentList *al, bool useCanonicalType, bool showDefVals)
void setTemplateSpecialization(bool b)
int briefLine
line number at which the brief desc. was found
const QCString & name() const
void enableCallGraph(bool e)
QCString stripAnonymousNamespaceScope(const QCString &s)
NamespaceSDict * getUsedNamespaces() const
int docLine
line number at which the documentation was found
ArgumentList * argList
member arguments as a list
void setMemberGroupId(int id)
static QCString className
void enableCallerGraph(bool e)
QCString left(uint len) const
bool stripPrefix(const char *prefix)
void setPrototype(bool p)
QCString getOverloadDocs()
int find(char c, int index=0, bool cs=TRUE) const
void warn_undoc(const char *file, int line, const char *fmt,...)
void append(const char *key, const T *d)
TagInfo * tagInfo() const
int mGrpId
member group id
QList< ArgumentList > * tArgLists
template argument declarations
int startColumn
start column of entry in the source
ClassDef * getClass(const char *n)
static const uint64 Explicit
FileDef * getFileDef() const
static NamespaceSDict * namespaceSDict
bool rightScopeMatch(const QCString &scope, const QCString &name)
static const uint64 Inline
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped)
void setDefinitionTemplateParameterLists(QList< ArgumentList > *lists)
void makeImplementationDetail()
static QCString funcTempList
void insertMember(MemberDef *)
const QCString & name() const
bool callerGraph
do we need to draw the caller graph?
FileDef * fileDef() const
QCString inbodyFile
file in which the body doc was found
QCString brief
brief description (doc block)
int endBodyLine
line number where the definition ends
ArgumentList * typeConstr
where clause (C#) for type constraints
void setDocumentation(const char *d, const char *docFile, int docLine, bool stripWhiteSpace=TRUE)
void setInbodyDocumentation(const char *d, const char *inbodyFile, int inbodyLine)
void setMemberClass(ClassDef *cd)
QCString right(uint len) const
QList< SectionInfo > * anchors
list of anchors defined in this entry
ArgumentList * getTemplateArgumentsFromName(const QCString &name, const QList< ArgumentList > *tArgLists)
static void print(DebugMask mask, int prio, const char *fmt,...)
int startLine
start line of entry in the source
QCString & prepend(const char *s)
void addSectionsToDefinition(QList< SectionInfo > *anchorList)
const char * data() const
Protection protection
class protection
#define Config_getBool(val)
ClassDef * getClassDef() const
void warn(const char *file, int line, const char *fmt,...)
void extractNamespaceName(const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass)
QCString qualifiedNameWithTemplateParameters(QList< ArgumentList > *actualParams=0, int *actualParamIndex=0) const
void setTypeConstraints(ArgumentList *al)
QCString removeRedundantWhiteSpace(const QCString &s)
static void substituteTemplatesInArgList(const QList< ArgumentList > &srcTempArgLists, const QList< ArgumentList > &dstTempArgLists, ArgumentList *src, ArgumentList *dst, ArgumentList *funcTempArgs=0)
RelatesType relatesType
how relates is handled
void setDocsForDefinition(bool b)
void setMemberSpecifiers(uint64 s)
QCString inbodyDocs
documentation inside the body of a function
QCString doc
documentation block (partly parsed)
QCString & setNum(short n)
void parseFuncDecl(const QCString &decl, bool objC, QCString &cl, QCString &t, QCString &n, QCString &a, QCString &ftl, QCString &exc)
static void addMemberDocs(EntryNav *rootNav, MemberDef *md, const char *funcDecl, ArgumentList *al, bool over_load, NamespaceSDict *nl=0)
Specifier virt
virtualness of the entry
static ClassDef * findClassDefinition(FileDef *fd, NamespaceDef *nd, const char *scopeName)
virtual Definition * getOuterScope() const
void setRefItems(const QList< ListItemInfo > *sli)
int getEndBodyLine() const
ArgumentList * argumentList() const
NamespaceDef * getResolvedNamespace(const char *name)
int getStartBodyLine() const
static MemberNameSDict * memberNameSDict
QCString tempArgListToString(ArgumentList *al, SrcLangExt lang)
const QCString & initializer() const
void warn_simple(const char *file, int line, const char *text)
void setId(const char *name)
void setInitializer(const char *i)
QCString fileName
file this entry was extracted from
static bool findGlobalMember(EntryNav *rootNav, const QCString &namespaceName, const char *type, const char *name, const char *tempArg, const char *, const char *decl)
QCString docFile
file in which the documentation was found
MethodTypes mtype
signal, slot, (dcop) method, or property?
void getTemplateParameterLists(QList< ArgumentList > &lists) const
QCString relates
related class (doc block)
const char * argsString() const
void insertUsedFile(FileDef *)
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
SrcLangExt lang
programming language in which this entry was found
T * find(const char *key)
static bool isSpecialization(const QList< ArgumentList > &srcTempArgLists, const QList< ArgumentList > &dstTempArgLists)
int inbodyLine
line number at which the body doc was found
QCString mergeScopes(const QCString &leftScope, const QCString &rightScope)
void setBriefDescription(const char *b, const char *briefFile, int briefLine)
const char * qPrint(const char *s)
static void addMethodToClass(EntryNav *rootNav, ClassDef *cd, const QCString &rname, bool isFriend)
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
int section
entry type (see Sections);
int bodyLine
line number of the definition in the source
QCString briefFile
file in which the brief desc. was found
QList< ListItemInfo > * sli
special lists (test/todo/bug/deprecated/..) this entry is in
void setBodySegment(int bls, int ble)