<areahref="../../d7/dbd/classshaka_1_1LocalFile.html"title="Implement LocalFile which deals with local storage. "alt="shaka::LocalFile"shape="rect"coords="146,56,282,80"/>
<areahref="../../dd/d0c/classshaka_1_1ThreadedIoFile.html"title="Declaration of class which implements a thread-safe circular buffer. "alt="shaka::ThreadedIoFile"shape="rect"coords="438,56,574,80"/>
<areahref="../../d4/dcb/classshaka_1_1UdpFile.html"title="Implements UdpFile, which receives UDP unicast and multicast streams. "alt="shaka::UdpFile"shape="rect"coords="584,56,720,80"/>
<trclass="memdesc:a68a15f623c2a1601879f291f93a1f464"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Internal open. Should not be used directly. <br/></td></tr>
<divclass="textblock"><p>Define an abstract file interface. </p>
<p>Definition at line <aclass="el"href="../../d2/d4d/file_8h_source.html#l00026">26</a> of file <aclass="el"href="../../d2/d4d/file_8h_source.html">file.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Do <em>not</em> call the destructor directly (with the "delete" keyword) nor use std::unique_ptr; instead use <aclass="el"href="../../d3/d73/classshaka_1_1File.html#a932666ed1d6a565bf387a9d8b39a8948">Close()</a>. </p>
<p>Definition at line <aclass="el"href="../../d2/d4d/file_8h_source.html#l00170">170</a> of file <aclass="el"href="../../d2/d4d/file_8h_source.html">file.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p><aclass="el"href="../../d3/d73/classshaka_1_1File.html#a5fa625751e03b9e7652ba1bfa98b8ca4">Flush()</a> and de-allocate resources associated with this file, and delete this <aclass="el"href="../../d3/d73/classshaka_1_1File.html"title="Define an abstract file interface. ">File</a> object. THIS IS THE ONE TRUE WAY TO DEALLOCATE THIS OBJECT. </p>
<dlclass="section return"><dt>Returns</dt><dd>true on success. For writable files, returning false MAY INDICATE DATA LOSS. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a61cdb937b3a996bb8b054679d98df812">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#a79292b93c39f609b5348787a39fc77b2">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#a3d881c251c19a36eaf50483971095370">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#a4cfe38684f4fdde650a2ed7fdc780f05">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#aac23ef04e5bafef7d5b4c5d7a3fcfbb5">shaka::CallbackFile</a>.</p>
<p>Copies files. This is not good for copying huge files. Although not recommended, it is safe to have source file and destination file name be the same. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">from_file_name</td><td>is the source file name. </td></tr>
<tr><tdclass="paramname">to_file_name</td><td>is the destination file name. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00281">281</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<p>Copies the contents from source to destination. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">source</td><td>The file to copy from. </td></tr>
<tr><tdclass="paramname">destination</td><td>The file to copy to. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Number of bytes written, or a value < 0 on error. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00316">316</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<p>Copies the contents from source to destination. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">source</td><td>The file to copy from. </td></tr>
<tr><tdclass="paramname">destination</td><td>The file to copy to. </td></tr>
<tr><tdclass="paramname">max_copy</td><td>The maximum number of bytes to copy; < 0 to copy to EOF. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Number of bytes written, or a value < 0 on error. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00320">320</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<tr><tdclass="paramname">file_name</td><td>contains the path of the file to be deleted. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true if successful, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00198">198</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>The file name. Note that the file type prefix has been stripped off. </dd></dl>
<p>Definition at line <aclass="el"href="../../d2/d4d/file_8h_source.html#l00094">94</a> of file <aclass="el"href="../../d2/d4d/file_8h_source.html">file.h</a>.</p>
<p>Flush the file so that recently written data will survive an application crash (but not necessarily an OS crash). For instance, in <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html"title="Implement LocalFile which deals with local storage. ">LocalFile</a> the data is flushed into the OS but not necessarily to disk. </p>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a4b5430ec1d24434f5f6d9b20692efbc2">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#a2b53b72d99aad4439781e3887492452c">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#a04b4523a7352572b2c6d72f1d6f3a077">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#aecf76d1658ea5f088ef1e42f04b9b64d">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#aef34f60f2e94f862e495c254edc58bd9">shaka::CallbackFile</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>The size of a file in bytes on success, a value < 0 otherwise. The file will be opened and closed in the process. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00207">207</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<p>Generate callback file name. NOTE: THE GENERATED NAME IS ONLY VAID WHILE <em>callback_params</em> IS VALID. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">callback_params</td><td>references <aclass="el"href="../../d9/da8/structshaka_1_1BufferCallbackParams.html"title="Buffer callback params. ">BufferCallbackParams</a>, which will be embedded in the generated callback file name. </td></tr>
<tr><tdclass="paramname">name</td><td>is the name of the buffer, which will be embedded in the generated callback file name. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00354">354</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<p>Open the specified file. This is a file factory method, it opens a proper file automatically based on prefix, e.g. "file://" for <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html"title="Implement LocalFile which deals with local storage. ">LocalFile</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">file_name</td><td>contains the name of the file to be accessed. </td></tr>
<dlclass="section return"><dt>Returns</dt><dd>A <aclass="el"href="../../d3/d73/classshaka_1_1File.html"title="Define an abstract file interface. ">File</a> pointer on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00176">176</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<p>Open the specified file in direct-access mode (no buffering). This is a file factory method, it opens a proper file automatically based on prefix, e.g. "file://" for <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html"title="Implement LocalFile which deals with local storage. ">LocalFile</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">file_name</td><td>contains the name of the file to be accessed. </td></tr>
<dlclass="section return"><dt>Returns</dt><dd>A <aclass="el"href="../../d3/d73/classshaka_1_1File.html"title="Define an abstract file interface. ">File</a> pointer on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00187">187</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<tr><tdclass="paramname">callback_file_name</td><td>is the name of the callback file which contains <em>callback_params</em> and <em>name</em>. </td></tr>
<tr><tdclass="paramname">callback_params</td><td>points to the parsed <aclass="el"href="../../d9/da8/structshaka_1_1BufferCallbackParams.html"title="Buffer callback params. ">BufferCallbackParams</a> pointer. </td></tr>
<tr><tdclass="paramname">name</td><td>points to the parsed name. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00364">364</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">buffer</td><td>points to a block of memory with a size of at least <em>length</em> bytes. </td></tr>
<tr><tdclass="paramdir"></td><tdclass="paramname">length</td><td>indicates number of bytes to be read. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Number of bytes read, or a value < 0 on error. Zero on end-of-file, or if 'length' is zero. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a74d352b51d543905abd4a12687e1bb98">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#af45702d95d4e46e93b1f4a897844212e">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#a27c3bf51fe18ebc10bf42ebcec20c9cb">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#aeacb3b7f72e0c412bd0cba8a6f1ed62f">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#a867e0c5eaf81a41902e1370deb912617">shaka::CallbackFile</a>.</p>
<tr><tdclass="paramname">file_name</td><td>is the file to be read. It should be a valid file. </td></tr>
<tr><tdclass="paramname">contents[out]</td><td>points to the output string. Should not be NULL. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00216">216</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<p>Seek to the specifield position in the file. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">position</td><td>is the position to seek to. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a33d10d2f1558a35aaba192f7746bb23f">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#a9b95550cf6342f970645c086a2ed58c2">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#a082cd6d64c8f04acff251cdafb66b203">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#a0e3bffa9859fdcb7c28c20a15e2d3e98">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#a7c9039e25fcc468a7ec2cdfa8394ffc2">shaka::CallbackFile</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Size of the file in bytes. A return value less than zero indicates a problem getting the size. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a0a1c8d7af211bba4da62eb44504d745d">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#af23f2da404e1602c240bb59d2601f1b9">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#ad20649d0ee575b81830a5abf88e2bde1">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#a151634866be009cf0eb10e783432d5cb">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#ab6bcbc6773b29fee1664507558e8759f">shaka::CallbackFile</a>.</p>
<tr><tdclass="paramname">position</td><td>is a pointer to contain the current file position upon successful return. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on succcess, false otherwise. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a4024a139655cf22f2cf2b4e56be8e1fc">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#a6ee5bcbe6bb8dd232679b2c50d968f4e">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#af111d93e10ae0128f082eef77eaa914b">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#a4dfdba703861d211e7111612f5ac029c">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#adef67a4de398b8be95bb3ae4ce770d69">shaka::CallbackFile</a>.</p>
<tr><tdclass="paramname">buffer</td><td>points to a block of memory with at least <em>length</em> bytes. </td></tr>
<tr><tdclass="paramname">length</td><td>indicates number of bytes to write. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Number of bytes written, or a value < 0 on error. </dd></dl>
<p>Implemented in <aclass="el"href="../../d4/dcb/classshaka_1_1UdpFile.html#a36722f3c436c88e451093ee21c0db754">shaka::UdpFile</a>, <aclass="el"href="../../dd/d0c/classshaka_1_1ThreadedIoFile.html#ab8acfe4af14c1120ae6d2baa44a10583">shaka::ThreadedIoFile</a>, <aclass="el"href="../../d7/dbd/classshaka_1_1LocalFile.html#aee10b7f2898c5047eb8505f16c49311c">shaka::LocalFile</a>, <aclass="el"href="../../de/dad/classshaka_1_1MemoryFile.html#aa3d9455b7bc9d1c44d58ab39bd8bd27c">shaka::MemoryFile</a>, and <aclass="el"href="../../dd/d40/classshaka_1_1CallbackFile.html#aa758dfb05daff81afa1ddfaf0bb0a105">shaka::CallbackFile</a>.</p>
<p>Save <code>contents</code> to <code>file_name</code> in an atomic manner. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">file_name</td><td>is the destination file name. </td></tr>
<tr><tdclass="paramname">contents</td><td>is the data to be saved. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00262">262</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
<tr><tdclass="paramname">file_name</td><td>is the file to write to. </td></tr>
<tr><tdclass="paramname">contents</td><td>is the data to write. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../d5/dfc/file_8cc_source.html#l00234">234</a> of file <aclass="el"href="../../d5/dfc/file_8cc_source.html">file.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>