man-pages/man3/URI::WithBase.3pm.html
2021-03-31 01:06:50 +01:00

110 lines
2.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of URI::WithBase</TITLE>
</HEAD><BODY>
<H1>URI::WithBase</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-02-08<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
URI::WithBase - URIs which remember their base
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
$u1 = URI::WithBase-&gt;new($str, $base);
$u2 = $u1-&gt;abs;
$base = $u1-&gt;base;
$u1-&gt;base( $new_base )
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This module provides the <TT>&quot;URI::WithBase&quot;</TT> class. Objects of this class
are like <TT>&quot;URI&quot;</TT> objects, but can keep their base too. The base
represents the context where this <FONT SIZE="-1">URI</FONT> was found and can be used to
absolutize or relativize the <FONT SIZE="-1">URI.</FONT> All the methods described in <FONT SIZE="-1">URI</FONT>
are supported for <TT>&quot;URI::WithBase&quot;</TT> objects.
<P>
The methods provided in addition to or modified from those of <TT>&quot;URI&quot;</TT> are:
<DL COMPACT>
<DT id="1">$uri = URI::WithBase-&gt;new($str, [$base])<DD>
The constructor takes an optional base <FONT SIZE="-1">URI</FONT> as the second argument.
If provided, this argument initializes the base attribute.
<DT id="2">$uri-&gt;base( [$new_base] )<DD>
Can be used to get or set the value of the base attribute.
The return value, which is the old value, is a <FONT SIZE="-1">URI</FONT> object or <TT>&quot;undef&quot;</TT>.
<DT id="3">$uri-&gt;abs( [$base_uri] )<DD>
The <TT>$base_uri</TT> argument is now made optional as the object carries its
base with it. A new object is returned even if <TT>$uri</TT> is already
absolute (while plain <FONT SIZE="-1">URI</FONT> objects simply return themselves in
that case).
<DT id="4">$uri-&gt;rel( [$base_uri] )<DD>
The <TT>$base_uri</TT> argument is now made optional as the object carries its
base with it. A new object is always returned.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>SEE ALSO</H2>
<FONT SIZE="-1">URI</FONT>
<A NAME="lbAF">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright 1998-2002 Gisle Aas.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="5"><A HREF="#lbAB">NAME</A><DD>
<DT id="6"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="7"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="8"><A HREF="#lbAE">SEE ALSO</A><DD>
<DT id="9"><A HREF="#lbAF">COPYRIGHT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:59 GMT, March 31, 2021
</BODY>
</HTML>