#include <filters.h>
Inheritance diagram for KDE::SLP::PredicateFilter:
Public Methods | |
PredicateFilter (const QString &predicate) | |
QString | predicate () const |
Static Public Methods | |
QString | escape (const QString &s) |
Search filters by example:
Match all services whose attribute 'port' is 80: "(port=80)" Match all services whose attribute 'port' is larger or equalthan 80: "(port>=80)" (other operators: approx("~=") and less("<=")) Match all services whose attribute 'port' is not 80: "(!(port=80))" Match all services whose attribute 'port' is 80 and 'host' is 'www.kde.org': "(&(port=80)(host=www.kde.org))" (Note that string matching is case-insensitive, and spaces may be stripped) Match all services with 'port' 80 and 'host' either 'www.kde.org' or 'www.linux.org': "(&(port=80)(|(host=www.kde.org)(host=www.linux.org)))" Match all services whose 'host' attribute ends with 'kde.org': "(host=*kde.org)" Match all services whose 'description' attribute contains 'kde': "(description=*kde*)" Match all services whose 'portlist' attribute contains a list with the numbers 80 and 8080: "(&(port=80)(port=8080))" (an attribute expression matches when at least one value in the list fulfills the condition) Match all services that have a 'description' attribute: "(description=*)" Match all services that have a 'description' attributes that contains "*new*": "(description=*\2anew\2a*)" Any occurrence of the following characters must be escaped by a backslash followed by the 2 hexadecimal digits with the ASCII code: "*" ("\2a"), "(" ("\28"), ")" ("\29"), "\" ("\5c") and the 0 byte ("\00"). This can be done by the escape() function.
|
Creates a new PredicateFilter with the given filter.
|
|
Escapes the string as described in RFC 2254. This is required for the values in the filter. Any occurrence of the following characters must be escaped by a backslash followed by the 2 hexadecimal digits of the ASCII code: "*" ("\2a"), "(" ("\28"), ")" ("\29"), "\" ("\5c") and the 0 byte ("\00")).
|
|
Returns the predicate.
|