TianoCore EDK2 master
Loading...
Searching...
No Matches
FileBuffer.h File Reference
#include "TextEditorTypes.h"

Go to the source code of this file.

Functions

EFI_STATUS FileBufferInit (VOID)
 
EFI_STATUS FileBufferCleanup (VOID)
 
EFI_STATUS FileBufferRefresh (VOID)
 
EFI_STATUS FileBufferHandleInput (IN CONST EFI_INPUT_KEY *Key)
 
EFI_STATUS FileBufferBackup (VOID)
 
EFI_STATUS FileBufferRestorePosition (VOID)
 
EFI_STATUS FileBufferSetFileName (IN CONST CHAR16 *Str)
 
EFI_STATUS FileBufferRead (IN CONST CHAR16 *FileName, IN CONST BOOLEAN Recover)
 
EFI_STATUS FileBufferSave (CONST CHAR16 *FileName)
 
VOID FileBufferMovePosition (IN CONST UINTN NewFilePosRow, IN CONST UINTN NewFilePosCol)
 
EFI_STATUS FileBufferCutLine (OUT EFI_EDITOR_LINE **CutLine)
 
EFI_STATUS FileBufferPasteLine (VOID)
 
EFI_STATUS FileBufferSearch (IN CONST CHAR16 *Str, IN CONST UINTN Offset)
 
EFI_STATUS FileBufferReplace (IN CONST CHAR16 *Replace, IN CONST UINTN SearchLen)
 
EFI_STATUS FileBufferReplaceAll (IN CHAR16 *SearchStr, IN CHAR16 *ReplaceStr, IN UINTN Offset)
 
VOID FileBufferAdjustMousePosition (IN CONST INT32 TextX, IN CONST INT32 TextY)
 
VOID FileBufferSetModified (VOID)
 

Detailed Description

Declares filebuffer interface functions.

Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file FileBuffer.h.

Function Documentation

◆ FileBufferAdjustMousePosition()

VOID FileBufferAdjustMousePosition ( IN CONST INT32  TextX,
IN CONST INT32  TextY 
)

Move the mouse cursor position.

Parameters
[in]TextXThe new x-coordinate.
[in]TextYThe new y-coordinate.

Definition at line 3158 of file FileBuffer.c.

◆ FileBufferBackup()

EFI_STATUS FileBufferBackup ( VOID  )

Backup function for FileBuffer. Only backup the following items: Mouse/Cursor position File Name, Type, ReadOnly, Modified Insert Mode

This is for making the file buffer refresh as few as possible.

Return values
EFI_SUCCESSThe backup operation was successful.

Definition at line 117 of file FileBuffer.c.

◆ FileBufferCleanup()

EFI_STATUS FileBufferCleanup ( VOID  )

Cleanup function for FileBuffer.

Return values
EFI_SUCCESSThe cleanup was successful.

Definition at line 445 of file FileBuffer.c.

◆ FileBufferCutLine()

EFI_STATUS FileBufferCutLine ( OUT EFI_EDITOR_LINE **  CutLine)

Cut current line out and return a pointer to it.

Parameters
[out]CutLineUpon a successful return pointer to the pointer to the allocated cut line.
Return values
EFI_SUCCESSThe cut was successful.
EFI_NOT_FOUNDThere was no selection to cut.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 2791 of file FileBuffer.c.

◆ FileBufferHandleInput()

EFI_STATUS FileBufferHandleInput ( IN CONST EFI_INPUT_KEY Key)

Dispatch input to different handler

Parameters
[in]KeyThe input key. One of: ASCII KEY Backspace/Delete Return Direction key: up/down/left/right/pgup/pgdn Home/End INS
Return values
EFI_SUCCESSThe dispatch was done successfully.
EFI_LOAD_ERRORThe dispatch was not successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 2438 of file FileBuffer.c.

◆ FileBufferInit()

EFI_STATUS FileBufferInit ( VOID  )

Initialization function for FileBuffer.

Parameters
EFI_SUCCESSThe initialization was successful.
EFI_LOAD_ERRORA default name could not be created.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 69 of file FileBuffer.c.

