Integrating latest from github/staging
Integrating up through commit 5e1bdae
This commit is contained in:
@@ -52,10 +52,10 @@ namespace AZ
|
||||
// in non-release builds.
|
||||
// If a bootstrap.cfg file is not found in the public storage, it is then searched for
|
||||
// within the APK itself
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> GetDefaultAppRootPath()
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDefaultAppRootPath()
|
||||
{
|
||||
const char* appRoot = AZ::Android::Utils::FindAssetsDirectory();
|
||||
return appRoot ? AZStd::make_optional<AZStd::fixed_string<MaxPathLength>>(appRoot) : AZStd::nullopt;
|
||||
return appRoot ? AZStd::make_optional<AZ::IO::FixedMaxPathString>(appRoot) : AZStd::nullopt;
|
||||
}
|
||||
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDevWriteStoragePath()
|
||||
@@ -64,10 +64,10 @@ namespace AZ
|
||||
return writeStorage ? AZStd::make_optional<AZ::IO::FixedMaxPathString>(writeStorage) : AZStd::nullopt;
|
||||
}
|
||||
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> ConvertToAbsolutePath(AZStd::string_view path)
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> ConvertToAbsolutePath(AZStd::string_view path)
|
||||
{
|
||||
AZStd::fixed_string<MaxPathLength> absolutePath;
|
||||
AZStd::fixed_string<MaxPathLength> srcPath{ path };
|
||||
AZ::IO::FixedMaxPathString absolutePath;
|
||||
AZ::IO::FixedMaxPathString srcPath{ path };
|
||||
if (AZ::Android::Utils::IsApkPath(srcPath.c_str()))
|
||||
{
|
||||
return srcPath;
|
||||
|
||||
@@ -64,6 +64,7 @@ set(FILES
|
||||
AzCore/Socket/AzSocket_Platform.h
|
||||
../Common/UnixLike/AzCore/std/time_UnixLike.cpp
|
||||
AzCore/Utils/Utils_Android.cpp
|
||||
../Common/Unimplemented/AzCore/Utils/Utils_Unimplemented.cpp
|
||||
../../AzCore/Android/AndroidEnv.cpp
|
||||
../../AzCore/Android/AndroidEnv.h
|
||||
../../AzCore/Android/APKFileHandler.cpp
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
namespace AZ::Utils
|
||||
{
|
||||
AZ::IO::FixedMaxPathString GetEngineManifestPath()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace AZ::Utils
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -25,10 +25,25 @@ namespace AZ
|
||||
|
||||
void NativeErrorMessageBox(const char*, const char*) {}
|
||||
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> ConvertToAbsolutePath(AZStd::string_view path)
|
||||
AZ::IO::FixedMaxPathString GetEngineManifestPath()
|
||||
{
|
||||
AZStd::fixed_string<MaxPathLength> absolutePath;
|
||||
AZStd::fixed_string<MaxPathLength> srcPath{ path };
|
||||
if (const char* homePath = std::getenv("HOME"); homePath != nullptr)
|
||||
{
|
||||
AZ::IO::FixedMaxPath path{homePath};
|
||||
if (!path.empty())
|
||||
{
|
||||
path /= ".o3de";
|
||||
path /= "o3de_manifest.json";
|
||||
}
|
||||
return path.Native();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> ConvertToAbsolutePath(AZStd::string_view path)
|
||||
{
|
||||
AZ::IO::FixedMaxPathString absolutePath;
|
||||
AZ::IO::FixedMaxPathString srcPath{ path };
|
||||
|
||||
if (char* result = realpath(srcPath.c_str(), absolutePath.data()); result)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace AZ
|
||||
return result;
|
||||
}
|
||||
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> GetDefaultAppRootPath()
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDefaultAppRootPath()
|
||||
{
|
||||
return AZStd::nullopt;
|
||||
}
|
||||
@@ -57,10 +57,10 @@ namespace AZ
|
||||
return AZStd::nullopt;
|
||||
}
|
||||
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> ConvertToAbsolutePath(AZStd::string_view path)
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> ConvertToAbsolutePath(AZStd::string_view path)
|
||||
{
|
||||
AZStd::fixed_string<MaxPathLength> absolutePath;
|
||||
AZStd::fixed_string<MaxPathLength> srcPath{ path };
|
||||
AZ::IO::FixedMaxPathString absolutePath;
|
||||
AZ::IO::FixedMaxPathString srcPath{ path };
|
||||
char* result = _fullpath(absolutePath.data(), srcPath.c_str(), absolutePath.capacity());
|
||||
// Force update of the fixed_string size() value
|
||||
absolutePath.resize_no_construct(AZStd::char_traits<char>::length(absolutePath.data()));
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace AZ
|
||||
return result;
|
||||
}
|
||||
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> GetDefaultAppRootPath()
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDefaultAppRootPath()
|
||||
{
|
||||
return AZStd::nullopt;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace AZ::Utils
|
||||
{
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> GetDefaultAppRootPath()
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDefaultAppRootPath()
|
||||
{
|
||||
return AZStd::nullopt;
|
||||
}
|
||||
|
||||
+1
-1
@@ -376,7 +376,7 @@ namespace AZ::IO
|
||||
hardwareInfo.m_profile = driveList.size() == 1 ? driveList.front().m_profile : "Generic";
|
||||
hardwareInfo.m_platformData = AZStd::make_any<DriveList>(AZStd::move(driveList));
|
||||
|
||||
return true;
|
||||
return !driveList.empty();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -15,13 +15,27 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace AZ
|
||||
namespace AZ::Utils
|
||||
{
|
||||
namespace Utils
|
||||
void NativeErrorMessageBox(const char* title, const char* message)
|
||||
{
|
||||
void NativeErrorMessageBox(const char* title, const char* message)
|
||||
::MessageBox(0, message, title, MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
||||
AZ::IO::FixedMaxPathString GetEngineManifestPath()
|
||||
{
|
||||
char userProfileBuffer[AZ::IO::MaxPathLength] = {0};
|
||||
size_t variableSize = 0;
|
||||
auto err = getenv_s(&variableSize, userProfileBuffer, AZ::IO::MaxPathLength, "USERPROFILE");
|
||||
if (!err)
|
||||
{
|
||||
::MessageBox(0, message, title, MB_OK | MB_ICONERROR);
|
||||
AZ::IO::FixedMaxPath path{userProfileBuffer};
|
||||
path /= ".o3de";
|
||||
path /= "o3de_manifest.json";
|
||||
return path.Native();
|
||||
}
|
||||
} // namespace Utils
|
||||
} // namespace AZ
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace AZ::Utils
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
namespace AZ::Utils
|
||||
{
|
||||
AZStd::optional<AZStd::fixed_string<MaxPathLength>> GetDefaultAppRootPath()
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDefaultAppRootPath()
|
||||
{
|
||||
const char* pathToResources = [[[NSBundle mainBundle] resourcePath] UTF8String];
|
||||
return AZStd::fixed_string<MaxPathLength>::format("%s/assets", pathToResources);
|
||||
return AZ::IO::FixedMaxPathString::format("%s/assets", pathToResources);
|
||||
}
|
||||
|
||||
AZStd::optional<AZ::IO::FixedMaxPathString> GetDevWriteStoragePath()
|
||||
|
||||
@@ -70,4 +70,5 @@ set(FILES
|
||||
AzCore/Utils/Utils_iOS.mm
|
||||
../Common/Apple/AzCore/Utils/Utils_Apple.cpp
|
||||
../Common/UnixLike/AzCore/Utils/Utils_UnixLike.cpp
|
||||
../Common/Unimplemented/AzCore/Utils/Utils_Unimplemented.cpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user