Skip to content

Commit

Permalink
AMQP::Tagger now takes a std::string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
EmielBruijntjes committed Mar 26, 2023
1 parent 48b9f05 commit e841b3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions include/amqpcpp/tagger.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* - Reliable<Throttle>: to have throttle + notifications via callbacks
*
* @author Michael van der Werve <michael.vanderwerve@mailerq.com>
* @copyright 2020 Copernica BV
* @copyright 2020 - 2023 Copernica BV
*/

/**
Expand Down Expand Up @@ -128,10 +128,10 @@ class Tagger : public Watchable
* @param flags optional flags
* @return uint64_t
*/
uint64_t publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags = 0);
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); }
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); }
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); }
uint64_t publish(const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags = 0);
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); }
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); }
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); }

/**
* Close underlying channel
Expand Down
2 changes: 1 addition & 1 deletion src/tagger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void Tagger::reportError(const char *message)
* @param flags optional flags
* @return uint64_t
*/
uint64_t Tagger::publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags)
uint64_t Tagger::publish(const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags)
{
// @todo do not copy the entire buffer to individual frames

Expand Down

0 comments on commit e841b3f

Please sign in to comment.