Krita Source Code Documentation
Loading...
Searching...
No Matches
kfts_fuzzy_match.h File Reference
#include <QString>

Go to the source code of this file.

Namespaces

namespace  kfts
 
namespace  kfts::fuzzy_internal
 

Functions

static Q_DECL_UNUSED bool kfts::fuzzy_match (const QString pattern, const QString str, int &outScore)
 This should be the main function you should use. outscore is the score of this match and should be used to sort the results later. Without sorting of the results this function won't be as effective.
 
static Q_DECL_UNUSED bool kfts::fuzzy_match (const QString pattern, const QString str, int &outScore, uint8_t *matches, int maxMatches)
 
static bool kfts::fuzzy_internal::fuzzy_match_recursive (QString::const_iterator pattern, QString::const_iterator str, int &outScore, const QString::const_iterator strBegin, const QString::const_iterator strEnd, const QString::const_iterator patternEnd, uint8_t const *srcMatches, uint8_t *newMatches, int maxMatches, int nextMatch, int &recursionCount, int seqBonus=15)
 
static Q_DECL_UNUSED bool kfts::fuzzy_match_sequential (const QString pattern, const QString str, int &outScore)
 This is a special case function which doesn't score separator matches higher than sequential matches. This is currently used in Kate's command bar where the string items are usually space separated names.
 
static Q_DECL_UNUSED bool kfts::fuzzy_match_simple (const QString pattern, const QString str)
 simple fuzzy matching of chars in pattern with chars in str sequentially
 
static Q_DECL_UNUSED QString kfts::to_fuzzy_matched_display_string (const QString pattern, QString &str, const QString &htmlTag, const QString &htmlTagClose)
 get string for display in treeview / listview. This should be used from style delegate. For example: with pattern = "kate", str = "kateapp" and @htmlTag = " the output will be kateapp which will be visible to user as kateapp.