您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

516 行
23KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.16"/>
  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.16 -->
  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. <area shape="rect" title="StreamFile class." alt="" coords="14,80,166,121"/>
  78. <area shape="rect" title=" " alt="" coords="5,5,79,32"/>
  79. <area shape="rect" title=" " alt="" coords="103,5,176,32"/>
  80. </map>
  81. <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
  82. <div class="dynheader">
  83. Collaboration diagram for StreamFile&lt; BaseFile, PosType &gt;:</div>
  84. <div class="dyncontent">
  85. <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>
  86. <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">
  87. <area shape="rect" title="StreamFile class." alt="" coords="14,80,166,121"/>
  88. <area shape="rect" title=" " alt="" coords="5,5,79,32"/>
  89. <area shape="rect" title=" " alt="" coords="103,5,176,32"/>
  90. </map>
  91. <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
  92. <table class="memberdecls">
  93. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  94. Public Member Functions</h2></td></tr>
  95. <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>
  96. <tr class="separator:a0112cc39b64aac6f1ec47741397a7582"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <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>
  98. <tr class="separator:a32f813e659414892a58aa5157fe14f82"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <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>
  100. <tr class="separator:a586ad44055eca4c1b2b457299b829d44"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <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>
  102. <tr class="separator:a8792c863080576eb65ce6cacbe1dd931"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <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>
  104. <tr class="separator:af0da96e502485133ca0cff27fa130082"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <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>
  106. <tr class="separator:a18a04d1e68a0c1e3e38e5712cd9bbc03"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <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>
  108. <tr class="separator:a249a5d428f303e2a8e7c3ae476e74829"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <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>
  110. <tr class="separator:a91e8cfbde27d6879b4f51d2ceb2a9f06"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <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>
  112. <tr class="separator:a773ee6f661fc689a5187f51cb5498086"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <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>
  114. <tr class="separator:a5813d451e7f7ba57a04d177caffc5a9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <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>
  116. <tr class="separator:a0ace3aaaf6d0fb673a43059c0664fab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <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>
  118. <tr class="separator:a0695220134825199b39dee82f18ab1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. </table>
  120. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  121. <div class="textblock"><h3>template&lt;class BaseFile, typename PosType&gt;<br />
  122. class StreamFile&lt; BaseFile, PosType &gt;</h3>
  123. <p><a class="el" href="class_stream_file.html" title="StreamFile class.">StreamFile</a> class. </p>
  124. </div><h2 class="groupheader">Member Function Documentation</h2>
  125. <a id="a0112cc39b64aac6f1ec47741397a7582"></a>
  126. <h2 class="memtitle"><span class="permalink"><a href="#a0112cc39b64aac6f1ec47741397a7582">&#9670;&nbsp;</a></span>available()</h2>
  127. <div class="memitem">
  128. <div class="memproto">
  129. <div class="memtemplate">
  130. template&lt;class BaseFile, typename PosType&gt; </div>
  131. <table class="mlabels">
  132. <tr>
  133. <td class="mlabels-left">
  134. <table class="memname">
  135. <tr>
  136. <td class="memname">int <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::available </td>
  137. <td>(</td>
  138. <td class="paramname"></td><td>)</td>
  139. <td></td>
  140. </tr>
  141. </table>
  142. </td>
  143. <td class="mlabels-right">
  144. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  145. </tr>
  146. </table>
  147. </div><div class="memdoc">
  148. <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>
  149. </div>
  150. </div>
  151. <a id="a32f813e659414892a58aa5157fe14f82"></a>
  152. <h2 class="memtitle"><span class="permalink"><a href="#a32f813e659414892a58aa5157fe14f82">&#9670;&nbsp;</a></span>flush()</h2>
  153. <div class="memitem">
  154. <div class="memproto">
  155. <div class="memtemplate">
  156. template&lt;class BaseFile, typename PosType&gt; </div>
  157. <table class="mlabels">
  158. <tr>
  159. <td class="mlabels-left">
  160. <table class="memname">
  161. <tr>
  162. <td class="memname">void <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::flush </td>
  163. <td>(</td>
  164. <td class="paramname"></td><td>)</td>
  165. <td></td>
  166. </tr>
  167. </table>
  168. </td>
  169. <td class="mlabels-right">
  170. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  171. </tr>
  172. </table>
  173. </div><div class="memdoc">
  174. <p>Ensure that any bytes written to the file are saved to the SD card. </p>
  175. </div>
  176. </div>
  177. <a id="a586ad44055eca4c1b2b457299b829d44"></a>
  178. <h2 class="memtitle"><span class="permalink"><a href="#a586ad44055eca4c1b2b457299b829d44">&#9670;&nbsp;</a></span>isDirectory()</h2>
  179. <div class="memitem">
  180. <div class="memproto">
  181. <div class="memtemplate">
  182. template&lt;class BaseFile, typename PosType&gt; </div>
  183. <table class="mlabels">
  184. <tr>
  185. <td class="mlabels-left">
  186. <table class="memname">
  187. <tr>
  188. <td class="memname">bool <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::isDirectory </td>
  189. <td>(</td>
  190. <td class="paramname"></td><td>)</td>
  191. <td></td>
  192. </tr>
  193. </table>
  194. </td>
  195. <td class="mlabels-right">
  196. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  197. </tr>
  198. </table>
  199. </div><div class="memdoc">
  200. <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>
  201. </div>
  202. </div>
  203. <a id="a8792c863080576eb65ce6cacbe1dd931"></a>
  204. <h2 class="memtitle"><span class="permalink"><a href="#a8792c863080576eb65ce6cacbe1dd931">&#9670;&nbsp;</a></span>name()</h2>
  205. <div class="memitem">
  206. <div class="memproto">
  207. <div class="memtemplate">
  208. template&lt;class BaseFile, typename PosType&gt; </div>
  209. <table class="mlabels">
  210. <tr>
  211. <td class="mlabels-left">
  212. <table class="memname">
  213. <tr>
  214. <td class="memname">const char* <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::name </td>
  215. <td>(</td>
  216. <td class="paramname"></td><td>)</td>
  217. <td> const</td>
  218. </tr>
  219. </table>
  220. </td>
  221. <td class="mlabels-right">
  222. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  223. </tr>
  224. </table>
  225. </div><div class="memdoc">
  226. <p>No longer implemented due to Long File Names.</p>
  227. <p>Use getName(char* name, size_t size). </p><dl class="section return"><dt>Returns</dt><dd>a pointer to replacement suggestion. </dd></dl>
  228. </div>
  229. </div>
  230. <a id="af0da96e502485133ca0cff27fa130082"></a>
  231. <h2 class="memtitle"><span class="permalink"><a href="#af0da96e502485133ca0cff27fa130082">&#9670;&nbsp;</a></span>peek()</h2>
  232. <div class="memitem">
  233. <div class="memproto">
  234. <div class="memtemplate">
  235. template&lt;class BaseFile, typename PosType&gt; </div>
  236. <table class="mlabels">
  237. <tr>
  238. <td class="mlabels-left">
  239. <table class="memname">
  240. <tr>
  241. <td class="memname">int <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::peek </td>
  242. <td>(</td>
  243. <td class="paramname"></td><td>)</td>
  244. <td></td>
  245. </tr>
  246. </table>
  247. </td>
  248. <td class="mlabels-right">
  249. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  250. </tr>
  251. </table>
  252. </div><div class="memdoc">
  253. <p>Return the next available byte without consuming it.</p>
  254. <dl class="section return"><dt>Returns</dt><dd>The byte if no error and not at eof else -1; </dd></dl>
  255. </div>
  256. </div>
  257. <a id="a18a04d1e68a0c1e3e38e5712cd9bbc03"></a>
  258. <h2 class="memtitle"><span class="permalink"><a href="#a18a04d1e68a0c1e3e38e5712cd9bbc03">&#9670;&nbsp;</a></span>position()</h2>
  259. <div class="memitem">
  260. <div class="memproto">
  261. <div class="memtemplate">
  262. template&lt;class BaseFile, typename PosType&gt; </div>
  263. <table class="mlabels">
  264. <tr>
  265. <td class="mlabels-left">
  266. <table class="memname">
  267. <tr>
  268. <td class="memname">PosType <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::position </td>
  269. <td>(</td>
  270. <td class="paramname"></td><td>)</td>
  271. <td></td>
  272. </tr>
  273. </table>
  274. </td>
  275. <td class="mlabels-right">
  276. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  277. </tr>
  278. </table>
  279. </div><div class="memdoc">
  280. <dl class="section return"><dt>Returns</dt><dd>the current file position. </dd></dl>
  281. </div>
  282. </div>
  283. <a id="a249a5d428f303e2a8e7c3ae476e74829"></a>
  284. <h2 class="memtitle"><span class="permalink"><a href="#a249a5d428f303e2a8e7c3ae476e74829">&#9670;&nbsp;</a></span>read()</h2>
  285. <div class="memitem">
  286. <div class="memproto">
  287. <div class="memtemplate">
  288. template&lt;class BaseFile, typename PosType&gt; </div>
  289. <table class="mlabels">
  290. <tr>
  291. <td class="mlabels-left">
  292. <table class="memname">
  293. <tr>
  294. <td class="memname">int <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::read </td>
  295. <td>(</td>
  296. <td class="paramname"></td><td>)</td>
  297. <td></td>
  298. </tr>
  299. </table>
  300. </td>
  301. <td class="mlabels-right">
  302. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  303. </tr>
  304. </table>
  305. </div><div class="memdoc">
  306. <p>Read the next byte from a file.</p>
  307. <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>
  308. </div>
  309. </div>
  310. <a id="a91e8cfbde27d6879b4f51d2ceb2a9f06"></a>
  311. <h2 class="memtitle"><span class="permalink"><a href="#a91e8cfbde27d6879b4f51d2ceb2a9f06">&#9670;&nbsp;</a></span>rewindDirectory()</h2>
  312. <div class="memitem">
  313. <div class="memproto">
  314. <div class="memtemplate">
  315. template&lt;class BaseFile, typename PosType&gt; </div>
  316. <table class="mlabels">
  317. <tr>
  318. <td class="mlabels-left">
  319. <table class="memname">
  320. <tr>
  321. <td class="memname">void <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::rewindDirectory </td>
  322. <td>(</td>
  323. <td class="paramname"></td><td>)</td>
  324. <td></td>
  325. </tr>
  326. </table>
  327. </td>
  328. <td class="mlabels-right">
  329. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  330. </tr>
  331. </table>
  332. </div><div class="memdoc">
  333. <p>Rewind a file if it is a directory </p>
  334. </div>
  335. </div>
  336. <a id="a773ee6f661fc689a5187f51cb5498086"></a>
  337. <h2 class="memtitle"><span class="permalink"><a href="#a773ee6f661fc689a5187f51cb5498086">&#9670;&nbsp;</a></span>seek()</h2>
  338. <div class="memitem">
  339. <div class="memproto">
  340. <div class="memtemplate">
  341. template&lt;class BaseFile, typename PosType&gt; </div>
  342. <table class="mlabels">
  343. <tr>
  344. <td class="mlabels-left">
  345. <table class="memname">
  346. <tr>
  347. <td class="memname">bool <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::seek </td>
  348. <td>(</td>
  349. <td class="paramtype">PosType&#160;</td>
  350. <td class="paramname"><em>pos</em></td><td>)</td>
  351. <td></td>
  352. </tr>
  353. </table>
  354. </td>
  355. <td class="mlabels-right">
  356. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  357. </tr>
  358. </table>
  359. </div><div class="memdoc">
  360. <p>Seek to a new position in the file, which must be between 0 and the size of the file (inclusive).</p>
  361. <dl class="params"><dt>Parameters</dt><dd>
  362. <table class="params">
  363. <tr><td class="paramdir">[in]</td><td class="paramname">pos</td><td>the new file position. </td></tr>
  364. </table>
  365. </dd>
  366. </dl>
  367. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  368. </div>
  369. </div>
  370. <a id="a5813d451e7f7ba57a04d177caffc5a9f"></a>
  371. <h2 class="memtitle"><span class="permalink"><a href="#a5813d451e7f7ba57a04d177caffc5a9f">&#9670;&nbsp;</a></span>size()</h2>
  372. <div class="memitem">
  373. <div class="memproto">
  374. <div class="memtemplate">
  375. template&lt;class BaseFile, typename PosType&gt; </div>
  376. <table class="mlabels">
  377. <tr>
  378. <td class="mlabels-left">
  379. <table class="memname">
  380. <tr>
  381. <td class="memname">PosType <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::size </td>
  382. <td>(</td>
  383. <td class="paramname"></td><td>)</td>
  384. <td></td>
  385. </tr>
  386. </table>
  387. </td>
  388. <td class="mlabels-right">
  389. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  390. </tr>
  391. </table>
  392. </div><div class="memdoc">
  393. <dl class="section return"><dt>Returns</dt><dd>the file's size. </dd></dl>
  394. </div>
  395. </div>
  396. <a id="a0ace3aaaf6d0fb673a43059c0664fab6"></a>
  397. <h2 class="memtitle"><span class="permalink"><a href="#a0ace3aaaf6d0fb673a43059c0664fab6">&#9670;&nbsp;</a></span>write() <span class="overload">[1/2]</span></h2>
  398. <div class="memitem">
  399. <div class="memproto">
  400. <div class="memtemplate">
  401. template&lt;class BaseFile, typename PosType&gt; </div>
  402. <table class="mlabels">
  403. <tr>
  404. <td class="mlabels-left">
  405. <table class="memname">
  406. <tr>
  407. <td class="memname">size_t <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::write </td>
  408. <td>(</td>
  409. <td class="paramtype">const uint8_t *&#160;</td>
  410. <td class="paramname"><em>buffer</em>, </td>
  411. </tr>
  412. <tr>
  413. <td class="paramkey"></td>
  414. <td></td>
  415. <td class="paramtype">size_t&#160;</td>
  416. <td class="paramname"><em>size</em>&#160;</td>
  417. </tr>
  418. <tr>
  419. <td></td>
  420. <td>)</td>
  421. <td></td><td></td>
  422. </tr>
  423. </table>
  424. </td>
  425. <td class="mlabels-right">
  426. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  427. </tr>
  428. </table>
  429. </div><div class="memdoc">
  430. <p>Write data to an open file.</p>
  431. <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>
  432. <dl class="params"><dt>Parameters</dt><dd>
  433. <table class="params">
  434. <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Pointer to the location of the data to be written.</td></tr>
  435. <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to write.</td></tr>
  436. </table>
  437. </dd>
  438. </dl>
  439. <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>
  440. </div>
  441. </div>
  442. <a id="a0695220134825199b39dee82f18ab1ec"></a>
  443. <h2 class="memtitle"><span class="permalink"><a href="#a0695220134825199b39dee82f18ab1ec">&#9670;&nbsp;</a></span>write() <span class="overload">[2/2]</span></h2>
  444. <div class="memitem">
  445. <div class="memproto">
  446. <div class="memtemplate">
  447. template&lt;class BaseFile, typename PosType&gt; </div>
  448. <table class="mlabels">
  449. <tr>
  450. <td class="mlabels-left">
  451. <table class="memname">
  452. <tr>
  453. <td class="memname">size_t <a class="el" href="class_stream_file.html">StreamFile</a>&lt; BaseFile, PosType &gt;::write </td>
  454. <td>(</td>
  455. <td class="paramtype">uint8_t&#160;</td>
  456. <td class="paramname"><em>b</em></td><td>)</td>
  457. <td></td>
  458. </tr>
  459. </table>
  460. </td>
  461. <td class="mlabels-right">
  462. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  463. </tr>
  464. </table>
  465. </div><div class="memdoc">
  466. <p>Write a byte to a file. Required by the Arduino Print class. </p><dl class="params"><dt>Parameters</dt><dd>
  467. <table class="params">
  468. <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>
  469. </table>
  470. </dd>
  471. </dl>
  472. <dl class="section return"><dt>Returns</dt><dd>1 for success and 0 for failure. </dd></dl>
  473. </div>
  474. </div>
  475. <hr/>The documentation for this class was generated from the following file:<ul>
  476. <li>ArduinoSdFat/libraries/SdFat/src/common/ArduinoFiles.h</li>
  477. </ul>
  478. </div><!-- contents -->
  479. <!-- start footer part -->
  480. <hr class="footer"/><address class="footer"><small>
  481. Generated on Fri Dec 6 2019 09:45:12 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  482. <img class="footer" src="doxygen.png" alt="doxygen"/>
  483. </a> 1.8.16
  484. </small></address>
  485. </body>
  486. </html>