Skip to content

Commit e841b3f

Browse files
AMQP::Tagger now takes a std::string_view
1 parent 48b9f05 commit e841b3f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/amqpcpp/tagger.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* - Reliable<Throttle>: to have throttle + notifications via callbacks
1212
*
1313
* @author Michael van der Werve <[email protected]>
14-
* @copyright 2020 Copernica BV
14+
* @copyright 2020 - 2023 Copernica BV
1515
*/
1616

1717
/**
@@ -128,10 +128,10 @@ class Tagger : public Watchable
128128
* @param flags optional flags
129129
* @return uint64_t
130130
*/
131-
uint64_t publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags = 0);
132-
uint64_t publish(const std::string &exchange, const std::string &routingKey, const std::string &message, int flags = 0) { return publish(exchange, routingKey, Envelope(message.data(), message.size()), flags); }
133-
uint64_t publish(const std::string &exchange, const std::string &routingKey, const char *message, size_t size, int flags = 0) { return publish(exchange, routingKey, Envelope(message, size), flags); }
134-
uint64_t publish(const std::string &exchange, const std::string &routingKey, const char *message, int flags = 0) { return publish(exchange, routingKey, Envelope(message, strlen(message)), flags); }
131+
uint64_t publish(const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags = 0);
132+
uint64_t publish(const std::string_view &exchange, const std::string_view &routingKey, const std::string_view &message, int flags = 0) { return publish(exchange, routingKey, Envelope(message.data(), message.size()), flags); }
133+
uint64_t publish(const std::string_view &exchange, const std::string_view &routingKey, const char *message, size_t size, int flags = 0) { return publish(exchange, routingKey, Envelope(message, size), flags); }
134+
uint64_t publish(const std::string_view &exchange, const std::string_view &routingKey, const char *message, int flags = 0) { return publish(exchange, routingKey, Envelope(message, strlen(message)), flags); }
135135

136136
/**
137137
* Close underlying channel

src/tagger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void Tagger::reportError(const char *message)
131131
* @param flags optional flags
132132
* @return uint64_t
133133
*/
134-
uint64_t Tagger::publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags)
134+
uint64_t Tagger::publish(const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags)
135135
{
136136
// @todo do not copy the entire buffer to individual frames
137137

0 commit comments

Comments
 (0)