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

Function decoder_finish

lib_acl_cpp/src/mime/rfc2047.cpp:353–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353static bool decoder_finish(acl::mime_code* pDecoder, acl::charset_conv* pConv,
354 string* out, string* buf1, string* buf2)
355{
356 buf1->clear();
357 pDecoder->decode_finish(buf1);
358 if (buf1->empty()) {
359 if (pConv) {
360 buf2->clear();
361 pConv->update_finish(buf2);
362 if (buf2->length() > 0) {
363 out->append(buf2->c_str(), buf2->length());
364 }
365 }
366 return true;
367 }
368
369 if (pConv == NULL) {
370 out->append(buf1->c_str(), buf1->length());
371 return true;
372 }
373
374 buf2->clear();
375
376 if (!pConv->update(buf1->c_str(), buf1->length(), buf2)) {
377 out->append(buf1->c_str(), buf1->length());
378 } else {
379 pConv->update_finish(buf2);
380 if (buf2->length() > 0) {
381 out->append(buf2->c_str(), buf2->length());
382 }
383 }
384
385 return true;
386}
387
388bool rfc2047::decode_finish(const char* toCharset,
389 string* out, bool addInvalid /* = true */)

Callers 1

decode_finishMethod · 0.85

Calls 8

update_finishMethod · 0.80
clearMethod · 0.45
decode_finishMethod · 0.45
emptyMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45
c_strMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…