7#if !defined(ASYNC_MQTT_PACKET_TOPIC_SHARENAME_HPP)
8#define ASYNC_MQTT_PACKET_TOPIC_SHARENAME_HPP
10#include <boost/assert.hpp>
12#include <async_mqtt/buffer.hpp>
35 auto const idx = sharename_.find_first_of(
'/');
36 if (
idx == 0 ||
idx == string_view::npos)
return;
39 sharename_.remove_suffix(sharename_.size() -
idx);
78 return !topic_.empty();
87 std::tie(
lhs.topic_,
lhs.sharename_) <
88 std::tie(
rhs.topic_,
rhs.sharename_);
97 std::tie(
lhs.topic_,
lhs.sharename_) ==
98 std::tie(
rhs.topic_,
rhs.sharename_);
Definition packet_variant.hpp:49
buffer that has string_view interface This class provides string_view interface. This class hold stri...
Definition buffer.hpp:30
buffer substr(size_type pos=0, size_type count=npos) const &
get substring The returned buffer ragnge is the same as string_view::substr(). In addition the lifeti...
Definition buffer.hpp:201
topic and sharename
Definition topic_sharename.hpp:19
buffer const & sharename() const
Get sharename.
Definition topic_sharename.hpp:58
buffer const & all_topic() const
Get all_topic.
Definition topic_sharename.hpp:68
friend bool operator==(topic_sharename const &lhs, topic_sharename const &rhs)
equal operator
Definition topic_sharename.hpp:95
topic_sharename(buffer all_topic)
constructor
Definition topic_sharename.hpp:26
friend bool operator<(topic_sharename const &lhs, topic_sharename const &rhs)
less than operator
Definition topic_sharename.hpp:85
buffer const & topic() const
Get topic.
Definition topic_sharename.hpp:50