58bool topic_match(std::string_view pattern, std::string_view topic);
119 std::string_view topic) {
bool topic_match(std::string_view pattern, std::string_view topic)
Tests whether a concrete topic matches an MQTT-style pattern.
@ Exact
Literal entry equal to the topic.
@ Prefix
Literal entry that is a strict byte prefix of the topic.
@ Wildcard
Entry containing '+'/'#', matched per topic_match().
std::string literal_prefix(std::string_view pattern)
Computes the longest literal (wildcard-free) prefix of a pattern.
bool subscription_matches(std::string_view sub_entry, std::string_view topic)
Convenience predicate over subscription_match().
SubMatch subscription_match(std::string_view sub_entry, std::string_view topic)
Single source of truth for "would an agent subscribing to `sub_entry` receive a message published on ...
bool has_wildcard(std::string_view sub_entry)
Tells whether a sub_topic entry is a wildcard pattern.