Logo Search packages:      
Sourcecode: kbiff version File versions

int KBiffURL::findPos ( const QString &  _searchPart,
const QString &  _parName 
) const [private]

Returns the position of a parameter within the search part

Definition at line 144 of file kbiffurl.cpp.

Referenced by searchPar(), and setSearchPar().

{
  const char *_searchPos;
  int n = -1;

  _searchPos = _searchPart.ascii();
  while (_searchPos != NULL)
  {
    _searchPos = strstr( _searchPos, _parName.ascii() );

    // If not found, a NULL string is returned
    if (_searchPos == NULL)
      return -1;

    // Find the index of the next character
    n = _searchPos - _searchPart.ascii() + strlen(_parName.ascii());

    // Stop searching if this is not a substring
    if ((_searchPos == _searchPart || _searchPos[-1] == '&') &&
        (_searchPart[n] == '0' || strchr(";:@&=", _searchPart[n]) != NULL))
      return n;

    _searchPos = &(_searchPart.ascii()[n+1]);
  }

  return -1;
}


Generated by  Doxygen 1.6.0   Back to index