view src/name/blackcap/exifwasher/exiv2/ExifData.kt @ 60:d0b83fc1d62a default tip

Remember our input directory on a per-invocation basis.
author David Barts <n5jrn@me.com>
date Sun, 26 Jul 2020 15:14:03 -0700
parents 959fa9014deb
children
line wrap: on
line source

/*
 * Some image metadata. Note that this now deals with more than
 * just Exif metadata, so "ExifData" is something of a misnomer.
 */
package name.blackcap.exifwasher.exiv2

import kotlin.collections.Iterable
import kotlin.collections.Iterator

public class ExifData(ptr: Long) {
    init {
        Initialize.libraries()
    }

    private external fun _erase(key: String): Unit
    private external fun _value(key: String): Value
    private external fun _keys(): Array<String>

    private val pointer = ptr

    val keys: Array<String>
    get() {
        return _keys()
    }

    fun erase(key: String): Unit = _erase(key)

    public data class Value(val type: String, val value: String)

    operator fun get(key: String): Value = _value(key)
}