blob: d926460635d3ce4c695aaf93e5b48e66b85fbacf [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>pp::FileRef Class Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="pp::FileRef" --><!-- doxytag: inherits="pp::Resource" --><div class="dynheader">
Inheritance diagram for pp::FileRef:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_file_ref__inherit__graph.png" border="0" usemap="#pp_1_1_file_ref_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_file_ref_inherit__map" id="pp_1_1_file_ref_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="5,5,109,32"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_file_ref-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a4c79db956157379aa877e57ff06d2c10">FileRef</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a3345910589954a8fb573cdf2c82166b0">FileRef</a> (PP_Resource resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a50652a877b8c02c736f86b1d69fc9b11">FileRef</a> (<a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>, PP_Resource resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a95aad2e3c8d9b52b1ac09279c8cf8113">FileRef</a> (const <a class="el" href="classpp_1_1_file_system.html">FileSystem</a> &amp;file_system, const char *path)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a9a66f16e7d9a4198c206144bc3498ec5">FileRef</a> (const <a class="el" href="classpp_1_1_file_ref.html">FileRef</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PP_FileSystemType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a71de4e20d117efcf4ac8000c2149e3f8">GetFileSystemType</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var.html">Var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#acb186b79d906675e288ff5d0d0a7eab2">GetName</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var.html">Var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a657da250b3ff47ca8f1c616f9ebee6a0">GetPath</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_file_ref.html">FileRef</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a514534c1a31732e328e062bdaa194919">GetParent</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#afb1a20f9864801457db28d32ab1d7104">MakeDirectory</a> (int32_t make_directory_flags, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#ab8e5d24d96c7408b140b74aa0ed8d7ca">Touch</a> (PP_Time last_access_time, PP_Time last_modified_time, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#abfdb9c3db04b0ef2591953f79c255873">Delete</a> (const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#ab1d7f8a63643561a6529952faa881505">Rename</a> (const <a class="el" href="classpp_1_1_file_ref.html">FileRef</a> &amp;new_file_ref, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#a6de22adc35e4485dfba663dad64c15fb">Query</a> (const <a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a>&lt; PP_FileInfo &gt; &amp;callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_file_ref.html#af16f7bba00d624a16a1d9b9b09347c8c">ReadDirectoryEntries</a> (const <a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a>&lt; std::vector&lt; <a class="el" href="classpp_1_1_directory_entry.html">DirectoryEntry</a> &gt; &gt; &amp;callback)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code> class represents a "weak pointer" to a file in a file system. </p>
</div><hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a4c79db956157379aa877e57ff06d2c10"></a><!-- doxytag: member="pp::FileRef::FileRef" ref="a4c79db956157379aa877e57ff06d2c10" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_file_ref.html#a4c79db956157379aa877e57ff06d2c10">pp::FileRef::FileRef</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Default constructor for creating an <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code> object. </p>
</div>
</div>
<a class="anchor" id="a3345910589954a8fb573cdf2c82166b0"></a><!-- doxytag: member="pp::FileRef::FileRef" ref="a3345910589954a8fb573cdf2c82166b0" args="(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_file_ref.html#a4c79db956157379aa877e57ff06d2c10">pp::FileRef::FileRef</a> </td>
<td>(</td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used when you have an existing PP_Resource for a <a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a> and which to create a C++ object that takes an additional reference to the resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A PP_Resource corresponding to file reference. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a50652a877b8c02c736f86b1d69fc9b11"></a><!-- doxytag: member="pp::FileRef::FileRef" ref="a50652a877b8c02c736f86b1d69fc9b11" args="(PassRef, PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_file_ref.html#a4c79db956157379aa877e57ff06d2c10">pp::FileRef::FileRef</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>&#160;</td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used when you have received a PP_Resource as a return value that has already been reference counted. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A PP_Resource corresponding to file reference. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a95aad2e3c8d9b52b1ac09279c8cf8113"></a><!-- doxytag: member="pp::FileRef::FileRef" ref="a95aad2e3c8d9b52b1ac09279c8cf8113" args="(const FileSystem &amp;file_system, const char *path)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_file_ref.html#a4c79db956157379aa877e57ff06d2c10">pp::FileRef::FileRef</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_file_system.html">FileSystem</a> &amp;&#160;</td>
<td class="paramname"><em>file_system</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>path</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor that creates a weak pointer to a file in the given file system. </p>
<p>File paths are POSIX style.</p>
<p>If the <code>path</code> is malformed, the resulting <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code> will have a null <code>PP_Resource</code>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">file_system</td><td>A <code><a class="el" href="classpp_1_1_file_system.html" title="The FileSystem class identifies the file system type associated with a file.">FileSystem</a></code> corresponding to a file system type. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path to the file. Must begin with a '/' character. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a9a66f16e7d9a4198c206144bc3498ec5"></a><!-- doxytag: member="pp::FileRef::FileRef" ref="a9a66f16e7d9a4198c206144bc3498ec5" args="(const FileRef &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_file_ref.html#a4c79db956157379aa877e57ff06d2c10">pp::FileRef::FileRef</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_file_ref.html">FileRef</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The copy constructor for <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A pointer to a <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="abfdb9c3db04b0ef2591953f79c255873"></a><!-- doxytag: member="pp::FileRef::Delete" ref="abfdb9c3db04b0ef2591953f79c255873" args="(const CompletionCallback &amp;cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_file_ref.html#abfdb9c3db04b0ef2591953f79c255873">pp::FileRef::Delete</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>cc</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#abfdb9c3db04b0ef2591953f79c255873" title="Delete() deletes a file or directory.">Delete()</a> deletes a file or directory. </p>
<p>If <code>file_ref</code> refers to a directory, then the directory must be empty. It is an error to delete a file or directory that is in use. It is not valid to delete a file in the external file system.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called upon completion of <a class="el" href="classpp_1_1_file_ref.html#abfdb9c3db04b0ef2591953f79c255873" title="Delete() deletes a file or directory.">Delete()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a71de4e20d117efcf4ac8000c2149e3f8"></a><!-- doxytag: member="pp::FileRef::GetFileSystemType" ref="a71de4e20d117efcf4ac8000c2149e3f8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PP_FileSystemType <a class="el" href="classpp_1_1_file_ref.html#a71de4e20d117efcf4ac8000c2149e3f8">pp::FileRef::GetFileSystemType</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#a71de4e20d117efcf4ac8000c2149e3f8" title="GetFileSystemType() returns the type of the file system.">GetFileSystemType()</a> returns the type of the file system. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_FileSystemType</code> with the file system type if valid or <code>PP_FILESYSTEMTYPE_INVALID</code> if the provided resource is not a valid file reference. </dd></dl>
</div>
</div>
<a class="anchor" id="acb186b79d906675e288ff5d0d0a7eab2"></a><!-- doxytag: member="pp::FileRef::GetName" ref="acb186b79d906675e288ff5d0d0a7eab2" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var.html">Var</a> <a class="el" href="classpp_1_1_file_ref.html#acb186b79d906675e288ff5d0d0a7eab2">pp::FileRef::GetName</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#acb186b79d906675e288ff5d0d0a7eab2" title="GetName() returns the name of the file.">GetName()</a> returns the name of the file. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> containing the name of the file. The value returned by this function does not include any path components (such as the name of the parent directory, for example). It is just the name of the file. Use <a class="el" href="classpp_1_1_file_ref.html#a657da250b3ff47ca8f1c616f9ebee6a0" title="GetPath() returns the absolute path of the file.">GetPath()</a> to get the full file path. </dd></dl>
</div>
</div>
<a class="anchor" id="a514534c1a31732e328e062bdaa194919"></a><!-- doxytag: member="pp::FileRef::GetParent" ref="a514534c1a31732e328e062bdaa194919" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_file_ref.html">FileRef</a> <a class="el" href="classpp_1_1_file_ref.html#a514534c1a31732e328e062bdaa194919">pp::FileRef::GetParent</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#a514534c1a31732e328e062bdaa194919" title="GetParent() returns the parent directory of this file.">GetParent()</a> returns the parent directory of this file. </p>
<p>If <code>file_ref</code> points to the root of the filesystem, then the root is returned.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code> containing the parent directory of the file. This function fails if the file system type is <code>PP_FileSystemType_External</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a657da250b3ff47ca8f1c616f9ebee6a0"></a><!-- doxytag: member="pp::FileRef::GetPath" ref="a657da250b3ff47ca8f1c616f9ebee6a0" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var.html">Var</a> <a class="el" href="classpp_1_1_file_ref.html#a657da250b3ff47ca8f1c616f9ebee6a0">pp::FileRef::GetPath</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#a657da250b3ff47ca8f1c616f9ebee6a0" title="GetPath() returns the absolute path of the file.">GetPath()</a> returns the absolute path of the file. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> containing the absolute path of the file. This function fails if the file system type is <code>PP_FileSystemType_External</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="afb1a20f9864801457db28d32ab1d7104"></a><!-- doxytag: member="pp::FileRef::MakeDirectory" ref="afb1a20f9864801457db28d32ab1d7104" args="(int32_t make_directory_flags, const CompletionCallback &amp;cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_file_ref.html#afb1a20f9864801457db28d32ab1d7104">pp::FileRef::MakeDirectory</a> </td>
<td>(</td>
<td class="paramtype">int32_t&#160;</td>
<td class="paramname"><em>make_directory_flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>cc</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#afb1a20f9864801457db28d32ab1d7104" title="MakeDirectory() makes a new directory in the file system according to the given make_directory_flags...">MakeDirectory()</a> makes a new directory in the file system according to the given <code>make_directory_flags</code>, which is a bit-mask of the <code>PP_MakeDirectoryFlags</code> values. </p>
<p>It is not valid to make a directory in the external file system.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">make_directory_flags</td><td>A bit-mask of the <code>PP_MakeDirectoryFlags</code> values. See <code>ppb_file_ref.h</code> for more details. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called upon completion of <a class="el" href="classpp_1_1_file_ref.html#afb1a20f9864801457db28d32ab1d7104" title="MakeDirectory() makes a new directory in the file system according to the given make_directory_flags...">MakeDirectory()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a6de22adc35e4485dfba663dad64c15fb"></a><!-- doxytag: member="pp::FileRef::Query" ref="a6de22adc35e4485dfba663dad64c15fb" args="(const CompletionCallbackWithOutput&lt; PP_FileInfo &gt; &amp;callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_file_ref.html#a6de22adc35e4485dfba663dad64c15fb">pp::FileRef::Query</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a>&lt; PP_FileInfo &gt; &amp;&#160;</td>
<td class="paramname"><em>callback</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#a6de22adc35e4485dfba663dad64c15fb" title="Query() queries info about a file or directory.">Query()</a> queries info about a file or directory. </p>
<p>You must have access to read this file or directory if it exists in the external filesystem.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a></code> to be called upon completion of <a class="el" href="classpp_1_1_file_ref.html#a6de22adc35e4485dfba663dad64c15fb" title="Query() queries info about a file or directory.">Query()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="af16f7bba00d624a16a1d9b9b09347c8c"></a><!-- doxytag: member="pp::FileRef::ReadDirectoryEntries" ref="af16f7bba00d624a16a1d9b9b09347c8c" args="(const CompletionCallbackWithOutput&lt; std::vector&lt; DirectoryEntry &gt; &gt; &amp;callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_file_ref.html#af16f7bba00d624a16a1d9b9b09347c8c">pp::FileRef::ReadDirectoryEntries</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a>&lt; std::vector&lt; <a class="el" href="classpp_1_1_directory_entry.html">DirectoryEntry</a> &gt; &gt; &amp;&#160;</td>
<td class="paramname"><em>callback</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#af16f7bba00d624a16a1d9b9b09347c8c" title="ReadDirectoryEntries() Reads all entries in the directory.">ReadDirectoryEntries()</a> Reads all entries in the directory. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a></code> to be called upon completion of <a class="el" href="classpp_1_1_file_ref.html#af16f7bba00d624a16a1d9b9b09347c8c" title="ReadDirectoryEntries() Reads all entries in the directory.">ReadDirectoryEntries()</a>. On success, the directory entries will be passed to the given function.</td></tr>
</table>
</dd>
</dl>
<p>Normally you would use a <a class="el" href="classpp_1_1_completion_callback_factory.html" title="CompletionCallbackFactory&lt;T&gt; may be used to create CompletionCallback objects that are bound to membe...">CompletionCallbackFactory</a> to allow callbacks to be bound to your class. See <a class="el" href="completion__callback__factory_8h.html" title="This file defines the API to create CompletionCallback objects that are bound to member functions...">completion_callback_factory.h</a> for more discussion on how to use this. Your callback will generally look like:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> OnReadDirectoryEntries(
int32_t result,
<span class="keyword">const</span> std::vector&lt;DirectoryEntry&gt;&amp; entries) {
<span class="keywordflow">if</span> (result == PP_OK)
<span class="comment">// use entries...</span>
}
</pre></div><dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="ab1d7f8a63643561a6529952faa881505"></a><!-- doxytag: member="pp::FileRef::Rename" ref="ab1d7f8a63643561a6529952faa881505" args="(const FileRef &amp;new_file_ref, const CompletionCallback &amp;cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_file_ref.html#ab1d7f8a63643561a6529952faa881505">pp::FileRef::Rename</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_file_ref.html">FileRef</a> &amp;&#160;</td>
<td class="paramname"><em>new_file_ref</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>cc</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#ab1d7f8a63643561a6529952faa881505" title="Rename() renames a file or directory.">Rename()</a> renames a file or directory. </p>
<p>Argument <code>new_file_ref</code> must refer to files in the same file system as in this object. It is an error to rename a file or directory that is in use. It is not valid to rename a file in the external file system.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">new_file_ref</td><td>A <code><a class="el" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.'>FileRef</a></code> corresponding to a new file reference. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called upon completion of <a class="el" href="classpp_1_1_file_ref.html#ab1d7f8a63643561a6529952faa881505" title="Rename() renames a file or directory.">Rename()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="ab8e5d24d96c7408b140b74aa0ed8d7ca"></a><!-- doxytag: member="pp::FileRef::Touch" ref="ab8e5d24d96c7408b140b74aa0ed8d7ca" args="(PP_Time last_access_time, PP_Time last_modified_time, const CompletionCallback &amp;cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_file_ref.html#ab8e5d24d96c7408b140b74aa0ed8d7ca">pp::FileRef::Touch</a> </td>
<td>(</td>
<td class="paramtype">PP_Time&#160;</td>
<td class="paramname"><em>last_access_time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PP_Time&#160;</td>
<td class="paramname"><em>last_modified_time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>cc</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_file_ref.html#ab8e5d24d96c7408b140b74aa0ed8d7ca" title="Touch() Updates time stamps for a file.">Touch()</a> Updates time stamps for a file. </p>
<p>You must have write access to the file if it exists in the external filesystem.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">last_access_time</td><td>The last time the file was accessed. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">last_modified_time</td><td>The last time the file was modified. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to be called upon completion of <a class="el" href="classpp_1_1_file_ref.html#ab8e5d24d96c7408b140b74aa0ed8d7ca" title="Touch() Updates time stamps for a file.">Touch()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="file__ref_8h.html">file_ref.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}