<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="rararchive.getentry" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>RarArchive::getEntry</refname>
  <refname>rar_entry_get</refname>
  <refpurpose>Get entry object from the RAR archive</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>&style.oop; (method):</para>
   <methodsynopsis>
   <modifier>public</modifier> <type class="union"><type>RarEntry</type><type>false</type></type><methodname>RarArchive::getEntry</methodname>
   <methodparam><type>string</type><parameter>entryname</parameter></methodparam>
   </methodsynopsis>
  <para>&style.procedural;:</para>
  <methodsynopsis>
   <type class="union"><type>RarEntry</type><type>false</type></type><methodname>rar_entry_get</methodname>
   <methodparam><type>RarArchive</type><parameter>rarfile</parameter></methodparam>
   <methodparam><type>string</type><parameter>entryname</parameter></methodparam>
  </methodsynopsis>
  <para>
   Get entry object (file or directory) from the RAR archive.
  </para>
  <note>
    <para>You can also get entry objects using <methodname>RarArchive::getEntries</methodname>.</para>
    <para>Note that a RAR archive can have multiple entries with the same name; this method
    will retrieve only the first.</para>
  </note>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>rarfile</parameter></term>
     <listitem>
      <para>
       A <type>RarArchive</type> object, opened with <function>rar_open</function>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>entryname</parameter></term>
     <listitem>
      <para>
       Path to the entry within the RAR archive.
      </para>
      <note>
        <para>The path must be the same returned by
        <methodname>RarEntry::getName</methodname>.</para>
     </note>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the matching <type>RarEntry</type> object &return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>&style.oop;</title>
    <programlisting role="php">
<![CDATA[
<?php
$rar_arch = RarArchive::open('solid.rar');
if ($rar_arch === FALSE)
    die("Could not open RAR archive.");
$rar_entry = $rar_arch->getEntry('tese.txt');
if ($rar_entry === FALSE)
    die("Could not get such entry");
echo get_class($rar_entry)."\n";
echo $rar_entry;
$rar_arch->close();
?>
]]>
     </programlisting>
     &example.outputs.similar;
     <screen>
<![CDATA[
RarEntry
RarEntry for file "tese.txt" (23b93a7a)
]]>
    </screen>
   </example>
  </para>
  <para>
   <example>
    <title>&style.procedural;</title>
    <programlisting role="php">
<![CDATA[
<?php
$rar_arch = rar_open('solid.rar');
if ($rar_arch === FALSE)
    die("Could not open RAR archive.");
$rar_entry = rar_entry_get($rar_arch, 'tese.txt');
if ($rar_entry === FALSE)
    die("Could not get such entry");
echo get_class($rar_entry)."\n";
echo $rar_entry;
rar_close($rar_arch);
?>
]]>
     </programlisting>
   </example>
  </para>
 </refsect1>

  <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><methodname>RarArchive::getEntries</methodname></member>
    <member><link linkend="wrappers.rar"><literal>rar://</literal> wrapper</link></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
