mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
move match_search_strings() function from plugin utils to PBD
This commit is contained in:
parent
79033d8ee5
commit
d982507085
3 changed files with 47 additions and 16 deletions
|
|
@ -22,7 +22,7 @@
|
|||
#include <list>
|
||||
#include <string>
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include "pbd/match.h"
|
||||
|
||||
#include "ardour/plugin.h"
|
||||
#include "ardour/plugin_manager.h"
|
||||
|
|
@ -37,21 +37,6 @@ setup_search_string (std::string& searchstr)
|
|||
transform (searchstr.begin (), searchstr.end (), searchstr.begin (), ::toupper);
|
||||
}
|
||||
|
||||
inline static bool
|
||||
match_search_strings (std::string const& haystack, std::string const& needle)
|
||||
{
|
||||
boost::char_separator<char> sep (" ");
|
||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
||||
tokenizer t (needle, sep);
|
||||
|
||||
for (tokenizer::iterator ti = t.begin (); ti != t.end (); ++ti) {
|
||||
if (haystack.find (*ti) == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct PluginUIOrderSorter {
|
||||
public:
|
||||
bool operator() (ARDOUR::PluginInfoPtr a, ARDOUR::PluginInfoPtr b) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue