Exemplo n.º 1
0
int MemberNameSDict::compareItems(GCI item1, GCI item2)
{
  MemberName *n1=(MemberName *)item1;
  MemberName *n2=(MemberName *)item2;
  return stricmp(n1->memberName()+getPrefixIndex(n1->memberName()),
                 n2->memberName()+getPrefixIndex(n2->memberName())
                );
}
void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
{
  static QRegExp nextPart("[_a-z:][A-Z]");
  //printf("SearchIndex::addWord(%s,%d)\n",word,hiPriority);
  QCString wStr(word);
  if (wStr.isEmpty()) return;
  wStr=wStr.lower();
  IndexWord *w = m_words[wStr];
  if (w==0)
  {
    int idx=charsToIndex(wStr);
    if (idx<0) return;
    w = new IndexWord(wStr);
    //fprintf(stderr,"addWord(%s) at index %d\n",word,idx);
    m_index[idx]->append(w);
    m_words.insert(wStr,w);
  }
  w->addUrlIndex(m_urlIndex,hiPriority);
  int i;
  bool found=FALSE;
  if (!recurse) // the first time we check if we can strip the prefix
  {
    i=getPrefixIndex(word);
    if (i>0)
    {
      addWord(word+i,hiPriority,TRUE);
      found=TRUE;
    }
  }
  if (!found) // no prefix stripped
  {
    if ((i=nextPart.match(word))>=1)
    {
      addWord(word+i+1,hiPriority,TRUE);
    }
  }
}
Exemplo n.º 3
0
int MemberNameSDict::compareValues(const MemberName *n1,const MemberName *n2) const
{
  return qstricmp(n1->memberName()+getPrefixIndex(n1->memberName()),
                  n2->memberName()+getPrefixIndex(n2->memberName())
                 );
}