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

Function decoder_update

lib_acl_cpp/src/mime/rfc2047.cpp:319–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317 || ((x) != NULL && (y) != NULL && !strcasecmp((x), (y))))
318
319static bool decoder_update(rfc2047_entry* entry,
320 const char* fromCharset, const char* toCharset,
321 acl::mime_code* pDecoder, acl::charset_conv* pConv,
322 string* out, string* buf1, string* buf2)
323{
324 buf1->clear();
325 pDecoder->decode_update(entry->pData->c_str(),
326 (int) entry->pData->length(), buf1);
327 if (buf1->empty()) {
328 return true;
329 }
330
331 // ���Դ�ַ�����Ŀ���ַ�����ͬ�򲻽����ַ���ת��
332
333 if (EQ(fromCharset, toCharset) || pConv == NULL) {
334 out->append(buf1->c_str(), buf1->length());
335 return true;
336 }
337
338 // �����ַ���ת��
339
340 buf2->clear();
341
342 if (!pConv->update_begin(fromCharset, toCharset)) {
343 out->append(buf1->c_str(), buf1->length());
344 } else if (!pConv->update(buf1->c_str(), buf1->length(), buf2)) {
345 out->append(buf1->c_str(), buf1->length());
346 } else if (buf2->length() > 0) {
347 out->append(buf2->c_str(), buf2->length());
348 }
349
350 return true;
351}
352
353static bool decoder_finish(acl::mime_code* pDecoder, acl::charset_conv* pConv,
354 string* out, string* buf1, string* buf2)

Callers 1

decode_finishMethod · 0.85

Calls 8

clearMethod · 0.45
decode_updateMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45
emptyMethod · 0.45
appendMethod · 0.45
update_beginMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…