diff --git a/src/value.cpp b/src/value.cpp
index 96ef9b78..9e40c3a5 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -702,6 +702,16 @@ namespace Exiv2 {
std::string LangAltValue::toString(long /*n*/) const
{
+ return toString("x-default");
+ }
+
+ std::string LangAltValue::toString(const std::string& qualifier) const
+ {
+ ValueType::const_iterator i = value_.find(qualifier);
+ if (i != value_.end()) {
+ ok_ = true;
+ return i->second;
+ }
ok_ = false;
return "";
}
diff --git a/src/value.hpp b/src/value.hpp
index e95ca14f..82b5ddda 100644
--- a/src/value.hpp
+++ b/src/value.hpp
@@ -893,11 +893,19 @@ namespace Exiv2 {
AutoPtr clone() const;
virtual long count() const;
/*!
- @brief Return the n-th component of the value as a string.
- The behaviour of this method may be undefined if there is no
- n-th component.
+ @brief Return the text value associated with the default language
+ qualifier \c x-default. The parameter \em n is not used, but
+ it is suggested that only 0 is passed in. Returns an empty
+ string and sets the ok-flag to \c false if there is no
+ default value.
*/
virtual std::string toString(long n) const;
+ /*!
+ @brief Return the text value associated with the language qualifier
+ \em qualifier. Returns an empty string and sets the ok-flag
+ to \c false if there is no entry for the language qualifier.
+ */
+ std::string toString(const std::string& qualifier) const;
virtual long toLong(long n =0) const;
virtual float toFloat(long n =0) const;
virtual Rational toRational(long n =0) const;