X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FInclude%2FLibrary%2FFileHandleLib.h;h=c9cf2acefd4a5e5c10ca043714bd539689cd3e0a;hp=3d2bbd1535d692417a172a4410df211e9369bd31;hb=e9880e25390e86a0f54d3f5224e65c8cf3d01568;hpb=69817bf8e049f8a83fd24e85f6368fbd57e8d3ee diff --git a/ShellPkg/Include/Library/FileHandleLib.h b/ShellPkg/Include/Library/FileHandleLib.h index 3d2bbd1535..c9cf2acefd 100644 --- a/ShellPkg/Include/Library/FileHandleLib.h +++ b/ShellPkg/Include/Library/FileHandleLib.h @@ -1,7 +1,7 @@ /** @file Provides interface to EFI_FILE_HANDLE functionality. -Copyright (c) 2006 - 2009, Intel Corporation +Copyright (c) 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -12,13 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include -#include -#include -#include -#include -#include - /** This function will retrieve the information about the file for the handle specified and store it in allocated pool memory. @@ -328,4 +321,75 @@ EFIAPI FileHandleGetSize ( IN EFI_FILE_HANDLE FileHandle, OUT UINT64 *Size - ); \ No newline at end of file + ); + +/** + Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the + directory 'stack'. + + if Handle is NULL, return EFI_INVALID_PARAMETER + + @param[in] Handle Handle to the Directory or File to create path to. + @param[out] FullFileName pointer to pointer to generated full file name. It + is the responsibility of the caller to free this memory + with a call to FreePool(). + @retval EFI_SUCCESS the operation was sucessful and the FullFileName is valid. + @retval EFI_INVALID_PARAMETER Handle was NULL. + @retval EFI_INVALID_PARAMETER FullFileName was NULL. + @retval EFI_OUT_OF_MEMORY a memory allocation failed. +**/ +EFI_STATUS +EFIAPI +FileHandleGetFileName ( + IN CONST EFI_FILE_HANDLE Handle, + OUT CHAR16 **FullFileName + ); + +/** + Function to read a single line (up to but not including the \n) from a file. + + @param[in] Handle FileHandle to read from + @param[in,out] Buffer pointer to buffer to read into + @param[in,out] Size pointer to number of bytes in buffer + @param[in[ Truncate if TRUE then allows for truncation of the line to fit. + if FALSE will reset the position to the begining of the + line if the buffer is not large enough. + + @retval EFI_SUCCESS the operation was sucessful. the line is stored in + Buffer. (Size was NOT updated) + @retval EFI_INVALID_PARAMETER Handle was NULL. + @retval EFI_INVALID_PARAMETER Buffer was NULL. + @retval EFI_INVALID_PARAMETER Size was NULL. + @retval EFI_BUFFER_TOO_SMALL Size was not enough space to store the line. + Size was updated to minimum space required. + @sa FileHandleRead +**/ +EFI_STATUS +EFIAPI +FileHandleReadLine( + IN EFI_FILE_HANDLE Handle, + IN OUT VOID *Buffer, + IN OUT UINTN *Size, + IN BOOLEAN Truncate + ); + +/** + function to write a line of unicode text to a file. + + if Handle is NULL, ASSERT. + if Buffer is NULL, do nothing. (return SUCCESS) + + @param[in] Handle FileHandle to write to + @param[in] Buffer Buffer to write + + @retval EFI_SUCCESS the data was written. + @retval other failure. + + @sa FileHandleWrite +**/ +EFI_STATUS +EFIAPI +FileHandleWriteLine( + IN EFI_FILE_HANDLE Handle, + IN CHAR16 *Buffer + );