Protocol

KeyedDecodingContainerProtocol

A type that provides a view into a decoder’s storage and is used to hold the encoded properties of a decodable type in a keyed manner.

Declaration

protocol KeyedDecodingContainerProtocol

Overview

Decoders should provide types conforming to UnkeyedDecodingContainer for their format.

Topics

Associated Types

Instance Properties

var allKeys: [Self.Key]

All the keys the Decoder has for this container.

Required.

var codingPath: [CodingKey]

The path of coding keys taken to get to this point in decoding.

Required.

Instance Methods

func contains(Self.Key) -> Bool

Returns a Boolean value indicating whether the decoder contains a value associated with the given key.

Required.

func decode(Float.Type, forKey: Self.Key) -> Float

Decodes a value of the given type for the given key.

Required.

func decode(UInt16.Type, forKey: Self.Key) -> UInt16

Decodes a value of the given type for the given key.

Required.

func decode(Bool.Type, forKey: Self.Key) -> Bool

Decodes a value of the given type for the given key.

Required.

func decode(Int16.Type, forKey: Self.Key) -> Int16

Decodes a value of the given type for the given key.

Required.

func decode(Int8.Type, forKey: Self.Key) -> Int8

Decodes a value of the given type for the given key.

Required.

func decode(String.Type, forKey: Self.Key) -> String

Decodes a value of the given type for the given key.

Required.

func decode(Double.Type, forKey: Self.Key) -> Double

Decodes a value of the given type for the given key.

Required.

func decode(UInt.Type, forKey: Self.Key) -> UInt

Decodes a value of the given type for the given key.

Required.

func decode(UInt8.Type, forKey: Self.Key) -> UInt8

Decodes a value of the given type for the given key.

Required.

func decode(Int32.Type, forKey: Self.Key) -> Int32

Decodes a value of the given type for the given key.

Required.

func decode(Int.Type, forKey: Self.Key) -> Int

Decodes a value of the given type for the given key.

Required.

func decode<T>(T.Type, forKey: Self.Key) -> T

Decodes a value of the given type for the given key.

Required.

func decode(UInt32.Type, forKey: Self.Key) -> UInt32

Decodes a value of the given type for the given key.

Required.

func decode(UInt64.Type, forKey: Self.Key) -> UInt64

Decodes a value of the given type for the given key.

Required.

func decode(Int64.Type, forKey: Self.Key) -> Int64

Decodes a value of the given type for the given key.

Required.

func decodeIfPresent(String.Type, forKey: Self.Key) -> String?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Bool.Type, forKey: Self.Key) -> Bool?

Decodes a value of the given type for the given key, if present.

Required. Default implementations provided.

func decodeIfPresent(Double.Type, forKey: Self.Key) -> Double?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Float.Type, forKey: Self.Key) -> Float?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Int.Type, forKey: Self.Key) -> Int?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(UInt.Type, forKey: Self.Key) -> UInt?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Int8.Type, forKey: Self.Key) -> Int8?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Int16.Type, forKey: Self.Key) -> Int16?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Int32.Type, forKey: Self.Key) -> Int32?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(Int64.Type, forKey: Self.Key) -> Int64?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(UInt8.Type, forKey: Self.Key) -> UInt8?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(UInt16.Type, forKey: Self.Key) -> UInt16?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(UInt32.Type, forKey: Self.Key) -> UInt32?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent(UInt64.Type, forKey: Self.Key) -> UInt64?

Decodes a value of the given type for the given key, if present.

Required.

func decodeIfPresent<T>(T.Type, forKey: Self.Key) -> T?

Decodes a value of the given type for the given key, if present.

Required.

func decodeNil(forKey: Self.Key) -> Bool

Decodes a null value for the given key.

Required.

func nestedContainer<NestedKey>(keyedBy: NestedKey.Type, forKey: Self.Key) -> KeyedDecodingContainer<NestedKey>

Returns the data stored for the given key as represented in a container keyed by the given key type.

Required.

func nestedUnkeyedContainer(forKey: Self.Key) -> UnkeyedDecodingContainer

Returns the data stored for the given key as represented in an unkeyed container.

Required.

func superDecoder() -> Decoder

Returns a Decoder instance for decoding super from the container associated with the default super key.

Required.

func superDecoder(forKey: Self.Key) -> Decoder

Returns a Decoder instance for decoding super from the container associated with the given key.

Required.

Relationships

Conforming Types

See Also

Decoding Containers

struct KeyedDecodingContainer

A concrete container that provides a view into a decoder’s storage, making the encoded properties of a decodable type accessible by keys.

protocol SingleValueDecodingContainer

A container that can support the storage and direct decoding of a single nonkeyed value.

protocol UnkeyedDecodingContainer

A type that provides a view into a decoder’s storage and is used to hold the encoded properties of a decodable type sequentially, without keys.