Files
o3de/Code/Editor/Util/FileUtil_impl.cpp
T
lumberyard-employee-dm 5fc4551ac0 [LYN-8041] Enable relocation of the Project Game Release Layout (#5380)
* Enable relocation of the Project Game Release Layout

Relocating the Project Game Release Layout to another directory on the file system failed due to the querying of the engine root failing due to the ComponentApplication::m_engineRoot not using the project path stored in the SettingsRegisry if the engine root cannot be detected

Removed the ApplicationRequestBus GetEngineRoot function.
The ComponentApplicationRequestBus has a function of the same name that returns the same path.

Removed the deprecated GetAppRoot function.
The path it returns has no defined value. It was not the engine root or the project root.
Removed unused CFileUtil and CFileUtil_impl functions that were invoking the ApplicationREquestBus GetEngineRoot function.
On the way to update the functions it was discovered that they aren't called

Added a CalculateBranchToken overload that can populate a fixed_string to avoid heap allocations

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Protect against an empty list of artifacts to remove when generating the
engine.pak

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
2021-11-09 12:03:52 -06:00

179 lines
5.5 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "EditorDefs.h"
#include "FileUtil_impl.h"
bool CFileUtil_impl::ScanDirectory(const QString& path, const QString& fileSpec, FileArray& files, bool recursive, bool addDirAlso, ScanDirectoryUpdateCallBack updateCB, bool bSkipPaks)
{
return CFileUtil::ScanDirectory(path, fileSpec, files, recursive, addDirAlso, updateCB, bSkipPaks);
}
void CFileUtil_impl::ShowInExplorer(const QString& path)
{
CFileUtil::ShowInExplorer(path);
}
bool CFileUtil_impl::ExtractFile(QString& file, bool bMsgBoxAskForExtraction, const char* pDestinationFilename)
{
return CFileUtil::ExtractFile(file, bMsgBoxAskForExtraction, pDestinationFilename);
}
void CFileUtil_impl::EditTextureFile(const char* txtureFile, bool bUseGameFolder)
{
CFileUtil::EditTextureFile(txtureFile, bUseGameFolder);
}
bool CFileUtil_impl::CalculateDccFilename(const QString& assetFilename, QString& dccFilename)
{
return CFileUtil::CalculateDccFilename(assetFilename, dccFilename);
}
void CFileUtil_impl::FormatFilterString(QString& filter)
{
CFileUtil::FormatFilterString(filter);
}
bool CFileUtil_impl::SelectSaveFile(const QString& fileFilter, const QString& defaulExtension, const QString& startFolder, QString& fileName)
{
return CFileUtil::SelectSaveFile(fileFilter, defaulExtension, startFolder, fileName);
}
bool CFileUtil_impl::OverwriteFile(const QString& filename)
{
return CFileUtil::OverwriteFile(filename);
}
bool CFileUtil_impl::CheckoutFile(const char* filename, QWidget* parentWindow)
{
return CFileUtil::CheckoutFile(filename, parentWindow);
}
bool CFileUtil_impl::RevertFile(const char* filename, QWidget* parentWindow)
{
return CFileUtil::RevertFile(filename, parentWindow);
}
bool CFileUtil_impl::RenameFile(const char* sourceFile, const char* targetFile, QWidget* parentWindow)
{
return CFileUtil::RenameFile(sourceFile, targetFile, parentWindow);
}
bool CFileUtil_impl::DeleteFromSourceControl(const char* filename, QWidget* parentWindow)
{
return CFileUtil::DeleteFromSourceControl(filename, parentWindow);
}
bool CFileUtil_impl::GetLatestFromSourceControl(const char* filename, QWidget* parentWindow)
{
return CFileUtil::GetLatestFromSourceControl(filename, parentWindow);
}
bool CFileUtil_impl::GetFileInfoFromSourceControl(const char* filename, AzToolsFramework::SourceControlFileInfo& fileInfo, QWidget* parentWindow)
{
return CFileUtil::GetFileInfoFromSourceControl(filename, fileInfo, parentWindow);
}
void CFileUtil_impl::CreateDirectory(const char* dir)
{
CFileUtil::CreateDirectory(dir);
}
void CFileUtil_impl::BackupFile(const char* filename)
{
CFileUtil::BackupFile(filename);
}
void CFileUtil_impl::BackupFileDated(const char* filename, bool bUseBackupSubDirectory)
{
CFileUtil::BackupFileDated(filename, bUseBackupSubDirectory);
}
bool CFileUtil_impl::Deltree(const char* szFolder, bool bRecurse)
{
return CFileUtil::Deltree(szFolder, bRecurse);
}
bool CFileUtil_impl::Exists(const QString& strPath, bool boDirectory, FileDesc* pDesc)
{
return CFileUtil::Exists(strPath, boDirectory, pDesc);
}
bool CFileUtil_impl::FileExists(const QString& strFilePath, FileDesc* pDesc)
{
return CFileUtil::FileExists(strFilePath, pDesc);
}
bool CFileUtil_impl::PathExists(const QString& strPath)
{
return CFileUtil::PathExists(strPath);
}
bool CFileUtil_impl::GetDiskFileSize(const char* pFilePath, uint64& rOutSize)
{
return CFileUtil::GetDiskFileSize(pFilePath, rOutSize);
}
bool CFileUtil_impl::IsFileExclusivelyAccessable(const QString& strFilePath)
{
return CFileUtil::IsFileExclusivelyAccessable(strFilePath);
}
bool CFileUtil_impl::CreatePath(const QString& strPath)
{
return CFileUtil::CreatePath(strPath);
}
bool CFileUtil_impl::DeleteFile(const QString& strPath)
{
return CFileUtil::DeleteFile(strPath);
}
bool CFileUtil_impl::RemoveDirectory(const QString& strPath)
{
return CFileUtil::RemoveDirectory(strPath);
}
IFileUtil::ECopyTreeResult CFileUtil_impl::CopyTree(const QString& strSourceDirectory, const QString& strTargetDirectory, bool boRecurse, bool boConfirmOverwrite)
{
return CFileUtil::CopyTree(strSourceDirectory, strTargetDirectory, boRecurse, boConfirmOverwrite);
}
IFileUtil::ECopyTreeResult CFileUtil_impl::CopyFile(const QString& strSourceFile, const QString& strTargetFile, bool boConfirmOverwrite, ProgressRoutine pfnProgress, bool* pbCancel)
{
return CFileUtil::CopyFile(strSourceFile, strTargetFile, boConfirmOverwrite, pfnProgress, pbCancel);
}
IFileUtil::ECopyTreeResult CFileUtil_impl::MoveTree(const QString& strSourceDirectory, const QString& strTargetDirectory, bool boRecurse, bool boConfirmOverwrite)
{
return CFileUtil::MoveTree(strSourceDirectory, strTargetDirectory, boRecurse, boConfirmOverwrite);
}
void CFileUtil_impl::GatherAssetFilenamesFromLevel(std::set<QString>& rOutFilenames, bool bMakeLowerCase, bool bMakeUnixPath)
{
CFileUtil::GatherAssetFilenamesFromLevel(rOutFilenames, bMakeLowerCase, bMakeUnixPath);
}
uint32 CFileUtil_impl::GetAttributes(const char* filename, bool bUseSourceControl)
{
return CFileUtil::GetAttributes(filename, bUseSourceControl);
}
bool CFileUtil_impl::CompareFiles(const QString& strFilePath1, const QString& strFilePath2)
{
return CFileUtil::CompareFiles(strFilePath1, strFilePath2);
}
QString CFileUtil_impl::GetPath(const QString& path)
{
return Path::GetPath(path);
}