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

Method cnvXmpArray

src/convert.cpp:886–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886void Converter::cnvXmpArray(const char* from, const char* to) {
887 if (!prepareExifTarget(to))
888 return;
889 auto pos = xmpData_->findKey(XmpKey(from));
890 if (pos == xmpData_->end())
891 return;
892 std::ostringstream array;
893 for (size_t i = 0; i < pos->count(); ++i) {
894 std::string value = pos->toString(i);
895 if (!pos->value().ok()) {
896#ifndef SUPPRESS_WARNINGS
897 EXV_WARNING << "Failed to convert " << from << " to " << to << "\n";
898#endif
899 return;
900 }
901 array << value;
902 if (i != pos->count() - 1)
903 array << " ";
904 }
905 (*exifData_)[to] = array.str();
906 if (erase_)
907 xmpData_->erase(pos);
908}
909
910void Converter::cnvXmpDate(const char* from, const char* to) {
911 auto pos = xmpData_->findKey(XmpKey(from));

Callers

nothing calls this directly

Calls 6

XmpKeyClass · 0.85
findKeyMethod · 0.45
endMethod · 0.45
countMethod · 0.45
toStringMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected