aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-11-24 10:01:18 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-11-24 10:01:18 +0100
commitccfcadbc550a453aa1fa1b1e6b036eec0a902dd6 (patch)
tree52df322f9755a6262298f8cd9302f226ea2a6879 /src/exiv2wrapper.cpp
parent1bcfb83db7bd8b985b3172ad80b0cb155de7146c (diff)
downloadpyexiv2-ccfcadbc550a453aa1fa1b1e6b036eec0a902dd6.tar.gz
Separate _XmpTag value getters for text, array and lang alt.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index d7e989c..96e9536 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -641,10 +641,10 @@ XmpTag::XmpTag(const std::string& key, Exiv2::Xmpdatum* datum): _key(key)
_type = info->xmpValueType_;
}
-void XmpTag::setRawValue(const std::string& value)
+/*void XmpTag::setRawValue(const std::string& value)
{
_datum->setValue(value);
-}
+}*/
const std::string XmpTag::getKey()
{
@@ -671,9 +671,35 @@ const std::string XmpTag::getDescription()
return _description;
}
-const std::string XmpTag::getRawValue()
+const std::string XmpTag::getTextValue()
{
- return _datum->toString();
+ return dynamic_cast<const Exiv2::XmpTextValue*>(&_datum->value())->value_;
+}
+
+const boost::python::list XmpTag::getArrayValue()
+{
+ std::vector<std::string> value =
+ dynamic_cast<const Exiv2::XmpArrayValue*>(&_datum->value())->value_;
+ boost::python::list rvalue;
+ for(std::vector<std::string>::const_iterator i = value.begin();
+ i != value.end(); ++i)
+ {
+ rvalue.append(*i);
+ }
+ return rvalue;
+}
+
+const boost::python::dict XmpTag::getLangAltValue()
+{
+ Exiv2::LangAltValue::ValueType value =
+ dynamic_cast<const Exiv2::LangAltValue*>(&_datum->value())->value_;
+ boost::python::dict rvalue;
+ for (Exiv2::LangAltValue::ValueType::const_iterator i = value.begin();
+ i != value.end(); ++i)
+ {
+ rvalue[i->first] = i->second;
+ }
+ return rvalue;
}