mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-24 20:07:40 +02:00
Add support for removing single rules
This commit is contained in:
parent
f680c1486b
commit
a77f6f1b02
3 changed files with 37 additions and 4 deletions
|
@ -43,13 +43,13 @@ static constexpr auto LOG_TAG = "StringUtils";
|
|||
|
||||
bool wildcardMatch(const std::string& pattern, const std::string& text)
|
||||
{
|
||||
LOG(INFO, LOG_TAG) << "wildcardMatch '" << pattern << "', text: '" << text << "'\n";
|
||||
LOG(DEBUG, LOG_TAG) << "wildcardMatch '" << pattern << "', text: '" << text << "'\n";
|
||||
std::vector<std::string> parts = utils::string::split(pattern, '*');
|
||||
size_t pos = 0;
|
||||
for (size_t n = 0; n < parts.size(); ++n)
|
||||
{
|
||||
const std::string& part = parts[n];
|
||||
LOG(INFO, LOG_TAG) << "Matching '" << part << "', pos: " << pos << "\n";
|
||||
LOG(DEBUG, LOG_TAG) << "Matching '" << part << "', pos: " << pos << "\n";
|
||||
pos = text.find(part, pos);
|
||||
if (pos == std::string::npos)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue