TianoCore EDK2 master
Loading...
Searching...
No Matches
FileName.c File Reference
#include "Fat.h"

Go to the source code of this file.

Functions

BOOLEAN FatCheckIs8Dot3Name (IN CHAR16 *FileName, OUT CHAR8 *File8Dot3Name)
 
STATIC UINTN FatTrimAsciiTrailingBlanks (IN CHAR8 *Name, IN UINTN Len)
 
VOID FatNameToStr (IN CHAR8 *FatName, IN UINTN Len, IN UINTN LowerCase, OUT CHAR16 *Str)
 
VOID FatCreate8Dot3Name (IN FAT_OFILE *Parent, IN FAT_DIRENT *DirEnt)
 
STATIC UINT8 FatCheckNameCase (IN CHAR16 *Str, IN UINT8 InCaseFlag)
 
VOID FatSetCaseFlag (IN FAT_DIRENT *DirEnt)
 
VOID FatGetFileNameViaCaseFlag (IN FAT_DIRENT *DirEnt, IN OUT CHAR16 *FileString, IN UINTN FileStringMax)
 
UINT8 FatCheckSum (IN CHAR8 *ShortNameString)
 
CHAR16 * FatGetNextNameComponent (IN CHAR16 *Path, OUT CHAR16 *Name)
 
BOOLEAN FatFileNameIsValid (IN CHAR16 *InputFileName, OUT CHAR16 *OutputFileName)
 

Detailed Description

Functions for manipulating file names.

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

Definition in file FileName.c.

Function Documentation

◆ FatCheckIs8Dot3Name()

BOOLEAN FatCheckIs8Dot3Name ( IN CHAR16 *  FileName,
OUT CHAR8 *  File8Dot3Name 
)

This function checks whether the input FileName is a valid 8.3 short name. If the input FileName is a valid 8.3, the output is the 8.3 short name; otherwise, the output is the base tag of 8.3 short name.

Parameters
FileName- The input unicode filename.
File8Dot3Name- The output ascii 8.3 short name or base tag of 8.3 short name.
Return values
TRUE- The input unicode filename is a valid 8.3 short name.
FALSE- The input unicode filename is not a valid 8.3 short name.

Definition at line 25 of file FileName.c.

◆ FatCheckNameCase()

STATIC UINT8 FatCheckNameCase ( IN CHAR16 *  Str,
IN UINT8  InCaseFlag 
)

Check the string is lower case or upper case and it is used by fatname to dir entry count

Parameters
Str- The string which needs to be checked.
InCaseFlag- The input case flag which is returned when the string is lower case.
Return values
OutCaseFlag- The output case flag.

Definition at line 250 of file FileName.c.

◆ FatCheckSum()

UINT8 FatCheckSum ( IN CHAR8 *  ShortNameString)

Get the Check sum for a short name.

Parameters
ShortNameString- The short name for a file.
Return values
Sum- UINT8 checksum.

Definition at line 382 of file FileName.c.

◆ FatCreate8Dot3Name()

VOID FatCreate8Dot3Name ( IN FAT_OFILE Parent,
IN FAT_DIRENT DirEnt 
)

This function generates 8Dot3 name from user specified name for a newly created file.

Parameters
Parent- The parent directory.
DirEnt- The directory entry whose 8Dot3Name needs to be generated.

Definition at line 169 of file FileName.c.

◆ FatFileNameIsValid()

BOOLEAN FatFileNameIsValid ( IN CHAR16 *  InputFileName,
OUT CHAR16 *  OutputFileName 
)

Check whether the IFileName is valid long file name. If the IFileName is a valid long file name, then we trim the possible leading blanks and leading/trailing dots. the trimmed filename is stored in OutputFileName

Parameters
InputFileName- The input file name.
OutputFileName- The output file name.
Return values
TRUE- The InputFileName is a valid long file name.
FALSE- The InputFileName is not a valid long file name.

Definition at line 444 of file FileName.c.

◆ FatGetFileNameViaCaseFlag()

VOID FatGetFileNameViaCaseFlag ( IN FAT_DIRENT DirEnt,
IN OUT CHAR16 *  FileString,
IN UINTN  FileStringMax 
)

Convert the 8.3 ASCII fat name to cased Unicode string according to case flag.

Parameters
DirEnt- The corresponding directory entry.
FileString- The output Unicode file name.
FileStringMaxThe max length of FileString.

Definition at line 348 of file FileName.c.

◆ FatGetNextNameComponent()

CHAR16 * FatGetNextNameComponent ( IN CHAR16 *  Path,
OUT CHAR16 *  Name 
)

Takes Path as input, returns the next name component in Name, and returns the position after Name (e.g., the start of the next name component)

Parameters
Path- The path of one file.
Name- The next name component in Path.

The position after Name in the Path

Definition at line 410 of file FileName.c.

◆ FatNameToStr()

VOID FatNameToStr ( IN CHAR8 *  FatName,
IN UINTN  Len,
IN UINTN  LowerCase,
OUT CHAR16 *  Str 
)

Convert the ascii fat name to the unicode string and strip trailing spaces, and if necessary, convert the unicode string to lower case.

Parameters
FatName- The Char8 string needs to be converted.
Len- The length of the fat name.
LowerCase- Indicate whether to convert the string to lower case.
Str- The result of the conversion.

Definition at line 136 of file FileName.c.

◆ FatSetCaseFlag()

VOID FatSetCaseFlag ( IN FAT_DIRENT DirEnt)

Set the caseflag value for the directory entry.

Parameters
DirEnt- The logical directory entry whose caseflag value is to be set.

Definition at line 293 of file FileName.c.

◆ FatTrimAsciiTrailingBlanks()

STATIC UINTN FatTrimAsciiTrailingBlanks ( IN CHAR8 *  Name,
IN UINTN  Len 
)

Trim the trailing blanks of fat name.

Parameters
Name- The Char8 string needs to be trimmed.
Len- The length of the fat name.

The real length of the fat name after the trailing blanks are trimmed.

Definition at line 112 of file FileName.c.