...

Source file src/github.com/dsoprea/go-exif/v3/undefined/type.go

Documentation: github.com/dsoprea/go-exif/v3/undefined

     1  package exifundefined
     2  
     3  import (
     4  	"errors"
     5  
     6  	"encoding/binary"
     7  
     8  	"github.com/dsoprea/go-exif/v3/common"
     9  )
    10  
    11  const (
    12  	// UnparseableUnknownTagValuePlaceholder is the string to use for an unknown
    13  	// undefined tag.
    14  	UnparseableUnknownTagValuePlaceholder = "!UNKNOWN"
    15  
    16  	// UnparseableHandledTagValuePlaceholder is the string to use for a known
    17  	// value that is not parseable.
    18  	UnparseableHandledTagValuePlaceholder = "!MALFORMED"
    19  )
    20  
    21  var (
    22  	// ErrUnparseableValue is the error for a value that we should have been
    23  	// able to parse but were not able to.
    24  	ErrUnparseableValue = errors.New("unparseable undefined tag")
    25  )
    26  
    27  // UndefinedValueEncoder knows how to encode an undefined-type tag's value to
    28  // bytes.
    29  type UndefinedValueEncoder interface {
    30  	Encode(value interface{}, byteOrder binary.ByteOrder) (encoded []byte, unitCount uint32, err error)
    31  }
    32  
    33  // EncodeableValue wraps a value with the information that will be needed to re-
    34  // encode it later.
    35  type EncodeableValue interface {
    36  	EncoderName() string
    37  	String() string
    38  }
    39  
    40  // UndefinedValueDecoder knows how to decode an undefined-type tag's value from
    41  // bytes.
    42  type UndefinedValueDecoder interface {
    43  	Decode(valueContext *exifcommon.ValueContext) (value EncodeableValue, err error)
    44  }
    45  

View as plain text