◆ FileBufferMovePosition()

VOID FileBufferMovePosition ( IN CONST UINTN  NewFilePosRow,
IN CONST UINTN  NewFilePosCol 
)

According to cursor's file position, adjust screen display

Parameters
[in]NewFilePosRowThe row of file position ( start from 1 ).
[in]NewFilePosColThe column of file position ( start from 1 ).

Definition at line 2677 of file FileBuffer.c.

◆ FileBufferPasteLine()

EFI_STATUS FileBufferPasteLine ( VOID  )

Paste a line into line list.

Return values
EFI_SUCCESSThe paste was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 2874 of file FileBuffer.c.

◆ FileBufferRead()

EFI_STATUS FileBufferRead ( IN CONST CHAR16 *  FileName,
IN CONST BOOLEAN  Recover 
)

Read a file from disk into the FileBuffer.

Parameters
[in]FileNameThe filename to read.
[in]RecoverTRUE if is for recover mode, no information printouts.
Return values
EFI_SUCCESSThe load was successful.
EFI_LOAD_ERRORThe load failed.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_INVALID_PARAMETERFileName is a directory.

Definition at line 777 of file FileBuffer.c.

◆ FileBufferRefresh()

EFI_STATUS FileBufferRefresh ( VOID  )

Refresh the screen with whats in the buffer.

Return values
EFI_SUCCESSThe refresh was successful.
EFI_LOAD_ERRORThere was an error finding what to write.

Definition at line 551 of file FileBuffer.c.

◆ FileBufferReplace()

EFI_STATUS FileBufferReplace ( IN CONST CHAR16 *  Replace,
IN CONST UINTN  SearchLen 
)

Replace SearchLen characters from current position on with Replace.

This will modify the current buffer at the current position.

Parameters
[in]ReplaceThe string to replace.
[in]SearchLenSearch string's length.
Return values
EFI_SUCCESSThe operation was successful.
EFI_OUT_OF_RESOURCESA memory allocation failed.

Definition at line 3052 of file FileBuffer.c.

◆ FileBufferReplaceAll()

EFI_STATUS FileBufferReplaceAll ( IN CHAR16 *  SearchStr,
IN CHAR16 *  ReplaceStr,
IN UINTN  Offset 
)

Search and replace operation.

Parameters
[in]SearchStrThe string to search for.
[in]ReplaceStrThe string to replace with.
[in]OffsetThe column to start at.

Definition at line 3235 of file FileBuffer.c.

◆ FileBufferRestorePosition()

EFI_STATUS FileBufferRestorePosition ( VOID  )

Set the cursor position according to FileBuffer.DisplayPosition.

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 530 of file FileBuffer.c.

◆ FileBufferSave()

EFI_STATUS FileBufferSave ( CONST CHAR16 *  FileName)

Save lines in FileBuffer to disk

Parameters
[in]FileNameThe file name for writing.
Return values
EFI_SUCCESSData was written.
EFI_LOAD_ERROR
EFI_OUT_OF_RESOURCESThere were not enough resources to write the file.

◆ FileBufferSearch()

EFI_STATUS FileBufferSearch ( IN CONST CHAR16 *  Str,
IN CONST UINTN  Offset 
)

Search string from current position on in file

Parameters
[in]StrThe search string.
[in]OffsetThe offset from current position.
Return values
EFI_SUCCESSThe operation was successful.
EFI_NOT_FOUNDThe string Str was not found.

Definition at line 2947 of file FileBuffer.c.

◆ FileBufferSetFileName()

EFI_STATUS FileBufferSetFileName ( IN CONST CHAR16 *  Str)

Set FileName field in FileBuffer.

Parameters
StrThe file name to set.
Return values
EFI_SUCCESSThe filename was successfully set.
EFI_OUT_OF_RESOURCESA memory allocation failed.
EFI_INVALID_PARAMETERStr is not a valid filename.

Definition at line 719 of file FileBuffer.c.

◆ FileBufferSetModified()

VOID FileBufferSetModified ( VOID  )

Set the modified state to TRUE.

Definition at line 3354 of file FileBuffer.c.