bool partialMatch(const QString &value) const
    {
        QString::const_iterator vbegin = value.constBegin(), vend = value.constEnd();

        // If any of our tokens start with the value, this is a match
        foreach (const QString &word, filterKey) {
            QString::const_iterator wbegin = word.constBegin(), wend = word.constEnd();

            QString::const_iterator vit = vbegin, wit = wbegin;
            while (wit != wend) {
                if (*wit != *vit)
                    break;

                // Preceding base chars match - are there any continuing diacritics?
                QString::const_iterator vmatch = vit++, wmatch = wit++;
                while (vit != vend && (*vit).category() == QChar::Mark_NonSpacing)
                     ++vit;
                while (wit != wend && (*wit).category() == QChar::Mark_NonSpacing)
                     ++wit;

                if ((vit - vmatch) > 1) {
                    // The match value contains diacritics - the word needs to match them
                    QString subValue(value.mid(vmatch - vbegin, vit - vmatch));
                    QString subWord(word.mid(wmatch - wbegin, wit - wmatch));
                    if (subValue.compare(subWord) != 0)
                        break;
                } else {
                    // Ignore any diacritics in our word
                }

                if (vit == vend) {
                    // We have matched to the end of the value
                    return true;
                }
            }
        }
Beispiel #2
0
int
NdbOperation::subValue(Uint32 anAttrId, Uint64 aValue)
{
  return subValue(m_currentTable->getColumn(anAttrId), aValue);
}
Beispiel #3
0
int
NdbOperation::subValue( const char* anAttrName, Uint64 aValue)
{
  return subValue(m_currentTable->getColumn(anAttrName), aValue);
}
Beispiel #4
0
QVariant RbSettings::value(enum UserSettings setting)
{
    QString empty;
    return subValue(empty, setting);
}