3 #include <kafka/Project.h>
5 #include <kafka/Types.h>
19 using Key = std::string;
20 using Value = ConstBuffer;
23 Header(Key k, Value v): key(std::move(k)), value(v) {}
30 return (key.empty() ?
"[null]" : key) +
":" + value.toString();
40 using Headers = std::vector<Header>;
45 #if COMPILER_SUPPORTS_CPP_17
46 const inline Headers NullHeaders = Headers{};
48 const static Headers NullHeaders = Headers{};
54 inline std::string toString(
const Headers& headers)
57 std::for_each(headers.cbegin(), headers.cend(),
58 [&ret](
const auto& header) {
59 ret.append(ret.empty() ?
"" :
",").append(header.toString());