MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / cnvExifComment

Method cnvExifComment

src/convert.cpp:567–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567void Converter::cnvExifComment(const char* from, const char* to) {
568 auto pos = exifData_->findKey(ExifKey(from));
569 if (pos == exifData_->end())
570 return;
571 if (!prepareXmpTarget(to))
572 return;
573 const auto cv = dynamic_cast<const CommentValue*>(&pos->value());
574 if (!cv) {
575#ifndef SUPPRESS_WARNINGS
576 EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
577#endif
578 return;
579 }
580 // Todo: Convert to UTF-8 if necessary
581 try {
582 (*xmpData_)[to] = cv->comment();
583 } catch (const Error&) {
584#ifndef SUPPRESS_WARNINGS
585 EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
586#endif
587 }
588 if (erase_)
589 exifData_->erase(pos);
590}
591
592void Converter::cnvExifArray(const char* from, const char* to) {
593 auto pos = exifData_->findKey(ExifKey(from));

Callers

nothing calls this directly

Calls 5

ExifKeyClass · 0.85
findKeyMethod · 0.45
endMethod · 0.45
commentMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected