| 351 | } |
| 352 | |
| 353 | static 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 | |
| 388 | bool rfc2047::decode_finish(const char* toCharset, |
| 389 | string* out, bool addInvalid /* = true */) |
no test coverage detected
searching dependent graphs…