1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50<title>nn::fs::FileInputStream</title> 51 </head> 52 <body> 53<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/fs/Overview.html">fs</a>::FileInputStream</CODE> Class</h1> 54<h2>Syntax</h2> 55 <div class="section"> 56 <pre class="definition">class FileInputStream : <br /> private nn::fs::IInputStream,<br /> private nn::fs::detail::FileBase,<br /> private <a href="../../../nn/util/NonCopyable/Overview.html">nn::util::NonCopyable< FileInputStream ></a></pre> 57 </div> 58<h2>Description</h2> 59 <div class="section"> 60<p>Class for reading from files.</p><p>Can open the file specified by a path name and read data from it.</p><p>You can specify path names using both wide strings and multibyte strings. If you specify a multibyte string, a buffer for conversion to wide characters will be allocated on the stack. Be careful with conversions to wide characters, though, because they are not thread-safe. You should use a wide string unless you have a specific reason not to.</p><h3>Limitations</h3><div class="section"> 61When reading a file, performance will degrade enormously if the read position and buffer alignment do not match.<br />We recommend reading files in multiples of four bytes, and aligning your buffer on a multiple of four bytes as well. 62 </div></div> 63 <a name="function" id="function"> 64<h2>Member Functions</h2> 65 <div class="section"> 66 <table class="members"> 67 <tr> 68 <td width="100"> </td> 69 <th> 70<a href="../../../nn/fs/FileInputStream/FileInputStream.html"><CODE>FileInputStream</CODE></a> 71 </th> 72<td>Constructor.</td> 73 </tr> 74 <tr> 75 <td width="100"> </td> 76 <th> 77<a href="../../../nn/fs/FileInputStream/Initialize.html"><CODE>Initialize</CODE></a> 78 </th> 79<td>Opens the specified file.</td> 80 </tr> 81 <tr> 82 <td width="100"> </td> 83 <th> 84<a href="../../../nn/fs/FileInputStream/TryInitialize.html"><CODE>TryInitialize</CODE></a> 85 </th> 86<td>Tries to open the specified file.</td> 87 </tr> 88 <tr> 89 <td width="100"> </td> 90 <th> 91<a href="../../../nn/fs/FileInputStream/Finalize.html"><CODE>Finalize</CODE></a> 92 </th> 93<td>Closes a file.</td> 94 </tr> 95 <tr> 96<td width="100"> <span class="virtual_style" title="virtual">V</span> 97 </td> 98 <th> 99<a href="../../../nn/fs/FileInputStream/~FileInputStream.html"><CODE>~FileInputStream</CODE></a> 100 </th> 101<td>Destructor.</td> 102 </tr> 103 <tr> 104<td width="100"> <span class="virtual_style" title="virtual">V</span> 105 </td> 106 <th> 107<a href="../../../nn/fs/FileInputStream/Read.html"><CODE>Read</CODE></a> 108 </th> 109<td>Loads the specified amount of data from a file into a buffer.</td> 110 </tr> 111 <tr> 112<td width="100"> <span class="virtual_style" title="virtual">V</span> 113 </td> 114 <th> 115<a href="../../../nn/fs/FileInputStream/TryRead.html"><CODE>TryRead</CODE></a> 116 </th> 117<td>Loads the specified amount of data from a file into a buffer.</td> 118 </tr> 119 <tr> 120<td width="100"> <span class="virtual_style" title="virtual">V</span> 121 </td> 122 <th> 123<a href="../../../nn/fs/FileInputStream/Seek.html"><CODE>Seek</CODE></a> 124 </th> 125<td>Changes the access position in the file.</td> 126 </tr> 127 <tr> 128<td width="100"> <span class="virtual_style" title="virtual">V</span> 129 </td> 130 <th> 131<a href="../../../nn/fs/FileInputStream/TrySeek.html"><CODE>TrySeek</CODE></a> 132 </th> 133<td>Changes the access position in the file.</td> 134 </tr> 135 <tr> 136<td width="100"> <span class="virtual_style" title="virtual">V</span> 137 </td> 138 <th> 139<a href="../../../nn/fs/FileInputStream/GetPosition.html"><CODE>GetPosition</CODE></a> 140 </th> 141<td>Gets the current read position relative to the start of the file.</td> 142 </tr> 143 <tr> 144<td width="100"> <span class="virtual_style" title="virtual">V</span> 145 </td> 146 <th> 147<a href="../../../nn/fs/FileInputStream/TryGetPosition.html"><CODE>TryGetPosition</CODE></a> 148 </th> 149<td>Gets the current read position relative to the start of the file.</td> 150 </tr> 151 <tr> 152<td width="100"> <span class="virtual_style" title="virtual">V</span> 153 </td> 154 <th> 155<a href="../../../nn/fs/FileInputStream/SetPosition.html"><CODE>SetPosition</CODE></a> 156 </th> 157<td>Sets the current read position relative to the start of the file.</td> 158 </tr> 159 <tr> 160<td width="100"> <span class="virtual_style" title="virtual">V</span> 161 </td> 162 <th> 163<a href="../../../nn/fs/FileInputStream/TrySetPosition.html"><CODE>TrySetPosition</CODE></a> 164 </th> 165<td>Sets the current read position relative to the start of the file.</td> 166 </tr> 167 <tr> 168<td width="100"> <span class="virtual_style" title="virtual">V</span> 169 </td> 170 <th> 171<a href="../../../nn/fs/FileInputStream/GetSize.html"><CODE>GetSize</CODE></a> 172 </th> 173<td>Gets the file size.</td> 174 </tr> 175 <tr> 176<td width="100"> <span class="virtual_style" title="virtual">V</span> 177 </td> 178 <th> 179<a href="../../../nn/fs/FileInputStream/TryGetSize.html"><CODE>TryGetSize</CODE></a> 180 </th> 181<td>Gets the file size.</td> 182 </tr> 183 <tr> 184 <td width="100"> </td> 185 <th> 186<a href="../../../nn/fs/FileInputStream/SetPriority.html"><CODE>SetPriority</CODE></a> 187 </th> 188<td>Sets a stream's access priority.</td> 189 </tr> 190 <tr> 191 <td width="100"> </td> 192 <th> 193<a href="../../../nn/fs/FileInputStream/TrySetPriority.html"><CODE>TrySetPriority</CODE></a> 194 </th> 195<td>Sets a stream's access priority.</td> 196 </tr> </table> 197 </div> 198 </a> 199<h2>Class Hierarchy</h2> 200 <div class="section"> 201<p class="hierarchy"><span>nn::fs::IPositionable</span><br /> <span>nn::fs::IInputStream</span><br /> <b>nn::fs::FileInputStream</b> 202 </p> 203 </div> 204<h2>Revision History</h2> 205 <div class="section"> 206 <dl class="history"> 207 <dt>2011/11/08</dt> 208<dd>Noted that conversions to wide strings are not thread-safe.<br /> 209 </dd> 210 <dt>2011/10/12</dt> 211<dd>Added functions for setting access priorities.<br /> 212 </dd> 213 <dt>2011/03/14</dt> 214<dd>Added note about limitation of read position and buffer alignment.<br /> 215 </dd> 216 <dt>2010/01/29</dt> 217<dd>Initial version.<br /> 218 </dd> 219 </dl> 220 </div> 221 <hr><p>CONFIDENTIAL</p></body> 222</html>