]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/ShellLib.h
Move the 2 functions associated with reading whole lines at a single time from the...
[mirror_edk2.git] / ShellPkg / Include / Library / ShellLib.h
index 905a9d39efb4881bb7d5f3aa5c096bb9df25b43e..2ee8ae5428d5634b68d51df8e38a6ec596151848 100644 (file)
@@ -1266,4 +1266,61 @@ ShellFileExists(
   IN CONST CHAR16 *Name\r
   );\r
 \r
+/**\r
+  Function to read a single line from a SHELL_FILE_HANDLE. The \n is not included in the returned\r
+  buffer.  The returned buffer must be callee freed.\r
+\r
+  If the position upon start is 0, then the Ascii Boolean will be set.  This should be\r
+  maintained and not changed for all operations with the same file.\r
+\r
+  @param[in]      Handle        SHELL_FILE_HANDLE to read from.\r
+  @param[in,out]  Ascii         Boolean value for indicating whether the file is\r
+                                Ascii (TRUE) or UCS2 (FALSE).\r
+\r
+  @return                       The line of text from the file.\r
+\r
+  @sa ShellFileHandleReadLine\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+ShellFileHandleReturnLine(\r
+  IN SHELL_FILE_HANDLE            Handle,\r
+  IN OUT BOOLEAN                *Ascii\r
+  );\r
+\r
+/**\r
+  Function to read a single line (up to but not including the \n) from a SHELL_FILE_HANDLE.\r
+\r
+  If the position upon start is 0, then the Ascii Boolean will be set.  This should be\r
+  maintained and not changed for all operations with the same file.\r
+\r
+  @param[in]      Handle        SHELL_FILE_HANDLE to read from.\r
+  @param[in,out]  Buffer        The pointer to buffer to read into.\r
+  @param[in,out]  Size          The pointer to number of bytes in Buffer.\r
+  @param[in]      Truncate      If the buffer is large enough, this has no effect.\r
+                                If the buffer is is too small and Truncate is TRUE,\r
+                                the line will be truncated.\r
+                                If the buffer is is too small and Truncate is FALSE,\r
+                                then no read will occur.\r
+\r
+  @param[in,out]  Ascii         Boolean value for indicating whether the file is\r
+                                Ascii (TRUE) or UCS2 (FALSE).\r
+\r
+  @retval EFI_SUCCESS           The operation was successful.  The line is stored in\r
+                                Buffer.\r
+  @retval EFI_INVALID_PARAMETER Handle was NULL.\r
+  @retval EFI_INVALID_PARAMETER Size was NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL  Size was not large enough to store the line.\r
+                                Size was updated to the minimum space required.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellFileHandleReadLine(\r
+  IN SHELL_FILE_HANDLE          Handle,\r
+  IN OUT CHAR16                 *Buffer,\r
+  IN OUT UINTN                  *Size,\r
+  IN BOOLEAN                    Truncate,\r
+  IN OUT BOOLEAN                *Ascii\r
+  );\r
+\r
 #endif // __SHELL_LIB__\r