Skip to content

Commit

Permalink
issue #7727: warning: documented symbol `static bool (long-winded C++…
Browse files Browse the repository at this point in the history
… type)' was not declared or defined.
  • Loading branch information
doxygen committed Aug 4, 2020
1 parent e2105a0 commit aa89f87
Showing 1 changed file with 32 additions and 64 deletions.
96 changes: 32 additions & 64 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5123,63 +5123,19 @@ 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>.
*/
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
{
Expand All @@ -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 '>':
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit aa89f87

Please sign in to comment.