@retval TRUE The move is across file system.\r
@retval FALSE The move is within a file system.\r
**/\r
-STATIC\r
BOOLEAN\r
EFIAPI\r
IsBetweenFileSystem(\r
\r
if the move is invalid this function will report the error to StdOut.\r
\r
- @param FullName [in] The name of the file to move.\r
- @param Cwd [in] The current working directory\r
- @param DestPath [in] The target location to move to\r
- @param Attribute[in] The Attribute of the file\r
- @param DestAttr [in] The Attribute of the destination\r
- @param FileStatus[in] The Status of the file when opened\r
+ @param SourcePath [in] The name of the file to move.\r
+ @param Cwd [in] The current working directory\r
+ @param DestPath [in] The target location to move to\r
+ @param Attribute [in] The Attribute of the file\r
+ @param DestAttr [in] The Attribute of the destination\r
+ @param FileStatus [in] The Status of the file when opened\r
\r
@retval TRUE The move is valid\r
@retval FALSE The move is not\r
**/\r
-STATIC\r
BOOLEAN\r
EFIAPI\r
IsValidMove(\r
@param[in] DestParameter The original path to the destination.\r
@param[in, out] DestPathPointer A pointer to the callee allocated final path.\r
@param[in] Cwd A pointer to the current working directory.\r
+ @param[in] SingleSource TRUE to have only one source file.\r
+ @param[in, out] DestAttr A pointer to the destination information attribute.\r
\r
@retval SHELL_INVALID_PARAMETER The DestParameter could not be resolved to a location.\r
@retval SHELL_INVALID_PARAMETER The DestParameter could be resolved to more than 1 location.\r
@retval SHELL_INVALID_PARAMETER Cwd is required and is NULL.\r
@retval SHELL_SUCCESS The operation was sucessful.\r
**/\r
-STATIC\r
SHELL_STATUS\r
EFIAPI\r
GetDestinationLocation(\r
return (SHELL_SUCCESS);\r
}\r
\r
+/**\r
+ Function to do a move across file systems.\r
+\r
+ @param[in] Node A pointer to the file to be removed.\r
+ @param[in] DestPath A pointer to the destination file path.\r
+ @param[out] Resp A pointer to response from question. Pass back on looped calling\r
+\r
+ @retval SHELL_SUCCESS The source file was moved to the destination.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
MoveBetweenFileSystems(\r
return (Status);\r
}\r
\r
+/**\r
+ Function to take the destination path and target file name to generate the full destination path.\r
+\r
+ @param[in] DestPath A pointer to the destination file path string.\r
+ @param[out] FullDestPath A pointer to the full destination path string.\r
+ @param[in] FileName Name string of the targe file.\r
+\r
+ @retval SHELL_SUCCESS the files were all moved.\r
+ @retval SHELL_INVALID_PARAMETER a parameter was invalid\r
+ @retval SHELL_OUT_OF_RESOURCES a memory allocation failed\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CreateFullDestPath(\r
return (EFI_SUCCESS);\r
}\r
\r
+/**\r
+ Function to do a move within a file system.\r
+\r
+ @param[in] Node A pointer to the file to be removed.\r
+ @param[in] DestPath A pointer to the destination file path.\r
+ @param[out] Resp A pointer to response from question. Pass back on looped calling.\r
+\r
+ @retval SHELL_SUCCESS The source file was moved to the destination.\r
+ @retval SHELL_OUT_OF_RESOURCES A memory allocation failed.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
MoveWithinFileSystems(\r
@retval SHELL_WRITE_PROTECTED the destination was write protected\r
@retval SHELL_OUT_OF_RESOURCES a memory allocation failed\r
**/\r
-STATIC\r
SHELL_STATUS\r
EFIAPI\r
ValidateAndMoveFiles(\r
//\r
// Get and validate the destination location\r
//\r
- ShellStatus = GetDestinationLocation(CleanFilePathStr, &DestPath, Cwd, FileList->Link.ForwardLink == FileList->Link.BackLink, &Attr);\r
+ ShellStatus = GetDestinationLocation(CleanFilePathStr, &DestPath, Cwd, (BOOLEAN)(FileList->Link.ForwardLink == FileList->Link.BackLink), &Attr);\r
FreePool (CleanFilePathStr);\r
\r
if (ShellStatus != SHELL_SUCCESS) {\r
SHELL_FREE_NON_NULL(FullDestPath);\r
FullDestPath = NULL;\r
if (ShellIsDirectory(DestPath)==EFI_SUCCESS) {\r
- CreateFullDestPath(&DestPath, &FullDestPath, Node->FileName);\r
+ CreateFullDestPath((CONST CHAR16 **)&DestPath, &FullDestPath, Node->FileName);\r
}\r
\r
//\r
// Validate that the move is valid\r
//\r
- if (!IsValidMove(Node->FullName, Cwd, FullDestPath?FullDestPath:DestPath, Node->Info->Attribute, Attr, Node->Status)) {\r
+ if (!IsValidMove(Node->FullName, Cwd, FullDestPath!=NULL? FullDestPath:DestPath, Node->Info->Attribute, Attr, Node->Status)) {\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
continue;\r
}\r
\r
- ShellPrintEx(-1, -1, HiiOutput, Node->FullName, FullDestPath?FullDestPath:DestPath);\r
+ ShellPrintEx(-1, -1, HiiOutput, Node->FullName, FullDestPath!=NULL? FullDestPath:DestPath);\r
\r
//\r
// See if destination exists\r
//\r
- if (!EFI_ERROR(ShellFileExists(FullDestPath?FullDestPath:DestPath))) {\r
+ if (!EFI_ERROR(ShellFileExists(FullDestPath!=NULL? FullDestPath:DestPath))) {\r
if (Response == NULL) {\r
ShellPromptForResponseHii(ShellPromptResponseTypeYesNoAllCancel, STRING_TOKEN (STR_GEN_DEST_EXIST_OVR), gShellLevel2HiiHandle, &Response);\r
}\r
FreePool(Response);\r
return SHELL_ABORTED;\r
}\r
- Status = ShellDeleteFileByName(FullDestPath?FullDestPath:DestPath);\r
+ Status = ShellDeleteFileByName(FullDestPath!=NULL? FullDestPath:DestPath);\r
}\r
\r
if (IsBetweenFileSystem(Node->FullName, Cwd, DestPath)) {\r
while (FullDestPath == NULL && DestPath != NULL && DestPath[0] != CHAR_NULL && DestPath[StrLen(DestPath) - 1] == L'\\') {\r
DestPath[StrLen(DestPath) - 1] = CHAR_NULL;\r
}\r
- Status = MoveBetweenFileSystems(Node, FullDestPath?FullDestPath:DestPath, &Response);\r
+ Status = MoveBetweenFileSystems(Node, FullDestPath!=NULL? FullDestPath:DestPath, &Response);\r
} else {\r
Status = MoveWithinFileSystems(Node, DestPath, &Response);\r
}\r