2021-11-14 20:01:54 +00:00
|
|
|
package toml
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
2022-02-24 16:33:24 +00:00
|
|
|
// Deprecated: use encoding.TextMarshaler
|
2021-11-14 20:01:54 +00:00
|
|
|
type TextMarshaler encoding.TextMarshaler
|
|
|
|
|
2022-02-24 16:33:24 +00:00
|
|
|
// Deprecated: use encoding.TextUnmarshaler
|
2021-11-14 20:01:54 +00:00
|
|
|
type TextUnmarshaler encoding.TextUnmarshaler
|
|
|
|
|
2022-02-24 16:33:24 +00:00
|
|
|
// Deprecated: use MetaData.PrimitiveDecode.
|
2021-11-14 20:01:54 +00:00
|
|
|
func PrimitiveDecode(primValue Primitive, v interface{}) error {
|
2022-02-24 16:33:24 +00:00
|
|
|
md := MetaData{decoded: make(map[string]struct{})}
|
2021-11-14 20:01:54 +00:00
|
|
|
return md.unify(primValue.undecoded, rvalue(v))
|
|
|
|
}
|
|
|
|
|
2022-02-24 16:33:24 +00:00
|
|
|
// Deprecated: use NewDecoder(reader).Decode(&value).
|
|
|
|
func DecodeReader(r io.Reader, v interface{}) (MetaData, error) { return NewDecoder(r).Decode(v) }
|