MdePkg/Library/BaseLib/FilePaths.c File Reference


Functions

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

Detailed Description

Defines file-path manipulation functions.

Copyright (c) 2011 - 2014, 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 http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

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] Path The pointer to the string containing the path.
Returns:
Returns Path, otherwise returns NULL to indicate that an error has occured.

References CHAR_NULL, CopyMem(), NULL, PathRemoveLastItem(), StrLen(), StrSize(), and StrStr().

BOOLEAN EFIAPI PathRemoveLastItem ( IN OUT CHAR16 Path  ) 

Removes the last directory or file entry in a path by changing the last L'\' to a CHAR_NULL.

Parameters:
[in,out] Path A pointer to the path to modify.
Return values:
FALSE Nothing was found to remove.
TRUE A directory or file was removed.

References CHAR_NULL, FALSE, NULL, and TRUE.

Referenced by PathCleanUpDirectories().


Generated on Thu Sep 24 23:14:22 2015 for MdePkg[ALL] by  doxygen 1.5.7.1