Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

510 lines
22KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.14"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>SdFat: StreamFile&lt; BaseFile, PosType &gt; Class Template Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">SdFat
  25. </div>
  26. </td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. <!-- end header part -->
  32. <!-- Generated by Doxygen 1.8.14 -->
  33. <script type="text/javascript">
  34. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. /* @license-end */
  37. </script>
  38. <script type="text/javascript" src="menudata.js"></script>
  39. <script type="text/javascript" src="menu.js"></script>
  40. <script type="text/javascript">
  41. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  42. $(function() {
  43. initMenu('',true,false,'search.php','Search');
  44. $(document).ready(function() { init_search(); });
  45. });
  46. /* @license-end */</script>
  47. <div id="main-nav"></div>
  48. <!-- window showing the filter options -->
  49. <div id="MSearchSelectWindow"
  50. onmouseover="return searchBox.OnSearchSelectShow()"
  51. onmouseout="return searchBox.OnSearchSelectHide()"
  52. onkeydown="return searchBox.OnSearchSelectKey(event)">
  53. </div>
  54. <!-- iframe showing the search results (closed by default) -->
  55. <div id="MSearchResultsWindow">
  56. <iframe src="javascript:void(0)" frameborder="0"
  57. name="MSearchResults" id="MSearchResults">
  58. </iframe>
  59. </div>
  60. </div><!-- top -->
  61. <div class="header">
  62. <div class="summary">
  63. <a href="#pub-methods">Public Member Functions</a> &#124;
  64. <a href="class_stream_file-members.html">List of all members</a> </div>
  65. <div class="headertitle">
  66. <div class="title">StreamFile&lt; BaseFile, PosType &gt; Class Template Reference</div> </div>
  67. </div><!--header-->
  68. <div class="contents">
  69. <p><a class="el" href="class_stream_file.html" title="StreamFile class. ">StreamFile</a> class.
  70. <a href="class_stream_file.html#details">More...</a></p>
  71. <p><code>#include &lt;ArduinoFiles.h&gt;</code></p>
  72. <div class="dynheader">
  73. Inheritance diagram for StreamFile&lt; BaseFile, PosType &gt;:</div>
  74. <div class="dyncontent">
  75. <div class="center"><img src="class_stream_file__inherit__graph.png" border="0" usemap="#_stream_file_3_01_base_file_00_01_pos_type_01_4_inherit__map" alt="Inheritance graph"/></div>
  76. <map name="_stream_file_3_01_base_file_00_01_pos_type_01_4_inherit__map" id="_stream_file_3_01_base_file_00_01_pos_type_01_4_inherit__map">
  77. </map>
  78. <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
  79. <div class="dynheader">
  80. Collaboration diagram for StreamFile&lt; BaseFile, PosType &gt;:</div>
  81. <div class="dyncontent">
  82. <div class="center"><img src="class_stream_file__coll__graph.png" border="0" usemap="#_stream_file_3_01_base_file_00_01_pos_type_01_4_coll__map" alt="Collaboration graph"/></div>
  83. <map name="_stream_file_3_01_base_file_00_01_pos_type_01_4_coll__map" id="_stream_file_3_01_base_file_00_01_pos_type_01_4_coll__map">
  84. </map>
  85. <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
  86. <table class="memberdecls">
  87. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  88. Public Member Functions</h2></td></tr>
  89. <tr class="memitem:a0112cc39b64aac6f1ec47741397a7582"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a0112cc39b64aac6f1ec47741397a7582">available</a> ()</td></tr>
  90. <tr class="separator:a0112cc39b64aac6f1ec47741397a7582"><td class="memSeparator" colspan="2">&#160;</td></tr>
  91. <tr class="memitem:a32f813e659414892a58aa5157fe14f82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a32f813e659414892a58aa5157fe14f82">flush</a> ()</td></tr>
  92. <tr class="separator:a32f813e659414892a58aa5157fe14f82"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:a586ad44055eca4c1b2b457299b829d44"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a586ad44055eca4c1b2b457299b829d44">isDirectory</a> ()</td></tr>
  94. <tr class="separator:a586ad44055eca4c1b2b457299b829d44"><td class="memSeparator" colspan="2">&#160;</td></tr>
  95. <tr class="memitem:a8792c863080576eb65ce6cacbe1dd931"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a8792c863080576eb65ce6cacbe1dd931">name</a> () const</td></tr>
  96. <tr class="separator:a8792c863080576eb65ce6cacbe1dd931"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <tr class="memitem:af0da96e502485133ca0cff27fa130082"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#af0da96e502485133ca0cff27fa130082">peek</a> ()</td></tr>
  98. <tr class="separator:af0da96e502485133ca0cff27fa130082"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:a18a04d1e68a0c1e3e38e5712cd9bbc03"><td class="memItemLeft" align="right" valign="top">PosType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a18a04d1e68a0c1e3e38e5712cd9bbc03">position</a> ()</td></tr>
  100. <tr class="separator:a18a04d1e68a0c1e3e38e5712cd9bbc03"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:a249a5d428f303e2a8e7c3ae476e74829"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a249a5d428f303e2a8e7c3ae476e74829">read</a> ()</td></tr>
  102. <tr class="separator:a249a5d428f303e2a8e7c3ae476e74829"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:a91e8cfbde27d6879b4f51d2ceb2a9f06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a91e8cfbde27d6879b4f51d2ceb2a9f06">rewindDirectory</a> ()</td></tr>
  104. <tr class="separator:a91e8cfbde27d6879b4f51d2ceb2a9f06"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:a773ee6f661fc689a5187f51cb5498086"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a773ee6f661fc689a5187f51cb5498086">seek</a> (PosType pos)</td></tr>
  106. <tr class="separator:a773ee6f661fc689a5187f51cb5498086"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a5813d451e7f7ba57a04d177caffc5a9f"><td class="memItemLeft" align="right" valign="top">PosType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a5813d451e7f7ba57a04d177caffc5a9f">size</a> ()</td></tr>
  108. <tr class="separator:a5813d451e7f7ba57a04d177caffc5a9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:a0695220134825199b39dee82f18ab1ec"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a0695220134825199b39dee82f18ab1ec">write</a> (uint8_t b)</td></tr>
  110. <tr class="separator:a0695220134825199b39dee82f18ab1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:a0ace3aaaf6d0fb673a43059c0664fab6"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_stream_file.html#a0ace3aaaf6d0fb673a43059c0664fab6">write</a> (const uint8_t *buffer, size_t <a class="el" href="class_stream_file.html#a5813d451e7f7ba57a04d177caffc5a9f">size</a>)</td></tr>
  112. <tr class="separator:a0ace3aaaf6d0fb673a43059c0664fab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. </table>
  114. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  115. <div class="textblock"><h3>template&lt;class BaseFile, typename PosType&gt;<br />
  116. class StreamFile&lt; BaseFile, PosType &gt;</h3>
  117. <p><a class="el" href="class_stream_file.html" title="StreamFile class. ">StreamFile</a> class. </p>
  118. </div><h2 class="groupheader">Member Function Documentation</h2>
  119. <a id="a0112cc39b64aac6f1ec47741397a7582"></a>
  120. <h2 class="memtitle"><span class="permalink"><a href="#a0112cc39b64aac6f1ec47741397a7582">&#9670;&nbsp;</a></span>available()</h2>
  121. <div class="memitem">
  122. <div class="memproto">
  123. <div class="memtemplate">
  124. template&lt;class BaseFile, typename PosType&gt; </div>
  125. <table class="mlabels">
  126. <tr>
  127. <td class="mlabels-left">
  128. <table class="memname">
  129. <tr>
  130. <td class="memname">int <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::available </td>
  131. <td>(</td>
  132. <td class="paramname"></td><td>)</td>
  133. <td></td>
  134. </tr>
  135. </table>
  136. </td>
  137. <td class="mlabels-right">
  138. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  139. </tr>
  140. </table>
  141. </div><div class="memdoc">
  142. <dl class="section return"><dt>Returns</dt><dd>number of bytes available from the current position to EOF or INT_MAX if more than INT_MAX bytes are available. </dd></dl>
  143. </div>
  144. </div>
  145. <a id="a32f813e659414892a58aa5157fe14f82"></a>
  146. <h2 class="memtitle"><span class="permalink"><a href="#a32f813e659414892a58aa5157fe14f82">&#9670;&nbsp;</a></span>flush()</h2>
  147. <div class="memitem">
  148. <div class="memproto">
  149. <div class="memtemplate">
  150. template&lt;class BaseFile, typename PosType&gt; </div>
  151. <table class="mlabels">
  152. <tr>
  153. <td class="mlabels-left">
  154. <table class="memname">
  155. <tr>
  156. <td class="memname">void <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::flush </td>
  157. <td>(</td>
  158. <td class="paramname"></td><td>)</td>
  159. <td></td>
  160. </tr>
  161. </table>
  162. </td>
  163. <td class="mlabels-right">
  164. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  165. </tr>
  166. </table>
  167. </div><div class="memdoc">
  168. <p>Ensure that any bytes written to the file are saved to the SD card. </p>
  169. </div>
  170. </div>
  171. <a id="a586ad44055eca4c1b2b457299b829d44"></a>
  172. <h2 class="memtitle"><span class="permalink"><a href="#a586ad44055eca4c1b2b457299b829d44">&#9670;&nbsp;</a></span>isDirectory()</h2>
  173. <div class="memitem">
  174. <div class="memproto">
  175. <div class="memtemplate">
  176. template&lt;class BaseFile, typename PosType&gt; </div>
  177. <table class="mlabels">
  178. <tr>
  179. <td class="mlabels-left">
  180. <table class="memname">
  181. <tr>
  182. <td class="memname">bool <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::isDirectory </td>
  183. <td>(</td>
  184. <td class="paramname"></td><td>)</td>
  185. <td></td>
  186. </tr>
  187. </table>
  188. </td>
  189. <td class="mlabels-right">
  190. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  191. </tr>
  192. </table>
  193. </div><div class="memdoc">
  194. <p>This function reports if the current file is a directory or not. </p><dl class="section return"><dt>Returns</dt><dd>true if the file is a directory. </dd></dl>
  195. </div>
  196. </div>
  197. <a id="a8792c863080576eb65ce6cacbe1dd931"></a>
  198. <h2 class="memtitle"><span class="permalink"><a href="#a8792c863080576eb65ce6cacbe1dd931">&#9670;&nbsp;</a></span>name()</h2>
  199. <div class="memitem">
  200. <div class="memproto">
  201. <div class="memtemplate">
  202. template&lt;class BaseFile, typename PosType&gt; </div>
  203. <table class="mlabels">
  204. <tr>
  205. <td class="mlabels-left">
  206. <table class="memname">
  207. <tr>
  208. <td class="memname">const char* <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::name </td>
  209. <td>(</td>
  210. <td class="paramname"></td><td>)</td>
  211. <td> const</td>
  212. </tr>
  213. </table>
  214. </td>
  215. <td class="mlabels-right">
  216. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  217. </tr>
  218. </table>
  219. </div><div class="memdoc">
  220. <p>No longer implemented due to Long File Names.</p>
  221. <p>Use getName(char* name, size_t size). </p><dl class="section return"><dt>Returns</dt><dd>a pointer to replacement suggestion. </dd></dl>
  222. </div>
  223. </div>
  224. <a id="af0da96e502485133ca0cff27fa130082"></a>
  225. <h2 class="memtitle"><span class="permalink"><a href="#af0da96e502485133ca0cff27fa130082">&#9670;&nbsp;</a></span>peek()</h2>
  226. <div class="memitem">
  227. <div class="memproto">
  228. <div class="memtemplate">
  229. template&lt;class BaseFile, typename PosType&gt; </div>
  230. <table class="mlabels">
  231. <tr>
  232. <td class="mlabels-left">
  233. <table class="memname">
  234. <tr>
  235. <td class="memname">int <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::peek </td>
  236. <td>(</td>
  237. <td class="paramname"></td><td>)</td>
  238. <td></td>
  239. </tr>
  240. </table>
  241. </td>
  242. <td class="mlabels-right">
  243. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  244. </tr>
  245. </table>
  246. </div><div class="memdoc">
  247. <p>Return the next available byte without consuming it.</p>
  248. <dl class="section return"><dt>Returns</dt><dd>The byte if no error and not at eof else -1; </dd></dl>
  249. </div>
  250. </div>
  251. <a id="a18a04d1e68a0c1e3e38e5712cd9bbc03"></a>
  252. <h2 class="memtitle"><span class="permalink"><a href="#a18a04d1e68a0c1e3e38e5712cd9bbc03">&#9670;&nbsp;</a></span>position()</h2>
  253. <div class="memitem">
  254. <div class="memproto">
  255. <div class="memtemplate">
  256. template&lt;class BaseFile, typename PosType&gt; </div>
  257. <table class="mlabels">
  258. <tr>
  259. <td class="mlabels-left">
  260. <table class="memname">
  261. <tr>
  262. <td class="memname">PosType <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::position </td>
  263. <td>(</td>
  264. <td class="paramname"></td><td>)</td>
  265. <td></td>
  266. </tr>
  267. </table>
  268. </td>
  269. <td class="mlabels-right">
  270. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  271. </tr>
  272. </table>
  273. </div><div class="memdoc">
  274. <dl class="section return"><dt>Returns</dt><dd>the current file position. </dd></dl>
  275. </div>
  276. </div>
  277. <a id="a249a5d428f303e2a8e7c3ae476e74829"></a>
  278. <h2 class="memtitle"><span class="permalink"><a href="#a249a5d428f303e2a8e7c3ae476e74829">&#9670;&nbsp;</a></span>read()</h2>
  279. <div class="memitem">
  280. <div class="memproto">
  281. <div class="memtemplate">
  282. template&lt;class BaseFile, typename PosType&gt; </div>
  283. <table class="mlabels">
  284. <tr>
  285. <td class="mlabels-left">
  286. <table class="memname">
  287. <tr>
  288. <td class="memname">int <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::read </td>
  289. <td>(</td>
  290. <td class="paramname"></td><td>)</td>
  291. <td></td>
  292. </tr>
  293. </table>
  294. </td>
  295. <td class="mlabels-right">
  296. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  297. </tr>
  298. </table>
  299. </div><div class="memdoc">
  300. <p>Read the next byte from a file.</p>
  301. <dl class="section return"><dt>Returns</dt><dd>For success return the next byte in the file as an int. If an error occurs or end of file is reached return -1. </dd></dl>
  302. </div>
  303. </div>
  304. <a id="a91e8cfbde27d6879b4f51d2ceb2a9f06"></a>
  305. <h2 class="memtitle"><span class="permalink"><a href="#a91e8cfbde27d6879b4f51d2ceb2a9f06">&#9670;&nbsp;</a></span>rewindDirectory()</h2>
  306. <div class="memitem">
  307. <div class="memproto">
  308. <div class="memtemplate">
  309. template&lt;class BaseFile, typename PosType&gt; </div>
  310. <table class="mlabels">
  311. <tr>
  312. <td class="mlabels-left">
  313. <table class="memname">
  314. <tr>
  315. <td class="memname">void <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::rewindDirectory </td>
  316. <td>(</td>
  317. <td class="paramname"></td><td>)</td>
  318. <td></td>
  319. </tr>
  320. </table>
  321. </td>
  322. <td class="mlabels-right">
  323. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  324. </tr>
  325. </table>
  326. </div><div class="memdoc">
  327. <p>Rewind a file if it is a directory </p>
  328. </div>
  329. </div>
  330. <a id="a773ee6f661fc689a5187f51cb5498086"></a>
  331. <h2 class="memtitle"><span class="permalink"><a href="#a773ee6f661fc689a5187f51cb5498086">&#9670;&nbsp;</a></span>seek()</h2>
  332. <div class="memitem">
  333. <div class="memproto">
  334. <div class="memtemplate">
  335. template&lt;class BaseFile, typename PosType&gt; </div>
  336. <table class="mlabels">
  337. <tr>
  338. <td class="mlabels-left">
  339. <table class="memname">
  340. <tr>
  341. <td class="memname">bool <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::seek </td>
  342. <td>(</td>
  343. <td class="paramtype">PosType&#160;</td>
  344. <td class="paramname"><em>pos</em></td><td>)</td>
  345. <td></td>
  346. </tr>
  347. </table>
  348. </td>
  349. <td class="mlabels-right">
  350. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  351. </tr>
  352. </table>
  353. </div><div class="memdoc">
  354. <p>Seek to a new position in the file, which must be between 0 and the size of the file (inclusive).</p>
  355. <dl class="params"><dt>Parameters</dt><dd>
  356. <table class="params">
  357. <tr><td class="paramdir">[in]</td><td class="paramname">pos</td><td>the new file position. </td></tr>
  358. </table>
  359. </dd>
  360. </dl>
  361. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  362. </div>
  363. </div>
  364. <a id="a5813d451e7f7ba57a04d177caffc5a9f"></a>
  365. <h2 class="memtitle"><span class="permalink"><a href="#a5813d451e7f7ba57a04d177caffc5a9f">&#9670;&nbsp;</a></span>size()</h2>
  366. <div class="memitem">
  367. <div class="memproto">
  368. <div class="memtemplate">
  369. template&lt;class BaseFile, typename PosType&gt; </div>
  370. <table class="mlabels">
  371. <tr>
  372. <td class="mlabels-left">
  373. <table class="memname">
  374. <tr>
  375. <td class="memname">PosType <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::size </td>
  376. <td>(</td>
  377. <td class="paramname"></td><td>)</td>
  378. <td></td>
  379. </tr>
  380. </table>
  381. </td>
  382. <td class="mlabels-right">
  383. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  384. </tr>
  385. </table>
  386. </div><div class="memdoc">
  387. <dl class="section return"><dt>Returns</dt><dd>the file's size. </dd></dl>
  388. </div>
  389. </div>
  390. <a id="a0695220134825199b39dee82f18ab1ec"></a>
  391. <h2 class="memtitle"><span class="permalink"><a href="#a0695220134825199b39dee82f18ab1ec">&#9670;&nbsp;</a></span>write() <span class="overload">[1/2]</span></h2>
  392. <div class="memitem">
  393. <div class="memproto">
  394. <div class="memtemplate">
  395. template&lt;class BaseFile, typename PosType&gt; </div>
  396. <table class="mlabels">
  397. <tr>
  398. <td class="mlabels-left">
  399. <table class="memname">
  400. <tr>
  401. <td class="memname">size_t <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::write </td>
  402. <td>(</td>
  403. <td class="paramtype">uint8_t&#160;</td>
  404. <td class="paramname"><em>b</em></td><td>)</td>
  405. <td></td>
  406. </tr>
  407. </table>
  408. </td>
  409. <td class="mlabels-right">
  410. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  411. </tr>
  412. </table>
  413. </div><div class="memdoc">
  414. <p>Write a byte to a file. Required by the Arduino Print class. </p><dl class="params"><dt>Parameters</dt><dd>
  415. <table class="params">
  416. <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>the byte to be written. Use getWriteError to check for errors. </td></tr>
  417. </table>
  418. </dd>
  419. </dl>
  420. <dl class="section return"><dt>Returns</dt><dd>1 for success and 0 for failure. </dd></dl>
  421. </div>
  422. </div>
  423. <a id="a0ace3aaaf6d0fb673a43059c0664fab6"></a>
  424. <h2 class="memtitle"><span class="permalink"><a href="#a0ace3aaaf6d0fb673a43059c0664fab6">&#9670;&nbsp;</a></span>write() <span class="overload">[2/2]</span></h2>
  425. <div class="memitem">
  426. <div class="memproto">
  427. <div class="memtemplate">
  428. template&lt;class BaseFile, typename PosType&gt; </div>
  429. <table class="mlabels">
  430. <tr>
  431. <td class="mlabels-left">
  432. <table class="memname">
  433. <tr>
  434. <td class="memname">size_t <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::write </td>
  435. <td>(</td>
  436. <td class="paramtype">const uint8_t *&#160;</td>
  437. <td class="paramname"><em>buffer</em>, </td>
  438. </tr>
  439. <tr>
  440. <td class="paramkey"></td>
  441. <td></td>
  442. <td class="paramtype">size_t&#160;</td>
  443. <td class="paramname"><em>size</em>&#160;</td>
  444. </tr>
  445. <tr>
  446. <td></td>
  447. <td>)</td>
  448. <td></td><td></td>
  449. </tr>
  450. </table>
  451. </td>
  452. <td class="mlabels-right">
  453. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  454. </tr>
  455. </table>
  456. </div><div class="memdoc">
  457. <p>Write data to an open file.</p>
  458. <dl class="section note"><dt>Note</dt><dd>Data is moved to the cache but may not be written to the storage device until sync() is called.</dd></dl>
  459. <dl class="params"><dt>Parameters</dt><dd>
  460. <table class="params">
  461. <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Pointer to the location of the data to be written.</td></tr>
  462. <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to write.</td></tr>
  463. </table>
  464. </dd>
  465. </dl>
  466. <dl class="section return"><dt>Returns</dt><dd>For success <a class="el" href="class_stream_file.html#a0695220134825199b39dee82f18ab1ec">write()</a> returns the number of bytes written, always <em>size</em>. </dd></dl>
  467. </div>
  468. </div>
  469. <hr/>The documentation for this class was generated from the following file:<ul>
  470. <li>ArduinoSdFat/libraries/SdFat/src/common/ArduinoFiles.h</li>
  471. </ul>
  472. </div><!-- contents -->
  473. <!-- start footer part -->
  474. <hr class="footer"/><address class="footer"><small>
  475. Generated on Thu May 9 2019 06:51:29 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  476. <img class="footer" src="doxygen.png" alt="doxygen"/>
  477. </a> 1.8.14
  478. </small></address>
  479. </body>
  480. </html>