diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-11-20 10:02:47 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-11-20 10:02:47 +0100 |
commit | 30c9eab71722eac240e2885b1b259cad96fd2df7 (patch) | |
tree | d8c34cfda6637cf7e9c247cc5f87abd8cb351871 /src/exiv2wrapper.cpp | |
parent | d542c5f232e1be7550c0fff1186770ab22de35a9 (diff) | |
download | pyexiv2-30c9eab71722eac240e2885b1b259cad96fd2df7.tar.gz |
Added the _XmpTag class in the low-level wrapper.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r-- | src/exiv2wrapper.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 0ff9035..e2638b4 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -629,6 +629,59 @@ const boost::python::list IptcTag::getRawValues() } +XmpTag::XmpTag(const std::string& key, Exiv2::Xmpdatum* datum): _key(key) +{ + if (datum != 0) + { + _datum = datum; + } + else + { + _datum = new Exiv2::Xmpdatum(_key); + } + + _title = Exiv2::XmpProperties::propertyTitle(_key); + _description = Exiv2::XmpProperties::propertyDesc(_key); + static const Exiv2::XmpPropertyInfo* info = Exiv2::XmpProperties::propertyInfo(_key); + _name = info->name_; + _type = info->xmpValueType_; +} + +void XmpTag::setRawValue(const std::string& value) +{ + _datum->setValue(value); +} + +const std::string XmpTag::getKey() +{ + return _key.key(); +} + +const std::string XmpTag::getType() +{ + return _type; +} + +const std::string XmpTag::getName() +{ + return _name; +} + +const std::string XmpTag::getTitle() +{ + return _title; +} + +const std::string XmpTag::getDescription() +{ + return _description; +} + +const std::string XmpTag::getRawValue() +{ + return _datum->toString(); +} + // TODO: update the errors code to reflect changes from src/error.cpp in libexiv2 void translateExiv2Error(Exiv2::Error const& error) |