address6

Parses a string containing an IPv6 address.

This function isn't pure since an IPv6 address can contain interface name or interface ID (separated from the address by %). If an interface name is specified (i.e. first character after % is not a digit), the parser tries to convert it to the ID of that interface. If the interface with the given name can't be found, the parser doesn't fail, but just ignores the invalid interface name, scope ID is 0 then.

If an ID is given (i.e. first character after % is a digit), $(D_PSYMBOL address6) just stores it in $(D_PSYMBOL Address6.scopeID) without checking whether an interface with this ID really exists. If the ID is invalid (if it is too long or contains non decimal characters), parsing fails and nothing is returned.

If neither an ID nor a name is given, $(D_PSYMBOL Address6.scopeID) is set to 0.

  1. Nullable!Address6 address6(R range)
    Nullable!Address6
    address6
    (
    R
    )
    ()
    if (
    isForwardRange!R &&
    is(Unqual!(ElementType!R) == char)
    &&
    hasLength!R
    )
  2. Nullable!Address6 address6(R range, uint scopeID)

Parameters

R

Input range type.

range R

Stringish range containing the address.

Return Value

Type: Nullable!Address6

$(D_PSYMBOL Nullable) containing the address if the parsing was successful, or nothing otherwise.

Meta