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

Method pop_end

lib_acl_cpp/src/stdlib/charset_conv.cpp:547–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547int charset_conv::pop_end(acl::string* out, size_t max /* = 0 */)
548{
549 if (m_pBuf == NULL) {
550 logger_error("call push_pop first");
551 return -1;
552 }
553
554 update_finish(m_pBuf);
555
556 if (out == NULL) {
557 m_pBuf->clear();
558 return 0;
559 }
560
561 size_t n = m_pBuf->length();
562 if (n == 0) {
563 return 0;
564 }
565 if (max > 0 && n > max) {
566 n = max;
567 }
568 out->append(m_pBuf->c_str(), m_pBuf->length());
569 m_pBuf->clear();
570 return (int) n;
571}
572
573void charset_conv::clear(void)
574{

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