TianoCore EDK2 master
Loading...
Searching...
No Matches
FilePaths.c File Reference

Go to the source code of this file.

Functions

BOOLEAN EFIAPI PathRemoveLastItem (IN OUT CHAR16 *Path)
 
CHAR16 *EFIAPI PathCleanUpDirectories (IN CHAR16 *Path)
 

Detailed Description

Defines file-path manipulation functions.

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

Definition in file FilePaths.c.

Function Documentation

◆ PathCleanUpDirectories()

CHAR16 *EFIAPI PathCleanUpDirectories ( IN CHAR16 *  Path)

Function to clean up paths.

  • Single periods in the path are removed.
  • Double periods in the path are removed along with a single parent directory.
  • Forward slashes L'/' are converted to backward slashes L'\'.

This will be done inline and the existing buffer may be larger than required upon completion.

Parameters
[in]PathThe pointer to the string containing the path.
Returns
Returns Path, otherwise returns NULL to indicate that an error has occurred.

Definition at line 68 of file FilePaths.c.

◆ PathRemoveLastItem()

BOOLEAN EFIAPI PathRemoveLastItem ( IN OUT CHAR16 *  Path)

Removes the last directory or file entry in a path. For a path which is like L"fs0:startup.nsh", it's converted to L"fs0:".

Parameters
[in,out]PathA pointer to the path to modify.
Return values
FALSENothing was found to remove.
TRUEA directory or file was removed.

Definition at line 22 of file FilePaths.c.