<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.12"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crashpad: crashpad::WeakStdioFileReader Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crashpad </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.12 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1WeakStdioFileReader.html">WeakStdioFileReader</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classcrashpad_1_1WeakStdioFileReader-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">crashpad::WeakStdioFileReader Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A file reader backed by a standard input/output <code>FILE*</code>. <a href="classcrashpad_1_1WeakStdioFileReader.html#details">More...</a></p> <p><code>#include "util/file/file_reader.h"</code></p> <div class="dynheader"> Inheritance diagram for crashpad::WeakStdioFileReader:</div> <div class="dyncontent"> <div class="center"> <img src="classcrashpad_1_1WeakStdioFileReader.png" usemap="#crashpad::WeakStdioFileReader_map" alt=""/> <map id="crashpad::WeakStdioFileReader_map" name="crashpad::WeakStdioFileReader_map"> <area href="classcrashpad_1_1FileReaderInterface.html" title="An interface to read to files and other file-like objects with semantics matching the underlying plat..." alt="crashpad::FileReaderInterface" shape="rect" coords="0,56,192,80"/> <area href="classcrashpad_1_1FileSeekerInterface.html" title="An interface to seek in files and other file-like objects with semantics matching the underlying plat..." alt="crashpad::FileSeekerInterface" shape="rect" coords="0,0,192,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a12380a9e99a3b3461c6f271a64c11db0"><td class="memItemLeft" align="right" valign="top"><a id="a12380a9e99a3b3461c6f271a64c11db0"></a>  </td><td class="memItemRight" valign="bottom"><b>WeakStdioFileReader</b> (FILE *file)</td></tr> <tr class="separator:a12380a9e99a3b3461c6f271a64c11db0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adcedaed4a1465abddb7ac3c1f3643ff8"><td class="memItemLeft" align="right" valign="top">FileOperationResult </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1WeakStdioFileReader.html#adcedaed4a1465abddb7ac3c1f3643ff8">Read</a> (void *data, size_t size) override</td></tr> <tr class="memdesc:adcedaed4a1465abddb7ac3c1f3643ff8"><td class="mdescLeft"> </td><td class="mdescRight">Wraps <a class="el" href="namespacecrashpad.html#a8599600814a17d622766decd5f122a96" title="Reads from a file, retrying when interrupted on POSIX or following a short read. ">ReadFile()</a>, or provides an implementation with identical semantics. <a href="#adcedaed4a1465abddb7ac3c1f3643ff8">More...</a><br /></td></tr> <tr class="separator:adcedaed4a1465abddb7ac3c1f3643ff8"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aadfb883a076615e7f6c2b4e4f29ce3a5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacecrashpad.html#a1e53a1957d9edcba8b406ea632b6daf2">FileOffset</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1WeakStdioFileReader.html#aadfb883a076615e7f6c2b4e4f29ce3a5">Seek</a> (<a class="el" href="namespacecrashpad.html#a1e53a1957d9edcba8b406ea632b6daf2">FileOffset</a> offset, int whence) override</td></tr> <tr class="memdesc:aadfb883a076615e7f6c2b4e4f29ce3a5"><td class="mdescLeft"> </td><td class="mdescRight">Wraps <a class="el" href="namespacecrashpad.html#a3d6cedc10e24145d4a0c1000c33f8a10" title="Wraps lseek() or SetFilePointerEx(). Logs an error if the operation fails. ">LoggingSeekFile()</a> or provides an alternate implementation with identical semantics. <a href="#aadfb883a076615e7f6c2b4e4f29ce3a5">More...</a><br /></td></tr> <tr class="separator:aadfb883a076615e7f6c2b4e4f29ce3a5"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_classcrashpad_1_1FileReaderInterface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcrashpad_1_1FileReaderInterface')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classcrashpad_1_1FileReaderInterface.html">crashpad::FileReaderInterface</a></td></tr> <tr class="memitem:ad046f1ebf1071eb6b92a2a8d06c14a56 inherit pub_methods_classcrashpad_1_1FileReaderInterface"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1FileReaderInterface.html#ad046f1ebf1071eb6b92a2a8d06c14a56">ReadExactly</a> (void *data, size_t size)</td></tr> <tr class="memdesc:ad046f1ebf1071eb6b92a2a8d06c14a56 inherit pub_methods_classcrashpad_1_1FileReaderInterface"><td class="mdescLeft"> </td><td class="mdescRight">Wraps <a class="el" href="classcrashpad_1_1FileReaderInterface.html#ad9035ff345274f33cef248712d53d9e1" title="Wraps ReadFile(), or provides an implementation with identical semantics. ">Read()</a>, ensuring that the read succeeded and exactly <em>size</em> bytes were read. <a href="classcrashpad_1_1FileReaderInterface.html#ad046f1ebf1071eb6b92a2a8d06c14a56">More...</a><br /></td></tr> <tr class="separator:ad046f1ebf1071eb6b92a2a8d06c14a56 inherit pub_methods_classcrashpad_1_1FileReaderInterface"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_classcrashpad_1_1FileSeekerInterface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcrashpad_1_1FileSeekerInterface')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classcrashpad_1_1FileSeekerInterface.html">crashpad::FileSeekerInterface</a></td></tr> <tr class="memitem:a49a884bfb0a61461b0291c975aa15382 inherit pub_methods_classcrashpad_1_1FileSeekerInterface"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacecrashpad.html#a1e53a1957d9edcba8b406ea632b6daf2">FileOffset</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1FileSeekerInterface.html#a49a884bfb0a61461b0291c975aa15382">SeekGet</a> ()</td></tr> <tr class="memdesc:a49a884bfb0a61461b0291c975aa15382 inherit pub_methods_classcrashpad_1_1FileSeekerInterface"><td class="mdescLeft"> </td><td class="mdescRight">Wraps <a class="el" href="classcrashpad_1_1FileSeekerInterface.html#a8d56f7d12dfcce3e4a39ad1524302aa1" title="Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics. ">Seek()</a>, using <code>SEEK_CUR</code> to obtain the file’s current position. <a href="classcrashpad_1_1FileSeekerInterface.html#a49a884bfb0a61461b0291c975aa15382">More...</a><br /></td></tr> <tr class="separator:a49a884bfb0a61461b0291c975aa15382 inherit pub_methods_classcrashpad_1_1FileSeekerInterface"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:add2e1ee642d94c91ef722911e9aee250 inherit pub_methods_classcrashpad_1_1FileSeekerInterface"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1FileSeekerInterface.html#add2e1ee642d94c91ef722911e9aee250">SeekSet</a> (<a class="el" href="namespacecrashpad.html#a1e53a1957d9edcba8b406ea632b6daf2">FileOffset</a> offset)</td></tr> <tr class="memdesc:add2e1ee642d94c91ef722911e9aee250 inherit pub_methods_classcrashpad_1_1FileSeekerInterface"><td class="mdescLeft"> </td><td class="mdescRight">Wraps <a class="el" href="classcrashpad_1_1FileSeekerInterface.html#a8d56f7d12dfcce3e4a39ad1524302aa1" title="Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics. ">Seek()</a>, using <code>SEEK_SET</code>, ensuring that the seek succeeded and the file is positioned as desired. <a href="classcrashpad_1_1FileSeekerInterface.html#add2e1ee642d94c91ef722911e9aee250">More...</a><br /></td></tr> <tr class="separator:add2e1ee642d94c91ef722911e9aee250 inherit pub_methods_classcrashpad_1_1FileSeekerInterface"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A file reader backed by a standard input/output <code>FILE*</code>. </p> <p>This class accepts an already-open <code>FILE*</code>. It is not responsible for opening or closing this <code>FILE*</code>. Users of this class must ensure that the <code>FILE*</code> is closed appropriately elsewhere. Objects of this class may be used to read from <code>FILE*</code> objects not associated with filesystem-based files, although special attention should be paid to the <a class="el" href="classcrashpad_1_1WeakStdioFileReader.html#aadfb883a076615e7f6c2b4e4f29ce3a5" title="Wraps LoggingSeekFile() or provides an alternate implementation with identical semantics. ">Seek()</a> method, which may not function on <code>FILE*</code> objects that do not refer to disk-based files.</p> <p>This class is expected to be used when other code is responsible for opening <code>FILE*</code> objects and already provides <code>FILE*</code> objects. A good use would be a <a class="el" href="classcrashpad_1_1WeakStdioFileReader.html" title="A file reader backed by a standard input/output FILE*. ">WeakStdioFileReader</a> for <code>stdin</code>. </p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="adcedaed4a1465abddb7ac3c1f3643ff8"></a> <h2 class="memtitle"><span class="permalink"><a href="#adcedaed4a1465abddb7ac3c1f3643ff8">§ </a></span>Read()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">FileOperationResult crashpad::WeakStdioFileReader::Read </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wraps <a class="el" href="namespacecrashpad.html#a8599600814a17d622766decd5f122a96" title="Reads from a file, retrying when interrupted on POSIX or following a short read. ">ReadFile()</a>, or provides an implementation with identical semantics. </p> <dl class="section return"><dt>Returns</dt><dd>The number of bytes actually read if the operation succeeded, which may be <code>0</code> or any positive value less than or equal to <em>size</em>. <code>-1</code> if the operation failed, with an error message logged. </dd></dl> <p>Implements <a class="el" href="classcrashpad_1_1FileReaderInterface.html#ad9035ff345274f33cef248712d53d9e1">crashpad::FileReaderInterface</a>.</p> </div> </div> <a id="aadfb883a076615e7f6c2b4e4f29ce3a5"></a> <h2 class="memtitle"><span class="permalink"><a href="#aadfb883a076615e7f6c2b4e4f29ce3a5">§ </a></span>Seek()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespacecrashpad.html#a1e53a1957d9edcba8b406ea632b6daf2">FileOffset</a> crashpad::WeakStdioFileReader::Seek </td> <td>(</td> <td class="paramtype"><a class="el" href="namespacecrashpad.html#a1e53a1957d9edcba8b406ea632b6daf2">FileOffset</a> </td> <td class="paramname"><em>offset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>whence</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wraps <a class="el" href="namespacecrashpad.html#a3d6cedc10e24145d4a0c1000c33f8a10" title="Wraps lseek() or SetFilePointerEx(). Logs an error if the operation fails. ">LoggingSeekFile()</a> or provides an alternate implementation with identical semantics. </p> <dl class="section return"><dt>Returns</dt><dd>The return value of <a class="el" href="namespacecrashpad.html#a3d6cedc10e24145d4a0c1000c33f8a10" title="Wraps lseek() or SetFilePointerEx(). Logs an error if the operation fails. ">LoggingSeekFile()</a>. <code>-1</code> on failure, with an error message logged.</dd></dl> <dl class="section note"><dt>Note</dt><dd>This method is only guaranteed to function on <code>FILE*</code> objects referring to disk-based files. </dd></dl> <p>Implements <a class="el" href="classcrashpad_1_1FileSeekerInterface.html#a8d56f7d12dfcce3e4a39ad1524302aa1">crashpad::FileSeekerInterface</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>util/file/file_reader.h</li> <li>util/file/file_reader.cc</li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.12 </small></address> </body> </html>