Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 54337f164e426953f9a76846fee39eec > files > 64

libapreq2-devel-2.12-7.fc14.i686.rpm

<html>
<head>
  <link rel="stylesheet" type="text/css" href="dox.css" />
  <title>libapreq2-2.12: libapreq2: APR::Request::Param</title> 
</head>
<body>
<div id="page-header">
<p class="menu">
   <a href="http://www.apache.org/">Apache Software Foundation</a> &gt; <a href="http://httpd.apache.org">HTTP Server Project</a> &gt;
<a href="http://httpd.apache.org/apreq/">Request Library Subproject</a></p>
<p class="apache">Apache HTTP Server Request Library</p>
<img alt="" src="feather.gif" /></div>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
  </ul>
</div>
<h1>APR::Request::Param<br>
<small>
[<a class="el" href="group__apreq__xs.html">Perl</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
</table>



<p><a name="__index__"></a></p>

<!-- INDEX BEGIN -->


<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#overloads">OVERLOADS</a></li>
	<ul>

		<li><a href="#">``''</a></li>
	</ul>

	<li><a href="#methods">METHODS</a></li>
	<ul>

		<li><a href="#name">name</a></li>
		<li><a href="#value">value</a></li>
		<li><a href="#is_tainted">is_tainted</a></li>
		<li><a href="#charset">charset</a></li>
		<li><a href="#make">make</a></li>
		<li><a href="#info">info</a></li>
		<li><a href="#upload">upload</a></li>
		<li><a href="#upload_filename">upload_filename</a></li>
		<li><a href="#upload_link">upload_link</a></li>
		<li><a href="#upload_slurp">upload_slurp</a></li>
		<li><a href="#upload_size">upload_size</a></li>
		<li><a href="#upload_type">upload_type</a></li>
		<li><a href="#upload_tempname">upload_tempname</a></li>
		<li><a href="#upload_io">upload_io</a></li>
		<li><a href="#upload_fh">upload_fh</a></li>
	</ul>

	<li><a href="#methods">METHODS</a></li>
	<ul>

		<li><a href="#new__tiehandle">new, TIEHANDLE</a></li>
		<li><a href="#read">READ</a></li>
		<li><a href="#readline">READLINE</a></li>
	</ul>

	<li><a href="#methods">METHODS</a></li>
	<ul>

		<li><a href="#read">read</a></li>
		<li><a href="#readline">readline</a></li>
	</ul>

	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#copyright">COPYRIGHT</a></li>
</ul>

<!-- INDEX END -->


<hr />

<p>

</p>

<h1><a name="name">NAME</a></h1>

<p>APR::Request::Param - wrapper for libapreq2's param API.</p>

<p>

</p>
<hr />

<h1><a name="synopsis">SYNOPSIS</a></h1>

<pre>
  use APR::Request::Param;</pre>

<pre>
  $arg1 = $req-&gt;args('alpha');
  $body = $req-&gt;body;
  $body-&gt;param_class(&quot;APR::Request::Param&quot;);
  ok $_-&gt;isa(&quot;APR::Request::Param&quot;) for values %$body;</pre>

<pre>
  @uploads = grep {$_-&gt;upload} values %$body;
  $param = $body-&gt;get('beta');
  $param-&gt;upload_slurp(my $content);</pre>

<p>

</p>
<hr />

<h1><a name="description">DESCRIPTION</a></h1>

<p>The <code>APR::Request::Param</code> module provides base methods
for interfacing with libapreq2's param API.  It also provides
a few utility functions and constants.</p>

<p>This manpage documents version 2.12
of the APR::Request::Param, APR::Request::Brigade,
and APR::Request::Brigade::IO packages.</p>

<p>

</p>
<hr />

<h1><a name="overloads">OVERLOADS</a></h1>

<p>APR::Request::Param</p>

<p>

</p>

<h2><a name="">``''</a></h2>

<pre>
    &quot;$param&quot;</pre>

<p>The double-quote interpolation operator maps to
<code>APR::Request::Param::value()</code>.</p>

<p>

</p>
<hr />

<h1><a name="methods">METHODS</a></h1>

<p>APR::Request::Param</p>

<p>

</p>

<h2><a name="name">name</a></h2>

<pre>
    $param-&gt;name()</pre>

<p>Returns the param's name.
This attribute cannot be modified.</p>

<p>

</p>

<h2><a name="value">value</a></h2>

<pre>
    $param-&gt;value()</pre>

<p>Returns the param's value.
This attribute cannot be modified.</p>

<p>

</p>

<h2><a name="is_tainted">is_tainted</a></h2>

<pre>
    $param-&gt;is_tainted()
    $param-&gt;is_tainted($set)</pre>

<p>Get/set the param's internal tainted flag.
Note: if the param's charset is APREQ_CHARSET_UTF8 (8),
this also activates the SvUTF8_on flag during calls
to <code>name()</code> and/or value().</p>

<pre>
    $tainted = $param-&gt;is_tainted;
    $param-&gt;is_tainted(0);
    ok $param-&gt;is_tainted == 0;</pre>

<p>

</p>

<h2><a name="charset">charset</a></h2>

<pre>
    $param-&gt;charset()
    $param-&gt;charset($set)</pre>

<p>Get/set the param's internal charset.  The charset
is a number between 0 and 255; the current recognized
values are</p>

<ol>

<li>
<strong>
<a name="item_apreq_charset_ascii">APREQ_CHARSET_ASCII    (7-bit us-ascii)</a>
</strong><br />

</li>


<li>
<strong>
<a name="item_apreq_charset_latin1">APREQ_CHARSET_LATIN1   (8-bit iso-8859-1)</a>
</strong><br />

</li>


<li>
<strong>
<a name="item_apreq_charset_cp1252">APREQ_CHARSET_CP1252   (8-bit Windows-1252)</a>
</strong><br />

</li>


<li>
<strong>
<a name="item_apreq_charset_utf8">APREQ_CHARSET_UTF8     (utf8 encoded Unicode)</a>
</strong><br />

</li>


</ol>


<p>See <a href="#is_tainted">the is_tainted manpage</a> above for info about how APREQ_CHARSET_UTF8
relates to perl's UTF-8 flag.</p>

<pre>
    $charset = $param-&gt;charset;
    $param-&gt;charset(2);
    ok $param-&gt;charset == 2;</pre>

<p>

</p>

<h2><a name="make">make</a></h2>

<pre>
    APR::Request::Param-&gt;make($pool, $name, $value)</pre>

<p>Fast XS param constructor.</p>

<p>

</p>

<h2><a name="info">info</a></h2>

<pre>
    $param-&gt;info()
    $param-&gt;info($set)</pre>

<p>Get/set the APR::Table headers for this param.</p>

<p>

</p>

<h2><a name="upload">upload</a></h2>

<pre>
    $param-&gt;upload()
    $param-&gt;upload($set)</pre>

<p>Get/set the APR::Brigade file-upload content for this param.</p>

<p>

</p>

<h2><a name="upload_filename">upload_filename</a></h2>

<pre>
    $param-&gt;upload_filename()</pre>

<p>Returns the client-side filename associated with this param.</p>

<p>

</p>

<h2><a name="upload_link">upload_link</a></h2>

<pre>
    $param-&gt;upload_link($path)</pre>

<p>Links the file-upload content with the local file named <code>$path</code>.
Creates a hard-link if the spoolfile's (see <a href="#upload_tempname">the upload_tempname manpage</a>)
temporary directory is on the same device as <code>$path</code>;
otherwise this writes a copy.</p>

<p>

</p>

<h2><a name="upload_slurp">upload_slurp</a></h2>

<pre>
    $param-&gt;upload_slurp($data)</pre>

<p>Reads the entire file-upload content into <code>$data</code>.</p>

<p>

</p>

<h2><a name="upload_size">upload_size</a></h2>

<pre>
    $param-&gt;upload_size()</pre>

<p>Returns the size of the param's file-upload content.</p>

<p>

</p>

<h2><a name="upload_type">upload_type</a></h2>

<pre>
    $param-&gt;upload_type()</pre>

<p>Returns the MIME-type of the param's file-upload content.</p>

<p>

</p>

<h2><a name="upload_tempname">upload_tempname</a></h2>

<pre>
    $param-&gt;upload_tempname()</pre>

<p>Returns the name of the local spoolfile for this param.</p>

<p>

</p>

<h2><a name="upload_io">upload_io</a></h2>

<pre>
    $param-&gt;upload_io()</pre>

<p>Returns an <a href="/APR/Request/Brigade/IO.html">the APR::Request::Brigade::IO manpage</a> object, which can
be treated as a non-seekable IO stream.</p>

<p>

</p>

<h2><a name="upload_fh">upload_fh</a></h2>

<pre>
    $param-&gt;upload_fh()</pre>

<p>Returns a seekable filehandle representing the file-upload content.</p>

<p>

</p>
<hr />

<h1><a name="methods">METHODS</a></h1>

<p>APR::Request::Brigade</p>

<p>This class is derived from APR::Brigade, providing additional
methods for TIEHANDLE, READ and READLINE.  To be memory efficient,
these methods delete buckets from the brigade as soon as their
data is actually read, so you cannot <code>seek</code> on handles tied to
this class.  Such handles have semantics similar to that of a
read-only socket.</p>

<p>

</p>

<h2><a name="new__tiehandle">new, TIEHANDLE</a></h2>

<pre>
    APR::Request::Brigade-&gt;TIEHANDLE($bb)</pre>

<p>Creates a copy of the bucket brigade represented by $bb, and
blesses that copy into the APR::Request::Brigade class.  This
provides syntactic sugar for using perl's builtin <code>read</code>, <code>readline</code>,
and <code>&lt;&gt;</code> operations on handles tied to this package:</p>

<pre>
    use Symbol;
    $fh = gensym;
    tie *$fh, &quot;APR::Request::Brigade&quot;, $bb;
    print while &lt;$fh&gt;;</pre>

<p>

</p>

<h2><a name="read">READ</a></h2>

<pre>
    $bb-&gt;READ($contents)
    $bb-&gt;READ($contents, $length)
    $bb-&gt;READ($contents, $length, $offset)</pre>

<p>Reads data from the brigade $bb into $contents.  When omitted
$length defaults to <code>-1</code>, which reads the first bucket into $contents.
A positive $length will read in $length bytes, or the remainder of the
brigade, whichever is greater. $offset represents the index in $context
to read the new data.</p>

<p>

</p>

<h2><a name="readline">READLINE</a></h2>

<pre>
    $bb-&gt;READLINE()</pre>

<p>Returns the first line of data from the bride. Lines are terminated by
linefeeds (the '\012' character), but we may eventually use <code>$/</code> instead.</p>

<p>

</p>
<hr />

<h1><a name="methods">METHODS</a></h1>

<p>APR::Request::Brigade::IO</p>

<p>

</p>

<h2><a name="read">read</a></h2>

<p>OO interface to APR::Request::Brigade::READ.</p>

<p>

</p>

<h2><a name="readline">readline</a></h2>

<p>OO interface to APR::Request::Brigade::READLINE.</p>

<p>

</p>
<hr />

<h1><a name="see_also">SEE ALSO</a></h1>

<p><a href="group__apreq__xs__apr__request.html">the APR::Request manpage</a>, <a href="http://apr.apache.org/docs/apr/1.3/apr__tables_8h.html">the APR::Table manpage</a>, <a href="http://apr.apache.org/docs/apr-util/1.3/apr__buckets_8h.html">the APR::Brigade manpage</a>.</p>

<p>

</p>
<hr />

<h1><a name="copyright">COPYRIGHT</a></h1>

<pre>
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the &quot;License&quot;); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at</pre>

<pre>
      <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></pre>

<pre>
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.</pre>


 <div id="footer">
<p class="apache">
Copyright &copy; 2003-2006 <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
See <a href="apreq_license.html">LICENSE</a>.</p>
<p class="menu">
<span style="color:#aaa">page generated by <a href="http://www.doxygen.org/"><code>doxygen</code></a>
version 1.5.2 on 6 Mar 2009</span>
</p>
</div>
</body>
</html>