aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-11-30 20:47:13 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-11-30 20:47:13 +0100
commit1cfc6615e3339674ca0fb011813405c1c48fd193 (patch)
tree902d639a48f084412a0a3966a2404e1ba1714eb3 /src/exiv2wrapper.cpp
parent8b39401df47a8a8b667746a4142c825cc4409905 (diff)
downloadpyexiv2-1cfc6615e3339674ca0fb011813405c1c48fd193.tar.gz
Separate _XmpTag value setters for text, array and lang alt.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp32
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()
{