Substring search of package name/description.

Note this only searches the current locale, should potentially also
search the default locale too.
This commit is contained in:
James Turner
2014-06-01 11:28:10 +01:00
parent 32274027ef
commit c3670b211f

View File

@@ -66,7 +66,24 @@ bool Package::matches(const SGPropertyNode* aFilter) const
return false;
}
}
// substring search of name, description
if (strcmp(c->getName(), "name") == 0) {
std::string n(c->getStringValue());
size_t pos = name().find(n);
if (pos == std::string::npos) {
return false;
}
}
if (strcmp(c->getName(), "description") == 0) {
std::string n(c->getStringValue());
size_t pos = description().find(n);
if (pos == std::string::npos) {
return false;
}
}
SG_LOG(SG_GENERAL, SG_WARN, "unknown filter term:" << c->getName());
} // of filter props iteration