NAME

MarpaX::ESLIF::URI::_generic - URI Generic syntax as per RFC3986/RFC6874

VERSION

version 0.005

SUBROUTINES/METHODS

$class->new($uri)

Instantiate a new object, or croak on failure. Takes as parameter an URI that will be parsed. The object instance is noted $self below.

$class->bnf

Returns the BNF used to parse the input.

$class->eslif

Returns a MarpaX::ESLIF singleton.

$class->grammar

Returns the compiled BNF used to parse the input as MarpaX::ESLIF::Grammar singleton.

$self->string($type)

Returns the string version of the URI, $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->scheme($type)

Returns the scheme, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->authority($type)

Returns the authority, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->userinfo($type)

Returns the userinfo, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->host($type)

Returns the host (which may contain [] delimiters in case of IPv6 literal), or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->hostname($type)

Returns the hostname (without eventual [] delimiters), or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->ip($type)

Returns the IP when host is such a literal, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

Note that this is the full concatenation of what makes an IP, in particular you will get the eventual IPv6 Zone Id if there is one.

$self->ipv4($type)

Returns the IPv4 when host is such a literal, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->ipv6($type)

Returns the IPv6 when host is such a literal, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->ipvx($type)

Returns the decoded IPvfuture (as per the spec) when host is such a literal, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->zone($type)

Returns the IPv6 Zone Id, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->port

Returns the port, or undef.

$self->path($type)

Returns the path, or the empty string. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->segments($type)

Returns the path segments as an array reference, which may be empty. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->query($type)

Returns the query, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->fragment($type)

Returns the fragment, or undef. $type is either 'decoded' (default value), 'origin' or 'normalized'.

$self->is_abs

Returns a true value if the URI is absolute.

$self->base

Returns a instance that is the absolute version of $self if possible, or croak on failure.

When $self is absolute, $self itself is returned, otherwise it must have a scheme and a new instance without the origin fragment is returned.

$self->normalized

Returns the normalized string of $self.

Equivalent to $self->string('normalized').

$self->decoded

Returns the decoded string of $self.

Equivalent to $self->string('decoded').

$self->resolve($base, $strict)

Returns a instance that converts $self into $base URI, or croak on failure.

Default base is $self->base.

If $strict is a true value, $self is always considered relative to $base, otherwise a new URI without $self's dot segments is returned when $self has a scheme. Default is a true value.

$self->eq($other)

Returns a instance that is the absolute version of current instance if possible, or croak on failure.

$self->clone

Returns a clone of current instance.

$self->as_string

Alias to string method.

$class->remove_dot_segments($path)

Implementation of RFC3896's remove_dot_segments.

NOTES

Logging

This package is Log::Any aware, and will use the later in case parsing fails to output error messages.

SEE ALSO

MarpaX::ESLIF::URI, RFC3986, RFC6874

AUTHOR

Jean-Damien Durand <jeandamiendurand@free.fr>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Jean-Damien Durand.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.