FixedMaxPathString replacement
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -418,7 +418,7 @@ namespace UnitTest
|
||||
|
||||
// Check each operator/= and append overload for success
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> pathString{ "foo" };
|
||||
AZ::IO::FixedMaxPathString pathString{ "foo" };
|
||||
AZ::IO::FixedMaxPath testPath('/');
|
||||
testPath /= AZ::IO::PathView(pathString);
|
||||
testPath /= pathString;
|
||||
@@ -428,7 +428,7 @@ namespace UnitTest
|
||||
EXPECT_STREQ("foo/foo/foo/foo/f", testPath.c_str());
|
||||
}
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> pathString{ "foo" };
|
||||
AZ::IO::FixedMaxPathString pathString{ "foo" };
|
||||
AZ::IO::FixedMaxPath testPath('/');
|
||||
testPath.Append(AZ::IO::PathView(pathString));
|
||||
testPath.Append(pathString);
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace AZ::IO::ArchiveInternal
|
||||
}
|
||||
return convertedPath;
|
||||
}
|
||||
return AZStd::make_optional<AZStd::fixed_string<AZ::IO::MaxPathLength>>(sourcePath);
|
||||
return AZStd::make_optional<AZ::IO::FixedMaxPathString>(sourcePath);
|
||||
}
|
||||
|
||||
struct CCachedFileRawData
|
||||
@@ -614,7 +614,7 @@ namespace AZ::IO
|
||||
|
||||
const char* Archive::AdjustFileName(AZStd::string_view src, char* dst, size_t dstSize, uint32_t, bool)
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> srcPath{ src };
|
||||
AZ::IO::FixedMaxPathString srcPath{ src };
|
||||
return AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(srcPath.c_str(), dst, dstSize) ? dst : nullptr;
|
||||
}
|
||||
|
||||
@@ -2407,14 +2407,14 @@ namespace AZ::IO
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool Archive::RemoveFile(AZStd::string_view pName)
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> szFullPath{ pName };
|
||||
AZ::IO::FixedMaxPathString szFullPath{ pName };
|
||||
return AZ::IO::FileIOBase::GetDirectInstance()->Remove(szFullPath.c_str()) == AZ::IO::ResultCode::Success;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool Archive::RemoveDir(AZStd::string_view pName)
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> szFullPath{ pName };
|
||||
AZ::IO::FixedMaxPathString szFullPath{ pName };
|
||||
|
||||
if (AZ::IO::FileIOBase::GetDirectInstance()->IsDirectory(szFullPath.c_str()))
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace AZ::IO
|
||||
struct INestedArchive;
|
||||
struct IArchive;
|
||||
|
||||
using PathString = AZStd::fixed_string<AZ::IO::MaxPathLength>;
|
||||
using PathString = AZ::IO::FixedMaxPathString;
|
||||
using StackString = AZStd::fixed_string<512>;
|
||||
|
||||
struct MemoryBlock;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace AZ::IO
|
||||
return ZipDir::ZD_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return ZipDir::ZD_ERROR_INVALID_PATH;
|
||||
@@ -63,7 +63,7 @@ namespace AZ::IO
|
||||
return ZipDir::ZD_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return ZipDir::ZD_ERROR_INVALID_PATH;
|
||||
@@ -81,7 +81,7 @@ namespace AZ::IO
|
||||
return ZipDir::ZD_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return ZipDir::ZD_ERROR_INVALID_PATH;
|
||||
@@ -105,7 +105,7 @@ namespace AZ::IO
|
||||
return ZipDir::ZD_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return ZipDir::ZD_ERROR_INVALID_PATH;
|
||||
@@ -122,7 +122,7 @@ namespace AZ::IO
|
||||
return ZipDir::ZD_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return ZipDir::ZD_ERROR_INVALID_PATH;
|
||||
@@ -141,7 +141,7 @@ namespace AZ::IO
|
||||
return ZipDir::ZD_ERROR_INVALID_CALL;
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return ZipDir::ZD_ERROR_INVALID_PATH;
|
||||
@@ -152,7 +152,7 @@ namespace AZ::IO
|
||||
// finds the file; you don't have to close the returned handle
|
||||
auto NestedArchive::FindFile(AZStd::string_view szRelativePath) -> Handle
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> fullPath = AdjustPath(szRelativePath);
|
||||
AZ::IO::FixedMaxPathString fullPath = AdjustPath(szRelativePath);
|
||||
if (fullPath.empty())
|
||||
{
|
||||
return nullptr;
|
||||
@@ -249,7 +249,7 @@ namespace AZ::IO
|
||||
|
||||
if (m_nFlags & FLAGS_RELATIVE_PATHS_ONLY)
|
||||
{
|
||||
return AZStd::fixed_string<AZ::IO::MaxPathLength>{ szRelativePath };
|
||||
return AZ::IO::FixedMaxPathString{ szRelativePath };
|
||||
}
|
||||
|
||||
if ((szRelativePath.size() > 1 && szRelativePath[1] == ':') || (m_nFlags & FLAGS_ABSOLUTE_PATHS))
|
||||
|
||||
@@ -440,7 +440,7 @@ namespace AZ::IO::ZipDir
|
||||
azstrcpy(volume, AZ_ARRAY_SIZE(volume), filename);
|
||||
}
|
||||
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength> drive{ AZ::IO::PathView(volume).RootName().Native() };
|
||||
AZ::IO::FixedMaxPathString drive{ AZ::IO::PathView(volume).RootName().Native() };
|
||||
if (drive.empty())
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user