Added IsDirectory function to SystemFile (#4454)

* Added IsDirectory function to SystemFile

This takes the implementation in LocalFileIO and uses it for SystemFile
and then just has LocalFileIO call the SystemFile implementation

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

* Fixed logic to detect the WinApi FILE_ATTRIBUTE_DIRECTORY attribute

Updated the FileIO.cpp test to use AZ::IO::Path and removed direct uses
of AZStd::string

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

* Adding googletest printers for string and Path classes

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

* Updated the SystemFile_WinAPI functions to use AZStd::to_wstring

This makes the the SystemFile function convert from UTF-8 to UTF-16

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
lumberyard-employee-dm
2021-10-04 16:36:54 -05:00
committed by GitHub
parent 7052ccfa52
commit 0a8170f52a
15 changed files with 350 additions and 354 deletions
@@ -281,6 +281,14 @@ namespace AZ
return SystemFile::Exists(resolvedPath);
}
bool LocalFileIO::IsDirectory(const char* filePath)
{
char resolvedPath[AZ_MAX_PATH_LEN];
ResolvePath(filePath, resolvedPath, AZ_MAX_PATH_LEN);
return SystemFile::IsDirectory(resolvedPath);
}
void LocalFileIO::CheckInvalidWrite([[maybe_unused]] const char* path)
{
#if defined(AZ_ENABLE_TRACING)