]>
Commit | Line | Data |
---|---|---|
d2b4564b | 1 | /** @file\r |
2 | Provides interface to EFI_FILE_HANDLE functionality.\r | |
3 | \r | |
9095d37b | 4 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d2b4564b | 6 | \r |
7 | **/\r | |
8 | \r | |
a405b86d | 9 | #ifndef _FILE_HANDLE_LIBRARY_HEADER_\r |
b3011f40 | 10 | #define _FILE_HANDLE_LIBRARY_HEADER_\r |
11 | \r | |
a405b86d | 12 | #include <Protocol/SimpleFileSystem.h>\r |
0f705029 | 13 | #include <Guid/FileInfo.h>\r |
a405b86d | 14 | \r |
15 | /// The tag for use in identifying UNICODE files.\r | |
16 | /// If the file is UNICODE, the first 16 bits of the file will equal this value.\r | |
4bbdc0e1 | 17 | extern CONST UINT16 gUnicodeFileTag;\r |
b3011f40 | 18 | \r |
d2b4564b | 19 | /**\r |
a405b86d | 20 | This function retrieves information about the file for the handle\r |
21 | specified and stores it in the allocated pool memory.\r | |
d2b4564b | 22 | \r |
1e6e84c7 | 23 | This function allocates a buffer to store the file's information. It is the\r |
125c2cf4 | 24 | caller's responsibility to free the buffer.\r |
d2b4564b | 25 | \r |
a405b86d | 26 | @param[in] FileHandle The file handle of the file for which information is\r |
27 | being requested.\r | |
d2b4564b | 28 | \r |
a405b86d | 29 | @retval NULL Information could not be retrieved.\r |
30 | @retval !NULL The information about the file.\r | |
d2b4564b | 31 | **/\r |
32 | EFI_FILE_INFO*\r | |
33 | EFIAPI\r | |
34 | FileHandleGetInfo (\r | |
35 | IN EFI_FILE_HANDLE FileHandle\r | |
36 | );\r | |
37 | \r | |
38 | /**\r | |
a405b86d | 39 | This function sets the information about the file for the opened handle\r |
d2b4564b | 40 | specified.\r |
41 | \r | |
a405b86d | 42 | @param[in] FileHandle The file handle of the file for which information\r |
125c2cf4 | 43 | is being set.\r |
d2b4564b | 44 | \r |
a405b86d | 45 | @param[in] FileInfo The information to set.\r |
d2b4564b | 46 | \r |
b0934ac4 | 47 | @retval EFI_SUCCESS The information was set.\r |
a405b86d | 48 | @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.\r |
125c2cf4 | 49 | @retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.\r |
b0934ac4 | 50 | @retval EFI_NO_MEDIA The device has no medium.\r |
51 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
52 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
53 | @retval EFI_WRITE_PROTECTED The file or medium is write protected.\r | |
a405b86d | 54 | @retval EFI_ACCESS_DENIED The file was opened read only.\r |
55 | @retval EFI_VOLUME_FULL The volume is full.\r | |
d2b4564b | 56 | **/\r |
57 | EFI_STATUS\r | |
58 | EFIAPI\r | |
59 | FileHandleSetInfo (\r | |
b0934ac4 | 60 | IN EFI_FILE_HANDLE FileHandle,\r |
d2b4564b | 61 | IN CONST EFI_FILE_INFO *FileInfo\r |
62 | );\r | |
63 | \r | |
64 | /**\r | |
65 | This function reads information from an opened file.\r | |
66 | \r | |
1e6e84c7 | 67 | If FileHandle is not a directory, the function reads the requested number of\r |
68 | bytes from the file at the file's current position and returns them in Buffer.\r | |
d2b4564b | 69 | If the read goes beyond the end of the file, the read length is truncated to the\r |
1e6e84c7 | 70 | end of the file. The file's current position is increased by the number of bytes\r |
71 | returned. If FileHandle is a directory, the function reads the directory entry\r | |
72 | at the file's current position and returns the entry in Buffer. If the Buffer\r | |
73 | is not large enough to hold the current directory entry, then\r | |
74 | EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.\r | |
75 | BufferSize is set to be the size of the buffer needed to read the entry. On\r | |
76 | success, the current position is updated to the next directory entry. If there\r | |
77 | are no more directory entries, the read returns a zero-length buffer.\r | |
d2b4564b | 78 | EFI_FILE_INFO is the structure returned as the directory entry.\r |
79 | \r | |
4ff7e37b ED |
80 | @param[in] FileHandle The opened file handle.\r |
81 | @param[in, out] BufferSize On input, the size of buffer in bytes. On return,\r | |
82 | the number of bytes written.\r | |
83 | @param[out] Buffer The buffer to put read data into.\r | |
d2b4564b | 84 | \r |
b0934ac4 | 85 | @retval EFI_SUCCESS Data was read.\r |
86 | @retval EFI_NO_MEDIA The device has no media.\r | |
87 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
88 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
89 | @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required\r | |
d2b4564b | 90 | size.\r |
91 | \r | |
92 | **/\r | |
93 | EFI_STATUS\r | |
94 | EFIAPI\r | |
95 | FileHandleRead(\r | |
96 | IN EFI_FILE_HANDLE FileHandle,\r | |
97 | IN OUT UINTN *BufferSize,\r | |
98 | OUT VOID *Buffer\r | |
99 | );\r | |
100 | \r | |
101 | /**\r | |
102 | Write data to a file.\r | |
103 | \r | |
1e6e84c7 | 104 | This function writes the specified number of bytes to the file at the current\r |
105 | file position. The current file position is advanced the actual number of bytes\r | |
106 | written, which is returned in BufferSize. Partial writes only occur when there\r | |
107 | has been a data error during the write attempt (such as "volume space full").\r | |
108 | The file is automatically grown to hold the data if required. Direct writes to\r | |
d2b4564b | 109 | opened directories are not supported.\r |
110 | \r | |
4ff7e37b ED |
111 | @param[in] FileHandle The opened file for writing.\r |
112 | @param[in, out] BufferSize On input, the number of bytes in Buffer. On output,\r | |
113 | the number of bytes written.\r | |
114 | @param[in] Buffer The buffer containing data to write is stored.\r | |
125c2cf4 | 115 | \r |
b0934ac4 | 116 | @retval EFI_SUCCESS Data was written.\r |
a405b86d | 117 | @retval EFI_UNSUPPORTED Writes to an open directory are not supported.\r |
b0934ac4 | 118 | @retval EFI_NO_MEDIA The device has no media.\r |
119 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
120 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
121 | @retval EFI_WRITE_PROTECTED The device is write-protected.\r | |
122 | @retval EFI_ACCESS_DENIED The file was opened for read only.\r | |
123 | @retval EFI_VOLUME_FULL The volume is full.\r | |
d2b4564b | 124 | **/\r |
125 | EFI_STATUS\r | |
126 | EFIAPI\r | |
127 | FileHandleWrite(\r | |
128 | IN EFI_FILE_HANDLE FileHandle,\r | |
129 | IN OUT UINTN *BufferSize,\r | |
130 | IN VOID *Buffer\r | |
131 | );\r | |
132 | \r | |
1e6e84c7 | 133 | /**\r |
d2b4564b | 134 | Close an open file handle.\r |
135 | \r | |
1e6e84c7 | 136 | This function closes a specified file handle. All "dirty" cached file data is\r |
137 | flushed to the device, and the file is closed. In all cases the handle is\r | |
d2b4564b | 138 | closed.\r |
139 | \r | |
a405b86d | 140 | @param[in] FileHandle The file handle to close.\r |
d2b4564b | 141 | \r |
a405b86d | 142 | @retval EFI_SUCCESS The file handle was closed successfully.\r |
d2b4564b | 143 | **/\r |
144 | EFI_STATUS\r | |
145 | EFIAPI\r | |
146 | FileHandleClose (\r | |
147 | IN EFI_FILE_HANDLE FileHandle\r | |
148 | );\r | |
149 | \r | |
150 | /**\r | |
125c2cf4 | 151 | Delete a file and close the handle.\r |
d2b4564b | 152 | \r |
153 | This function closes and deletes a file. In all cases the file handle is closed.\r | |
1e6e84c7 | 154 | If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is\r |
d2b4564b | 155 | returned, but the handle is still closed.\r |
156 | \r | |
a405b86d | 157 | @param[in] FileHandle The file handle to delete.\r |
d2b4564b | 158 | \r |
a405b86d | 159 | @retval EFI_SUCCESS The file was closed successfully.\r |
160 | @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not\r | |
161 | deleted.\r | |
b0934ac4 | 162 | @retval INVALID_PARAMETER One of the parameters has an invalid value.\r |
d2b4564b | 163 | **/\r |
164 | EFI_STATUS\r | |
165 | EFIAPI\r | |
166 | FileHandleDelete (\r | |
b0934ac4 | 167 | IN EFI_FILE_HANDLE FileHandle\r |
d2b4564b | 168 | );\r |
169 | \r | |
170 | /**\r | |
171 | Set the current position in a file.\r | |
172 | \r | |
1e6e84c7 | 173 | This function sets the current file position for the handle to the position\r |
a405b86d | 174 | supplied. With the exception of moving to position 0xFFFFFFFFFFFFFFFF, only\r |
175 | absolute positioning is supported, and moving past the end of the file is\r | |
176 | allowed (a subsequent write would grow the file). Moving to position\r | |
d2b4564b | 177 | 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.\r |
1e6e84c7 | 178 | If FileHandle is a directory, the only position that may be set is zero. This\r |
a405b86d | 179 | has the effect of starting the read process of the directory entries over again.\r |
d2b4564b | 180 | \r |
a405b86d | 181 | @param[in] FileHandle The file handle on which the position is being set.\r |
00b7cc0f | 182 | @param[in] Position The byte position from the beginning of the file.\r |
d2b4564b | 183 | \r |
00b7cc0f | 184 | @retval EFI_SUCCESS The operation completed successfully.\r |
a405b86d | 185 | @retval EFI_UNSUPPORTED The request for non-zero is not valid on\r |
d2b4564b | 186 | directories.\r |
187 | @retval INVALID_PARAMETER One of the parameters has an invalid value.\r | |
188 | **/\r | |
189 | EFI_STATUS\r | |
190 | EFIAPI\r | |
191 | FileHandleSetPosition (\r | |
b0934ac4 | 192 | IN EFI_FILE_HANDLE FileHandle,\r |
193 | IN UINT64 Position\r | |
d2b4564b | 194 | );\r |
195 | \r | |
1e6e84c7 | 196 | /**\r |
125c2cf4 | 197 | Gets a file's current position.\r |
d2b4564b | 198 | \r |
1e6e84c7 | 199 | This function retrieves the current file position for the file handle. For\r |
200 | directories, the current file position has no meaning outside of the file\r | |
a405b86d | 201 | system driver. As such, the operation is not supported. An error is returned\r |
d2b4564b | 202 | if FileHandle is a directory.\r |
203 | \r | |
a405b86d | 204 | @param[in] FileHandle The open file handle on which to get the position.\r |
00b7cc0f | 205 | @param[out] Position The byte position from beginning of file.\r |
d2b4564b | 206 | \r |
a405b86d | 207 | @retval EFI_SUCCESS The operation completed successfully.\r |
d2b4564b | 208 | @retval INVALID_PARAMETER One of the parameters has an invalid value.\r |
a405b86d | 209 | @retval EFI_UNSUPPORTED The request is not valid on directories.\r |
d2b4564b | 210 | **/\r |
211 | EFI_STATUS\r | |
212 | EFIAPI\r | |
213 | FileHandleGetPosition (\r | |
214 | IN EFI_FILE_HANDLE FileHandle,\r | |
215 | OUT UINT64 *Position\r | |
216 | );\r | |
217 | /**\r | |
125c2cf4 | 218 | Flushes data on a file.\r |
1e6e84c7 | 219 | \r |
d2b4564b | 220 | This function flushes all modified data associated with a file to a device.\r |
221 | \r | |
a405b86d | 222 | @param[in] FileHandle The file handle on which to flush data.\r |
d2b4564b | 223 | \r |
224 | @retval EFI_SUCCESS The data was flushed.\r | |
225 | @retval EFI_NO_MEDIA The device has no media.\r | |
226 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
227 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
228 | @retval EFI_WRITE_PROTECTED The file or medium is write protected.\r | |
229 | @retval EFI_ACCESS_DENIED The file was opened for read only.\r | |
230 | **/\r | |
231 | EFI_STATUS\r | |
232 | EFIAPI\r | |
233 | FileHandleFlush (\r | |
234 | IN EFI_FILE_HANDLE FileHandle\r | |
235 | );\r | |
236 | \r | |
237 | /**\r | |
125c2cf4 | 238 | Function to determine if a given handle is a directory handle.\r |
d2b4564b | 239 | \r |
e84fb6eb | 240 | Open the file information on the DirHandle and verify that the Attribute\r |
d2b4564b | 241 | includes EFI_FILE_DIRECTORY bit set.\r |
242 | \r | |
e84fb6eb | 243 | @param[in] DirHandle Handle to open file.\r |
d2b4564b | 244 | \r |
a405b86d | 245 | @retval EFI_SUCCESS DirHandle is a directory.\r |
9095d37b LG |
246 | @retval EFI_INVALID_PARAMETER DirHandle is NULL.\r |
247 | The file information returns from FileHandleGetInfo is NULL.\r | |
a405b86d | 248 | @retval EFI_NOT_FOUND DirHandle is not a directory.\r |
d2b4564b | 249 | **/\r |
250 | EFI_STATUS\r | |
251 | EFIAPI\r | |
252 | FileHandleIsDirectory (\r | |
253 | IN EFI_FILE_HANDLE DirHandle\r | |
254 | );\r | |
255 | \r | |
b0934ac4 | 256 | /** Retrieve first entry from a directory.\r |
d2b4564b | 257 | \r |
b0934ac4 | 258 | This function takes an open directory handle and gets information from the\r |
259 | first entry in the directory. A buffer is allocated to contain\r | |
260 | the information and a pointer to the buffer is returned in *Buffer. The\r | |
261 | caller can use FileHandleFindNextFile() to get subsequent directory entries.\r | |
d2b4564b | 262 | \r |
b0934ac4 | 263 | The buffer will be freed by FileHandleFindNextFile() when the last directory\r |
264 | entry is read. Otherwise, the caller must free the buffer, using FreePool,\r | |
265 | when finished with it.\r | |
266 | \r | |
267 | @param[in] DirHandle The file handle of the directory to search.\r | |
a405b86d | 268 | @param[out] Buffer The pointer to pointer to buffer for file's information.\r |
d2b4564b | 269 | \r |
270 | @retval EFI_SUCCESS Found the first file.\r | |
271 | @retval EFI_NOT_FOUND Cannot find the directory.\r | |
272 | @retval EFI_NO_MEDIA The device has no media.\r | |
273 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
274 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
a405b86d | 275 | @return Others The status of FileHandleGetInfo, FileHandleSetPosition,\r |
276 | or FileHandleRead.\r | |
d2b4564b | 277 | **/\r |
278 | EFI_STATUS\r | |
279 | EFIAPI\r | |
280 | FileHandleFindFirstFile (\r | |
281 | IN EFI_FILE_HANDLE DirHandle,\r | |
282 | OUT EFI_FILE_INFO **Buffer\r | |
283 | );\r | |
d2b4564b | 284 | \r |
b0934ac4 | 285 | /** Retrieve next entries from a directory.\r |
286 | \r | |
287 | To use this function, the caller must first call the FileHandleFindFirstFile()\r | |
288 | function to get the first directory entry. Subsequent directory entries are\r | |
289 | retrieved by using the FileHandleFindNextFile() function. This function can\r | |
290 | be called several times to get each entry from the directory. If the call of\r | |
291 | FileHandleFindNextFile() retrieved the last directory entry, the next call of\r | |
292 | this function will set *NoFile to TRUE and free the buffer.\r | |
d2b4564b | 293 | \r |
b0934ac4 | 294 | @param[in] DirHandle The file handle of the directory.\r |
a405b86d | 295 | @param[out] Buffer The pointer to buffer for file's information.\r |
296 | @param[out] NoFile The pointer to boolean when last file is found.\r | |
d2b4564b | 297 | \r |
a405b86d | 298 | @retval EFI_SUCCESS Found the next file, or reached last file.\r |
d2b4564b | 299 | @retval EFI_NO_MEDIA The device has no media.\r |
300 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
301 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
302 | **/\r | |
303 | EFI_STATUS\r | |
304 | EFIAPI\r | |
305 | FileHandleFindNextFile(\r | |
306 | IN EFI_FILE_HANDLE DirHandle,\r | |
307 | OUT EFI_FILE_INFO *Buffer,\r | |
308 | OUT BOOLEAN *NoFile\r | |
309 | );\r | |
310 | \r | |
311 | /**\r | |
312 | Retrieve the size of a file.\r | |
313 | \r | |
1e6e84c7 | 314 | This function extracts the file size info from the FileHandle's EFI_FILE_INFO\r |
d2b4564b | 315 | data.\r |
316 | \r | |
a405b86d | 317 | @param[in] FileHandle The file handle from which size is retrieved.\r |
318 | @param[out] Size The pointer to size.\r | |
d2b4564b | 319 | \r |
00b7cc0f | 320 | @retval EFI_SUCCESS Operation was completed successfully.\r |
a405b86d | 321 | @retval EFI_DEVICE_ERROR Cannot access the file.\r |
b269f895 QS |
322 | @retval EFI_INVALID_PARAMETER FileHandle is NULL.\r |
323 | Size is NULL.\r | |
d2b4564b | 324 | **/\r |
325 | EFI_STATUS\r | |
326 | EFIAPI\r | |
327 | FileHandleGetSize (\r | |
328 | IN EFI_FILE_HANDLE FileHandle,\r | |
329 | OUT UINT64 *Size\r | |
b1f95a06 | 330 | );\r |
331 | \r | |
a405b86d | 332 | /**\r |
333 | Set the size of a file.\r | |
334 | \r | |
a405b86d | 335 | This function changes the file size info from the FileHandle's EFI_FILE_INFO\r |
336 | data.\r | |
337 | \r | |
338 | @param[in] FileHandle The file handle whose size is to be changed.\r | |
339 | @param[in] Size The new size.\r | |
340 | \r | |
341 | @retval EFI_SUCCESS The operation completed successfully.\r | |
342 | @retval EFI_DEVICE_ERROR Cannot access the file.\r | |
b269f895 | 343 | @retval EFI_INVALID_PARAMETER FileHandle is NULL.\r |
a405b86d | 344 | **/\r |
345 | EFI_STATUS\r | |
346 | EFIAPI\r | |
347 | FileHandleSetSize (\r | |
348 | IN EFI_FILE_HANDLE FileHandle,\r | |
349 | IN UINT64 Size\r | |
350 | );\r | |
351 | \r | |
b1f95a06 | 352 | /**\r |
1e6e84c7 | 353 | Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the\r |
9095d37b LG |
354 | directory 'stack'. If the file is a directory, then append the '\' char at the\r |
355 | end of name string. If it's not a directory, then the last '\' should not be\r | |
ad6f6f86 | 356 | added.\r |
b1f95a06 | 357 | \r |
b1f95a06 | 358 | @param[in] Handle Handle to the Directory or File to create path to.\r |
1e6e84c7 | 359 | @param[out] FullFileName Pointer to pointer to generated full file name. It\r |
b1f95a06 | 360 | is the responsibility of the caller to free this memory\r |
361 | with a call to FreePool().\r | |
a405b86d | 362 | @retval EFI_SUCCESS The operation was successful and FullFileName is valid.\r |
b1f95a06 | 363 | @retval EFI_INVALID_PARAMETER Handle was NULL.\r |
364 | @retval EFI_INVALID_PARAMETER FullFileName was NULL.\r | |
a405b86d | 365 | @retval EFI_OUT_OF_MEMORY A memory allocation failed.\r |
b1f95a06 | 366 | **/\r |
367 | EFI_STATUS\r | |
368 | EFIAPI\r | |
369 | FileHandleGetFileName (\r | |
370 | IN CONST EFI_FILE_HANDLE Handle,\r | |
371 | OUT CHAR16 **FullFileName\r | |
372 | );\r | |
373 | \r | |
374 | /**\r | |
b3011f40 | 375 | Function to read a single line (up to but not including the \n) from a file.\r |
b1f95a06 | 376 | \r |
1e6e84c7 | 377 | If the position upon start is 0, then the Ascii Boolean will be set. This should be\r |
b3011f40 | 378 | maintained and not changed for all operations with the same file.\r |
ba180625 QS |
379 | The function will not return the \r and \n character in buffer. When an empty line is\r |
380 | read a CHAR_NULL character will be returned in buffer.\r | |
b3011f40 | 381 | \r |
4ff7e37b ED |
382 | @param[in] Handle FileHandle to read from.\r |
383 | @param[in, out] Buffer The pointer to buffer to read into.\r | |
384 | @param[in, out] Size The pointer to number of bytes in Buffer.\r | |
385 | @param[in] Truncate If the buffer is large enough, this has no effect.\r | |
386 | If the buffer is is too small and Truncate is TRUE,\r | |
387 | the line will be truncated.\r | |
388 | If the buffer is is too small and Truncate is FALSE,\r | |
389 | then no read will occur.\r | |
a405b86d | 390 | \r |
4ff7e37b ED |
391 | @param[in, out] Ascii Boolean value for indicating whether the file is\r |
392 | Ascii (TRUE) or UCS2 (FALSE).\r | |
b1f95a06 | 393 | \r |
a405b86d | 394 | @retval EFI_SUCCESS The operation was successful. The line is stored in\r |
b3011f40 | 395 | Buffer.\r |
b1f95a06 | 396 | @retval EFI_INVALID_PARAMETER Handle was NULL.\r |
b1f95a06 | 397 | @retval EFI_INVALID_PARAMETER Size was NULL.\r |
a405b86d | 398 | @retval EFI_BUFFER_TOO_SMALL Size was not large enough to store the line.\r |
399 | Size was updated to the minimum space required.\r | |
b1f95a06 | 400 | @sa FileHandleRead\r |
401 | **/\r | |
402 | EFI_STATUS\r | |
403 | EFIAPI\r | |
404 | FileHandleReadLine(\r | |
405 | IN EFI_FILE_HANDLE Handle,\r | |
125c2cf4 | 406 | IN OUT CHAR16 *Buffer,\r |
b1f95a06 | 407 | IN OUT UINTN *Size,\r |
b3011f40 | 408 | IN BOOLEAN Truncate,\r |
409 | IN OUT BOOLEAN *Ascii\r | |
410 | );\r | |
411 | \r | |
412 | /**\r | |
1e6e84c7 | 413 | Function to read a single line from a file. The \n is not included in the returned\r |
b3011f40 | 414 | buffer. The returned buffer must be callee freed.\r |
415 | \r | |
1e6e84c7 | 416 | If the position upon start is 0, then the Ascii Boolean will be set. This should be\r |
b3011f40 | 417 | maintained and not changed for all operations with the same file.\r |
418 | \r | |
4ff7e37b ED |
419 | @param[in] Handle FileHandle to read from.\r |
420 | @param[in, out] Ascii Boolean value for indicating whether the file is\r | |
421 | Ascii (TRUE) or UCS2 (FALSE).\r | |
b3011f40 | 422 | \r |
423 | @return The line of text from the file.\r | |
424 | \r | |
425 | @sa FileHandleReadLine\r | |
426 | **/\r | |
427 | CHAR16*\r | |
428 | EFIAPI\r | |
429 | FileHandleReturnLine(\r | |
430 | IN EFI_FILE_HANDLE Handle,\r | |
431 | IN OUT BOOLEAN *Ascii\r | |
b1f95a06 | 432 | );\r |
433 | \r | |
434 | /**\r | |
a86c73cd | 435 | Function to write a line of text to a file.\r |
9095d37b LG |
436 | \r |
437 | If the file is a Unicode file (with UNICODE file tag) then write the unicode\r | |
a86c73cd QS |
438 | text.\r |
439 | If the file is an ASCII file then write the ASCII text.\r | |
9095d37b | 440 | If the size of file is zero (without file tag at the beginning) then write\r |
a86c73cd | 441 | ASCII text as default.\r |
b1f95a06 | 442 | \r |
a405b86d | 443 | @param[in] Handle FileHandle to write to.\r |
1e6e84c7 | 444 | @param[in] Buffer Buffer to write, if NULL the function will\r |
125c2cf4 | 445 | take no action and return EFI_SUCCESS.\r |
b1f95a06 | 446 | \r |
b269f895 QS |
447 | @retval EFI_SUCCESS The data was written.\r |
448 | Buffer is NULL.\r | |
449 | @retval EFI_INVALID_PARAMETER Handle is NULL.\r | |
9095d37b | 450 | @retval EFI_OUT_OF_RESOURCES Unable to allocate temporary space for ASCII\r |
a86c73cd | 451 | string due to out of resources.\r |
b1f95a06 | 452 | \r |
453 | @sa FileHandleWrite\r | |
454 | **/\r | |
455 | EFI_STATUS\r | |
456 | EFIAPI\r | |
457 | FileHandleWriteLine(\r | |
458 | IN EFI_FILE_HANDLE Handle,\r | |
459 | IN CHAR16 *Buffer\r | |
e9880e25 | 460 | );\r |
125c2cf4 | 461 | \r |
462 | /**\r | |
a405b86d | 463 | Function to take a formatted argument and print it to a file.\r |
125c2cf4 | 464 | \r |
a405b86d | 465 | @param[in] Handle The file handle for the file to write to.\r |
466 | @param[in] Format The format argument (see printlib for the format specifier).\r | |
467 | @param[in] ... The variable arguments for the format.\r | |
125c2cf4 | 468 | \r |
a405b86d | 469 | @retval EFI_SUCCESS The operation was successful.\r |
470 | @retval other A return value from FileHandleWriteLine.\r | |
125c2cf4 | 471 | \r |
472 | @sa FileHandleWriteLine\r | |
473 | **/\r | |
474 | EFI_STATUS\r | |
475 | EFIAPI\r | |
476 | FileHandlePrintLine(\r | |
477 | IN EFI_FILE_HANDLE Handle,\r | |
478 | IN CONST CHAR16 *Format,\r | |
479 | ...\r | |
480 | );\r | |
481 | \r | |
482 | /**\r | |
483 | Function to determine if a FILE_HANDLE is at the end of the file.\r | |
484 | \r | |
485 | This will NOT work on directories.\r | |
486 | \r | |
a405b86d | 487 | If Handle is NULL, then ASSERT().\r |
b3011f40 | 488 | \r |
a405b86d | 489 | @param[in] Handle The file handle.\r |
125c2cf4 | 490 | \r |
a405b86d | 491 | @retval TRUE The position is at the end of the file.\r |
492 | @retval FALSE The position is not at the end of the file.\r | |
125c2cf4 | 493 | **/\r |
494 | BOOLEAN\r | |
495 | EFIAPI\r | |
496 | FileHandleEof(\r | |
497 | IN EFI_FILE_HANDLE Handle\r | |
498 | );\r | |
b3011f40 | 499 | \r |
500 | #endif //_FILE_HANDLE_LIBRARY_HEADER_\r | |
501 | \r |