Blender V5.0
blender::string_search::StringSearch< T > Class Template Reference

#include <BLI_string_search.hh>

Inherits blender::string_search::StringSearchBase.

Inherited by blender::ui::string_search::StringSearch< T >.

Public Member Functions

 StringSearch (const RecentCache *recent_cache, const MainWordsHeuristic main_words_heuristic)
void add (const StringRef str, T *user_data, const int weight=0)
Vector< T * > query (const StringRef query) const

Detailed Description

template<typename T>
class blender::string_search::StringSearch< T >

StringSearch filters and sorts search items based on a string query. Every search item has data of type T attached that is used to identify it.

When querying, the a match score is computed between the query string and each item. Items that don't match are filtered out, the rest is sorted by the score. Elements with the same score are further sorted based on the optionally provided weight and other heuristics.

The usage is simple. First add all the search items and then use the query method.

Definition at line 90 of file BLI_string_search.hh.

Constructor & Destructor Documentation

◆ StringSearch()

template<typename T>
blender::string_search::StringSearch< T >::StringSearch ( const RecentCache * recent_cache,
const MainWordsHeuristic main_words_heuristic )
inline

Member Function Documentation

◆ add()

template<typename T>
void blender::string_search::StringSearch< T >::add ( const StringRef str,
T * user_data,
const int weight = 0 )
inline

◆ query()


The documentation for this class was generated from the following file: