MCPcopy Create free account
hub / github.com/acl-dev/acl / pop_end

Method pop_end

lib_acl_cpp/src/mime/mime_code.cpp:352–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352int mime_code::pop_end(string* out, size_t max /* = 0 */)
353{
354 if (m_pBuf == NULL) {
355 logger_error("call push_pop first");
356 return -1;
357 }
358 if (m_encoding) {
359 encode_finish(m_pBuf);
360 } else {
361 decode_finish(m_pBuf);
362 }
363
364 if (out == NULL) {
365 m_pBuf->clear();
366 return 0;
367 }
368
369 size_t n = m_pBuf->length();
370 if (n == 0) {
371 return 0;
372 }
373 if (max > 0 && n > max) {
374 n = max;
375 }
376 out->append(m_pBuf->c_str(), n);
377 m_pBuf->clear();
378 return (int) (n);
379}
380
381void mime_code::clear()
382{

Callers

nothing calls this directly

Calls 4

clearMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected