MCPcopy Create free account
hub / github.com/Kitware/VTK / IsSubstringCompletelyEnclosed

Method IsSubstringCompletelyEnclosed

Common/Misc/vtkFunctionParser.cxx:1434–1462  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1432
1433//------------------------------------------------------------------------------
1434int vtkFunctionParser::IsSubstringCompletelyEnclosed(int beginIndex, int endIndex)
1435{
1436 int i, parenthesisCount;
1437
1438 if (this->Function[beginIndex] == '(' && this->Function[endIndex] == ')')
1439 {
1440 parenthesisCount = 1;
1441 for (i = beginIndex + 1; i < endIndex; i++)
1442 {
1443 if (this->Function[i] == '(')
1444 {
1445 parenthesisCount++;
1446 }
1447 else if (this->Function[i] == ')')
1448 {
1449 parenthesisCount--;
1450 }
1451 if (parenthesisCount == 0)
1452 {
1453 break;
1454 }
1455 }
1456 if (i == endIndex)
1457 {
1458 return 1;
1459 }
1460 }
1461 return 0;
1462}
1463
1464//------------------------------------------------------------------------------
1465int vtkFunctionParser::GetMathFunctionNumber(int currentIndex)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected