![]() |
PahoMqttCpp
MQTT C++ Client for POSIX and Windows
|
#include <topic.h>
Public Member Functions | |
| topic_filter (const string &filter) | |
| bool | has_wildcards () const |
| bool | matches (const string &topic) const |
Static Public Member Functions | |
| static bool | is_wildcard (char c) |
| static bool | is_wildcard (const string &s) |
| static bool | has_wildcards (const string &filter) |
An MQTT topic filter.
This is a multi-field string, delimited by forward slashes, '/', in which fields can contain the wildcards:
'+' - Matches a single field '#' - Matches all subsequent fields (must be last field in filter)
It can be used to match against specific topics.
|
explicit |
Creates a new topic filter.
| filter | A string MQTT topic filter. This is a slash ('/') delimited topic string that can contain wildcards '+' and '#'. |
|
inlinestatic |
Determines if the character is a wildcard, '+' or '#'
| c | The character to check |
c is a wildcard, '+' or '#'
|
inlinestatic |
Determines if the string (field) is a wildcard, "+" or "#"
| s | The string to check |
c is a wildcard, "+" or "#"
|
static |
Determines if the specified topic/filter contains any wildcards.
| filter | The topic/filter string to check for wildcards. |
| bool mqtt::topic_filter::has_wildcards | ( | ) | const |
Determines if this topic filter contains any wildcards.
| bool mqtt::topic_filter::matches | ( | const string & | topic | ) | const |
Determine if the topic matches this filter.
| topic | An MQTT topic. It should not contain wildcards. |