1 #ifndef PROTON_BINARY_HPP
2 #define PROTON_BINARY_HPP
25 #include "./internal/export.hpp"
28 #include <proton/type_compat.h>
40 class binary :
public std::vector<uint8_t> {
44 explicit binary() : std::vector<value_type>() {}
45 explicit binary(
size_t n) : std::vector<value_type>(n) {}
46 explicit binary(
size_t n, value_type x) : std::vector<value_type>(n, x) {}
47 explicit binary(
const std::string& s) : std::vector<value_type>(s.begin(), s.end()) {}
48 template <
class Iter>
binary(Iter first, Iter last) : std::vector<value_type>(first, last) {}
52 operator std::string()
const {
return std::string(begin(), end()); }
55 binary&
operator=(
const std::string& x) { assign(x.begin(), x.end());
return *
this; }
Arbitrary binary data.
Definition: binary.hpp:40
binary & operator=(const std::string &x)
Assignment.
Definition: binary.hpp:55
The main Proton namespace.
Definition: annotation_key.hpp:33
std::ostream & operator<<(std::ostream &, const binary &)
Print a binary value.
Forward declarations for Proton types used to represent AMQP types.