MCPcopy Create free account
hub / github.com/apache/qpid-proton / encode

Method encode

cpp/src/message.cpp:283–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283void message::encode(std::vector<char> &s) const {
284 impl().flush();
285 size_t sz = std::max(s.capacity(), size_t(512));
286 while (true) {
287 s.resize(sz);
288 assert(!s.empty());
289 int err = pn_message_encode(pn_msg(), const_cast<char*>(&s[0]), &sz);
290 if (err) {
291 if (err != PN_OVERFLOW)
292 check(err);
293 } else {
294 s.resize(sz);
295 return;
296 }
297 sz *= 2;
298 }
299}
300
301std::vector<char> message::encode() const {
302 std::vector<char> data;

Callers 1

message.cppFile · 0.45

Calls 6

capacityMethod · 0.80
checkFunction · 0.70
implClass · 0.50
pn_message_encodeFunction · 0.50
flushMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected