diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-11-30 20:47:13 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-11-30 20:47:13 +0100 |
commit | 1cfc6615e3339674ca0fb011813405c1c48fd193 (patch) | |
tree | 902d639a48f084412a0a3966a2404e1ba1714eb3 /src/exiv2wrapper.cpp | |
parent | 8b39401df47a8a8b667746a4142c825cc4409905 (diff) | |
download | pyexiv2-1cfc6615e3339674ca0fb011813405c1c48fd193.tar.gz |
Separate _XmpTag value setters for text, array and lang alt.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r-- | src/exiv2wrapper.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 7455477..5666d10 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -656,10 +656,38 @@ XmpTag::XmpTag(const std::string& key, Exiv2::Xmpdatum* datum): _key(key) } } -/*void XmpTag::setRawValue(const std::string& value) +void XmpTag::setTextValue(const std::string& value) { _datum->setValue(value); -}*/ +} + +void XmpTag::setArrayValue(const boost::python::list& values) +{ + // Reset the value + _datum->setValue(0); + + for(boost::python::stl_input_iterator<std::string> iterator(values); + iterator != boost::python::stl_input_iterator<std::string>(); + ++iterator) + { + _datum->setValue(*iterator); + } +} + +void XmpTag::setLangAltValue(const boost::python::dict& values) +{ + // Reset the value + _datum->setValue(0); + + for(boost::python::stl_input_iterator<std::string> iterator(values); + iterator != boost::python::stl_input_iterator<std::string>(); + ++iterator) + { + std::string key = *iterator; + std::string value = boost::python::extract<std::string>(values.get(key)); + _datum->setValue("lang=\"" + key + "\" " + value); + } +} const std::string XmpTag::getKey() { |