/usr/share/doc/libwreport-doc/apidocs/classwreport_1_1sys_1_1FileDescriptor.html is in libwreport-doc 3.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | <!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.11"/>
<title>libwreport: wreport::sys::FileDescriptor 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="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">libwreport
 <span id="projectnumber">3.6</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacewreport.html">wreport</a></li><li class="navelem"><b>sys</b></li><li class="navelem"><a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html">FileDescriptor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-attribs">Protected Attributes</a> </div>
<div class="headertitle">
<div class="title">wreport::sys::FileDescriptor Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Common operations on file descriptors.
<a href="classwreport_1_1sys_1_1FileDescriptor.html#details">More...</a></p>
<p><code>#include <<a class="el" href="sys_8h_source.html">sys.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for wreport::sys::FileDescriptor:</div>
<div class="dyncontent">
<div class="center">
<img src="classwreport_1_1sys_1_1FileDescriptor.png" usemap="#wreport::sys::FileDescriptor_map" alt=""/>
<map id="wreport::sys::FileDescriptor_map" name="wreport::sys::FileDescriptor_map">
<area href="classwreport_1_1sys_1_1NamedFileDescriptor.html" title="File descriptor with a name. " alt="wreport::sys::NamedFileDescriptor" shape="rect" coords="107,56,312,80"/>
<area href="classwreport_1_1sys_1_1File.html" title="open(2) file descriptors " alt="wreport::sys::File" shape="rect" coords="0,112,205,136"/>
<area href="structwreport_1_1sys_1_1Path.html" title="Wrap a path on the file system opened with O_PATH. " alt="wreport::sys::Path" shape="rect" coords="215,112,420,136"/>
</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:a790dd94a76ef01897ef6d948fb43f69a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a790dd94a76ef01897ef6d948fb43f69a"></a>
 </td><td class="memItemRight" valign="bottom"><b>FileDescriptor</b> (<a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html">FileDescriptor</a> &&o)</td></tr>
<tr class="separator:a790dd94a76ef01897ef6d948fb43f69a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a97a2b51f58ae485afed1c7b3a8d510a2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a97a2b51f58ae485afed1c7b3a8d510a2"></a>
 </td><td class="memItemRight" valign="bottom"><b>FileDescriptor</b> (int fd)</td></tr>
<tr class="separator:a97a2b51f58ae485afed1c7b3a8d510a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab627a1d50f1d421ff381d3b19a20f5ce"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab627a1d50f1d421ff381d3b19a20f5ce"></a>
 </td><td class="memItemRight" valign="bottom"><b>FileDescriptor</b> (const <a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html">FileDescriptor</a> &o)=default</td></tr>
<tr class="separator:ab627a1d50f1d421ff381d3b19a20f5ce"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f063c3bb85834c0f8961ccd3605b449"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1f063c3bb85834c0f8961ccd3605b449"></a>
<a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html">FileDescriptor</a> & </td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html">FileDescriptor</a> &o)=default</td></tr>
<tr class="separator:a1f063c3bb85834c0f8961ccd3605b449"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afde4cf86a097deb4f26e2f1d32e9009a"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html#afde4cf86a097deb4f26e2f1d32e9009a">throw_error</a> (const char *desc)</td></tr>
<tr class="memdesc:afde4cf86a097deb4f26e2f1d32e9009a"><td class="mdescLeft"> </td><td class="mdescRight">Throw an exception based on errno and the given message. <a href="#afde4cf86a097deb4f26e2f1d32e9009a">More...</a><br /></td></tr>
<tr class="separator:afde4cf86a097deb4f26e2f1d32e9009a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeda4f3e76fca73c820543ec5507ce72a"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html#aeda4f3e76fca73c820543ec5507ce72a">throw_runtime_error</a> (const char *desc)</td></tr>
<tr class="memdesc:aeda4f3e76fca73c820543ec5507ce72a"><td class="mdescLeft"> </td><td class="mdescRight">Throw a runtime_error unrelated from errno. <a href="#aeda4f3e76fca73c820543ec5507ce72a">More...</a><br /></td></tr>
<tr class="separator:aeda4f3e76fca73c820543ec5507ce72a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac96bc5781c73b971cf64b875bce5d31b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac96bc5781c73b971cf64b875bce5d31b"></a>
void </td><td class="memItemRight" valign="bottom"><b>close</b> ()</td></tr>
<tr class="separator:ac96bc5781c73b971cf64b875bce5d31b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab4d102c993e7f98bd1585e5e14cd4221"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab4d102c993e7f98bd1585e5e14cd4221"></a>
void </td><td class="memItemRight" valign="bottom"><b>fstat</b> (struct stat &st)</td></tr>
<tr class="separator:ab4d102c993e7f98bd1585e5e14cd4221"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a54e55cd9fa325852ffdbf0006ae6d044"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54e55cd9fa325852ffdbf0006ae6d044"></a>
void </td><td class="memItemRight" valign="bottom"><b>fchmod</b> (mode_t mode)</td></tr>
<tr class="separator:a54e55cd9fa325852ffdbf0006ae6d044"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7a24568bc84cc4fd3b06080152fdcaf8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7a24568bc84cc4fd3b06080152fdcaf8"></a>
int </td><td class="memItemRight" valign="bottom"><b>dup</b> ()</td></tr>
<tr class="separator:a7a24568bc84cc4fd3b06080152fdcaf8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8c526f893fae5481189a87ca1817032a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c526f893fae5481189a87ca1817032a"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>read</b> (void *buf, size_t count)</td></tr>
<tr class="separator:a8c526f893fae5481189a87ca1817032a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad25f1cf7b87dd32ad861109c2eb6af0b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad25f1cf7b87dd32ad861109c2eb6af0b"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html#ad25f1cf7b87dd32ad861109c2eb6af0b">read_all_or_throw</a> (void *buf, size_t count)</td></tr>
<tr class="memdesc:ad25f1cf7b87dd32ad861109c2eb6af0b"><td class="mdescLeft"> </td><td class="mdescRight">Read all the data into buf, throwing runtime_error in case of a partial read. <br /></td></tr>
<tr class="separator:ad25f1cf7b87dd32ad861109c2eb6af0b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a28d025abf1fd5fa532b418dca5fb0675"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a28d025abf1fd5fa532b418dca5fb0675"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>write</b> (const void *buf, size_t count)</td></tr>
<tr class="separator:a28d025abf1fd5fa532b418dca5fb0675"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7301fc74adf7bf403555d5dc092333d8"><td class="memTemplParams" colspan="2"><a class="anchor" id="a7301fc74adf7bf403555d5dc092333d8"></a>
template<typename Container > </td></tr>
<tr class="memitem:a7301fc74adf7bf403555d5dc092333d8"><td class="memTemplItemLeft" align="right" valign="top">size_t </td><td class="memTemplItemRight" valign="bottom"><b>write</b> (const Container &c)</td></tr>
<tr class="separator:a7301fc74adf7bf403555d5dc092333d8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a353886ff759002fc73a807a61e550b1c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a353886ff759002fc73a807a61e550b1c"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html#a353886ff759002fc73a807a61e550b1c">write_all_or_retry</a> (const void *buf, size_t count)</td></tr>
<tr class="memdesc:a353886ff759002fc73a807a61e550b1c"><td class="mdescLeft"> </td><td class="mdescRight">Write all the data in buf, retrying partial writes. <br /></td></tr>
<tr class="separator:a353886ff759002fc73a807a61e550b1c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9b8bbe01bd31cb68d9153ece0ce5866d"><td class="memTemplParams" colspan="2"><a class="anchor" id="a9b8bbe01bd31cb68d9153ece0ce5866d"></a>
template<typename Container > </td></tr>
<tr class="memitem:a9b8bbe01bd31cb68d9153ece0ce5866d"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><b>write_all_or_retry</b> (const Container &c)</td></tr>
<tr class="separator:a9b8bbe01bd31cb68d9153ece0ce5866d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab794bc5fc0cd05ba9f98f408841b337c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab794bc5fc0cd05ba9f98f408841b337c"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html#ab794bc5fc0cd05ba9f98f408841b337c">write_all_or_throw</a> (const void *buf, size_t count)</td></tr>
<tr class="memdesc:ab794bc5fc0cd05ba9f98f408841b337c"><td class="mdescLeft"> </td><td class="mdescRight">Write all the data in buf, throwing runtime_error in case of a partial write. <br /></td></tr>
<tr class="separator:ab794bc5fc0cd05ba9f98f408841b337c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6ef85c018873737c818c7c0456ec3ac3"><td class="memTemplParams" colspan="2"><a class="anchor" id="a6ef85c018873737c818c7c0456ec3ac3"></a>
template<typename Container > </td></tr>
<tr class="memitem:a6ef85c018873737c818c7c0456ec3ac3"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><b>write_all_or_throw</b> (const Container &c)</td></tr>
<tr class="separator:a6ef85c018873737c818c7c0456ec3ac3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1efd7e213916bf429b3b9afd9b6a5500"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1efd7e213916bf429b3b9afd9b6a5500"></a>
off_t </td><td class="memItemRight" valign="bottom"><b>lseek</b> (off_t offset, int whence=SEEK_SET)</td></tr>
<tr class="separator:a1efd7e213916bf429b3b9afd9b6a5500"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8cc168cb94994fb6c209040c1bcf3afb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8cc168cb94994fb6c209040c1bcf3afb"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>pread</b> (void *buf, size_t count, off_t offset)</td></tr>
<tr class="separator:a8cc168cb94994fb6c209040c1bcf3afb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0af4dc7566ff7911303b4f83c9c61bb8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0af4dc7566ff7911303b4f83c9c61bb8"></a>
size_t </td><td class="memItemRight" valign="bottom"><b>pwrite</b> (const void *buf, size_t count, off_t offset)</td></tr>
<tr class="separator:a0af4dc7566ff7911303b4f83c9c61bb8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7995b586f3842c7a366f56ffcd4a725f"><td class="memTemplParams" colspan="2"><a class="anchor" id="a7995b586f3842c7a366f56ffcd4a725f"></a>
template<typename Container > </td></tr>
<tr class="memitem:a7995b586f3842c7a366f56ffcd4a725f"><td class="memTemplItemLeft" align="right" valign="top">size_t </td><td class="memTemplItemRight" valign="bottom"><b>pwrite</b> (const Container &c, off_t offset)</td></tr>
<tr class="separator:a7995b586f3842c7a366f56ffcd4a725f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9181e0f6db1aac86e7686bfb3f46e4bf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9181e0f6db1aac86e7686bfb3f46e4bf"></a>
void </td><td class="memItemRight" valign="bottom"><b>ftruncate</b> (off_t length)</td></tr>
<tr class="separator:a9181e0f6db1aac86e7686bfb3f46e4bf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a053fee1d0648ca2fde64bd15e2dd36f6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a053fee1d0648ca2fde64bd15e2dd36f6"></a>
<a class="el" href="classwreport_1_1sys_1_1MMap.html">MMap</a> </td><td class="memItemRight" valign="bottom"><b>mmap</b> (size_t length, int prot, int flags, off_t offset=0)</td></tr>
<tr class="separator:a053fee1d0648ca2fde64bd15e2dd36f6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa22ab0ebe5109be93f8e8c720e1c581c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa22ab0ebe5109be93f8e8c720e1c581c"></a>
 </td><td class="memItemRight" valign="bottom"><b>operator int</b> () const </td></tr>
<tr class="separator:aa22ab0ebe5109be93f8e8c720e1c581c"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:adbdd8b349209226f76655137329474f1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adbdd8b349209226f76655137329474f1"></a>
int </td><td class="memItemRight" valign="bottom"><b>fd</b> = -1</td></tr>
<tr class="separator:adbdd8b349209226f76655137329474f1"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Common operations on file descriptors. </p>
<p>Except when documented otherwise, methods of this class are just thin wrappers around the libc functions with the same name, that check error results and throw exceptions if the functions failed.</p>
<p>Implementing what to do on construction and destruction is left to the subclassers: at the <a class="el" href="classwreport_1_1sys_1_1FileDescriptor.html" title="Common operations on file descriptors. ">FileDescriptor</a> level, the destructor does nothing and leaves the file descriptor open. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="afde4cf86a097deb4f26e2f1d32e9009a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void wreport::sys::FileDescriptor::throw_error </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>desc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Throw an exception based on errno and the given message. </p>
<p>This can be overridden by subclasses that may have more information about the file descriptor, so that they can generate more descriptive messages. </p>
<p>Reimplemented in <a class="el" href="classwreport_1_1sys_1_1NamedFileDescriptor.html#af48d4a2762cc96028790d49ec1942f84">wreport::sys::NamedFileDescriptor</a>.</p>
</div>
</div>
<a class="anchor" id="aeda4f3e76fca73c820543ec5507ce72a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void wreport::sys::FileDescriptor::throw_runtime_error </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>desc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Throw a runtime_error unrelated from errno. </p>
<p>This can be overridden by subclasses that may have more information about the file descriptor, so that they can generate more descriptive messages. </p>
<p>Reimplemented in <a class="el" href="classwreport_1_1sys_1_1NamedFileDescriptor.html#a997b6bb787ece80d723752fbf7adfc9e">wreport::sys::NamedFileDescriptor</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="sys_8h_source.html">sys.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Aug 18 2016 13:32:18 for libwreport by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
|