FileImage.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /** @file
  2. Defines FileImage - the view of the file that is visible at any point,
  3. as well as the event handlers for editing the file
  4. Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef _LIB_FILE_IMAGE_H_
  8. #define _LIB_FILE_IMAGE_H_
  9. #include "HexEditor.h"
  10. /**
  11. Initialization function for HFileImage
  12. @retval EFI_SUCCESS The operation was successful.
  13. **/
  14. EFI_STATUS
  15. HFileImageInit (
  16. VOID
  17. );
  18. /**
  19. Cleanup function for HFileImage.
  20. @retval EFI_SUCCESS The operation was successful.
  21. **/
  22. EFI_STATUS
  23. HFileImageCleanup (
  24. VOID
  25. );
  26. /**
  27. Backup function for HFileImage. Only a few fields need to be backup.
  28. This is for making the file buffer refresh as few as possible.
  29. @retval EFI_SUCCESS The operation was successful.
  30. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
  31. **/
  32. EFI_STATUS
  33. HFileImageBackup (
  34. VOID
  35. );
  36. /**
  37. Read a file from disk into HBufferImage.
  38. @param[in] FileName filename to read.
  39. @param[in] Recover if is for recover, no information print.
  40. @retval EFI_SUCCESS The operation was successful.
  41. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
  42. @retval EFI_LOAD_ERROR A load error occurred.
  43. **/
  44. EFI_STATUS
  45. HFileImageRead (
  46. IN CONST CHAR16 *FileName,
  47. IN BOOLEAN Recover
  48. );
  49. /**
  50. Save lines in HBufferImage to disk.
  51. @param[in] FileName The file name.
  52. @retval EFI_SUCCESS The operation was successful.
  53. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
  54. @retval EFI_LOAD_ERROR A load error occurred.
  55. **/
  56. EFI_STATUS
  57. HFileImageSave (
  58. IN CHAR16 *FileName
  59. );
  60. #endif