mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
style
This commit is contained in:
parent
6356cd22ad
commit
b0d7f9bd79
@ -121,25 +121,30 @@ std::string Symbol::extractName(const std::string& decl)
|
||||
return "operator []";
|
||||
|
||||
std::string::size_type pos = decl.find('(');
|
||||
if (pos != std::string::npos) {
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
// special case std::function<void(int)> a
|
||||
// ^ ^^
|
||||
// In case the marked patterns are found,
|
||||
// reset pos to npos to make sure "(" is not seen as the beginning of a function
|
||||
int bracket = 1;
|
||||
std::string::size_type i = pos + 1;
|
||||
while (i < decl.size() && bracket != 0){
|
||||
if (decl[i] == '('){
|
||||
while (i < decl.size() && bracket != 0)
|
||||
{
|
||||
if (decl[i] == '(')
|
||||
{
|
||||
bracket++;
|
||||
} else if (decl[i] == ')'){
|
||||
}
|
||||
else if (decl[i] == ')')
|
||||
{
|
||||
bracket--;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
while (i < decl.size() && std::isspace(decl[i])) i++;
|
||||
if (i < decl.size() && decl[i] == '>') {
|
||||
if (i < decl.size() && decl[i] == '>')
|
||||
{
|
||||
pos = std::string::npos;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user