exiv2._metadatum

Exiv2 metadatum base class.

Classes

Metadatum

Abstract base class defining the interface to access information related to one metadata tag.

class Metadatum

Bases: SwigPyObject

Abstract base class defining the interface to access information related to one metadata tag.

copy()

Write value to a data buffer and return the number of bytes written.

The user must ensure that the buffer has enough memory. Otherwise the call results in undefined behaviour.

Parameters:
  • buf (writeable bytes-like object) – Data buffer to write to.

  • byteOrder (ByteOrder) – Applicable byte order (little or big endian).

Return type:

int

Returns:

Number of characters written.

count()

Return the number of components in the value

familyName()

Return the name of the metadata family (which is also the first part of the key)

getValue()

Return an auto-pointer to a copy (clone) of the value. The caller owns this copy and the auto-poiner ensures that it will be deleted.

This method is provided for users who need full control over the value. A caller may, e.g., downcast the pointer to the appropriate subclass of Value to make use of the interface of the subclass to set or modify its contents.

Return type:

Value

Returns:

An auto-pointer containing a pointer to a copy (clone) of the value, 0 if the value is not set.

groupName()

Return the name of the metadata group (which is also the second part of the key)

key()

Return the key of the metadatum. The key is of the form ‘familyName.groupName.tagName’. Note however that the key is not necessarily unique, e.g., an ExifData object may contain multiple metadata with the same key.

print()

Write the interpreted value to a string.

Implemented in terms of write(), see there.

setValue()

Overload 1:

Set the value. This method copies (clones) the value pointed to by pValue.

Overload 2:

Set the value to the string buf. Uses Value::read(const std::string& buf). If the metadatum does not have a value yet, then one is created. See subclasses for more details. Return 0 if the value was read successfully.

size()

Return the size of the value in bytes

tag()

Return the tag

tagDesc()

Return a description for the tag

tagLabel()

Return a label for the tag

tagName()

Return the name of the tag (which is also the third part of the key)

toFloat()

Return the n-th component of the value converted to float. The return value is -1 if the value is not set and the behaviour of the method is undefined if there is no n-th component.

toInt64()

Return the n-th component of the value converted to int64_t. The return value is -1 if the value is not set and the behaviour of the method is undefined if there is no n-th component.

toRational()

Return the n-th component of the value converted to Rational. The return value is -1/1 if the value is not set and the behaviour of the method is undefined if there is no n-th component.

toString()

Overload 1:

Return the value as a string.

Overload 2:

Return the n-th component of the value converted to a string. The behaviour of the method is undefined if there is no n-th component.

toUint32()

Return the n-th component of the value converted to uint32_t.

typeId()

Return the type id of the value

typeName()

Return the name of the type

typeSize()

Return the size in bytes of one component of this type

value()

Return a constant reference to the value.

This method is provided mostly for convenient and versatile output of the value which can (to some extent) be formatted through standard stream manipulators. Do not attempt to write to the value through this reference. An Error is thrown if the value is not set; as an alternative to catching it, one can use count() to check if there is any data before calling this method.

Return type:

Value

Returns:

A constant reference to the value.

Raises:

Exiv2Error if the value is not set.