![]() |
paho-mqtt-cpp
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 | has_wildcards (const string &topic) |
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 '#'. |
|
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. |