diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-04 08:37:45 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-04 08:37:45 (GMT) |
commit | aa89f8773a50887ad20fbf683ff3c9af38c8fc5e (patch) | |
tree | 3db167e614db8516604ab18a75c66217de2ea058 /src | |
parent | e2105a060b3c0367c1786e00d30f1a6f348fb42b (diff) | |
download | Doxygen-aa89f8773a50887ad20fbf683ff3c9af38c8fc5e.zip Doxygen-aa89f8773a50887ad20fbf683ff3c9af38c8fc5e.tar.gz Doxygen-aa89f8773a50887ad20fbf683ff3c9af38c8fc5e.tar.bz2 |
issue #7727: warning: documented symbol `static bool (long-winded C++ type)' was not declared or defined.
Diffstat (limited to 'src')
-rw-r--r-- | src/util.cpp | 96 |
1 files changed, 32 insertions, 64 deletions
diff --git a/src/util.cpp b/src/util.cpp index aa1acb4..ebf3cf1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5123,7 +5123,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te return result; } -#if 0 // original version + /*! Strips the scope from a name. Examples: A::B will return A * and A<T>::B<N::C<D> > will return A<T>. */ @@ -5131,55 +5131,11 @@ QCString stripScope(const char *name) { QCString result = name; int l=result.length(); - int p=l-1; - bool done; - int count; - - while (p>=0) - { - char c=result.at(p); - switch (c) - { - case ':': - //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data()); - return result.right(l-p-1); - case '>': - count=1; - done=FALSE; - //printf("pos < = %d\n",p); - p--; - while (p>=0 && !done) - { - c=result.at(p--); - switch (c) - { - case '>': count++; break; - case '<': count--; if (count<=0) done=TRUE; break; - default: - //printf("c=%c count=%d\n",c,count); - break; - } - } - //printf("pos > = %d\n",p+1); - break; - default: - p--; - } - } - //printf("stripScope(%s)=%s\n",name,name); - return name; -} -#endif - -// new version by Davide Cesari which also works for Fortran -QCString stripScope(const char *name) -{ - QCString result = name; - int l=result.length(); int p; bool done = FALSE; bool skipBracket=FALSE; // if brackets do not match properly, ignore them altogether int count=0; + int round=0; do { @@ -5192,7 +5148,10 @@ QCString stripScope(const char *name) case ':': // only exit in the case of :: //printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data()); - if (p>0 && result.at(p-1)==':') return result.right(l-p-1); + if (p>0 && result.at(p-1)==':' && (count==0 || skipBracket)) + { + return result.right(l-p-1); + } p--; break; case '>': @@ -5216,20 +5175,29 @@ QCString stripScope(const char *name) c=result.at(p--); switch (c) { - case '>': - count++; + case ')': + round++; + break; + case '(': + round--; + break; + case '>': // ignore > inside (...) to support e.g. (sizeof(T)>0) inside template parameters + if (round==0) count++; break; case '<': - if (p>0) + if (round==0) { - if (result.at(p-1) == '<') // skip << operator + if (p>0) { - p--; - break; + if (result.at(p-1) == '<') // skip << operator + { + p--; + break; + } } + count--; + foundMatch = count==0; } - count--; - foundMatch = count==0; break; default: //printf("c=%c count=%d\n",c,count); @@ -5910,19 +5878,19 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, { //printf("1:result+=%s\n",fullName.mid(p,i-p).data()); int e=i+1; - bool done=FALSE; int count=1; - while (e<l && !done) + int round=0; + while (e<l && count>0) { char c=fullName.at(e++); - if (c=='<') - { - count++; - } - else if (c=='>') + switch (c) { - count--; - done = count==0; + case '(': round++; break; + case ')': if (round>0) round--; break; + case '<': if (round==0) count++; break; + case '>': if (round==0) count--; break; + default: + break; } } int si= fullName.find("::",e); |