removing files that got added by rebase
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> (+1 squashed commits) Squashed commits: [a19269426] fixing more strings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> (+1 squashed commits) Squashed commits: [d2a049324] fixing more strings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> (+1 squashed commits) Squashed commits: [a1ff4c101] trying to build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -4150,15 +4150,12 @@ struct CryAllocatorsRAII
|
||||
CryAllocatorsRAII()
|
||||
{
|
||||
AZ_Assert(!AZ::AllocatorInstance<AZ::LegacyAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
|
||||
AZ_Assert(!AZ::AllocatorInstance<CryStringAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
|
||||
|
||||
AZ::AllocatorInstance<AZ::LegacyAllocator>::Create();
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Create();
|
||||
}
|
||||
|
||||
~CryAllocatorsRAII()
|
||||
{
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Destroy();
|
||||
AZ::AllocatorInstance<AZ::LegacyAllocator>::Destroy();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -88,7 +88,7 @@ Export::CObject::CObject(const char* pName)
|
||||
|
||||
nParent = -1;
|
||||
|
||||
cry_strcpy(name, pName);
|
||||
azstrcpy(name, pName);
|
||||
|
||||
materialName[0] = '\0';
|
||||
|
||||
@@ -102,7 +102,7 @@ Export::CObject::CObject(const char* pName)
|
||||
|
||||
void Export::CObject::SetMaterialName(const char* pName)
|
||||
{
|
||||
cry_strcpy(materialName, pName);
|
||||
azstrcpy(materialName, pName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
|
||||
#include "FFMPEGPlugin.h"
|
||||
#include "CryString.h"
|
||||
typedef CryStringT<char> string;
|
||||
#include "Include/ICommandManager.h"
|
||||
#include "Util/PathUtil.h"
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline bool EndsWithSlash(CryStackStringT<char, size>* path)
|
||||
inline bool EndsWithSlash(AZStd::fixed_string<size>* path)
|
||||
{
|
||||
if ((!path) || (path->empty()))
|
||||
{
|
||||
@@ -271,7 +271,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline void AddBackslash(CryStackStringT<char, size>* path)
|
||||
inline void AddBackslash(AZstd::fixed_string<size>* path)
|
||||
{
|
||||
if (path->empty())
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline void AddSlash(CryStackStringT<char, size>* path)
|
||||
inline void AddSlash(AZstd::fixed_string<size>* path)
|
||||
{
|
||||
if (path->empty())
|
||||
{
|
||||
|
||||
@@ -380,126 +380,6 @@ bool StringHelpers::ContainsIgnoreCase(const wstring& str, const wstring& patter
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcards(const string& str, const string& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseSensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcards(const wstring& str, const wstring& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseSensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCase(const string& str, const string& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseInsensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCase(const wstring& str, const wstring& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseInsensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
|
||||
template <class TS>
|
||||
static inline bool MatchesWildcardsIgnoreCaseExt_Tpl(const TS& str, const TS& wildcards, std::vector<TS>& wildcardMatches)
|
||||
{
|
||||
const typename TS::value_type* savedStrBegin = 0;
|
||||
const typename TS::value_type* savedStrEnd = 0;
|
||||
const typename TS::value_type* savedWild = 0;
|
||||
size_t savedWildCount = 0;
|
||||
|
||||
const typename TS::value_type* pStr = str.c_str();
|
||||
const typename TS::value_type* pWild = wildcards.c_str();
|
||||
size_t wildCount = 0;
|
||||
|
||||
while ((*pStr) && (*pWild != '*'))
|
||||
{
|
||||
if (*pWild == '?')
|
||||
{
|
||||
wildcardMatches.push_back(TS(pStr, pStr + 1));
|
||||
++wildCount;
|
||||
}
|
||||
else if (ToLower(*pWild) != ToLower(*pStr))
|
||||
{
|
||||
wildcardMatches.resize(wildcardMatches.size() - wildCount);
|
||||
return false;
|
||||
}
|
||||
++pWild;
|
||||
++pStr;
|
||||
}
|
||||
|
||||
while (*pStr)
|
||||
{
|
||||
if (*pWild == '*')
|
||||
{
|
||||
if (!pWild[1])
|
||||
{
|
||||
wildcardMatches.push_back(TS(pStr));
|
||||
return true;
|
||||
}
|
||||
savedWild = pWild++;
|
||||
savedStrBegin = pStr;
|
||||
savedStrEnd = pStr;
|
||||
savedWildCount = wildCount;
|
||||
wildcardMatches.push_back(TS(savedStrBegin, savedStrEnd));
|
||||
++wildCount;
|
||||
}
|
||||
else if (*pWild == '?')
|
||||
{
|
||||
wildcardMatches.push_back(TS(pStr, pStr + 1));
|
||||
++wildCount;
|
||||
++pWild;
|
||||
++pStr;
|
||||
}
|
||||
else if (ToLower(*pWild) == ToLower(*pStr))
|
||||
{
|
||||
++pWild;
|
||||
++pStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
wildcardMatches.resize(wildcardMatches.size() - (wildCount - savedWildCount));
|
||||
wildCount = savedWildCount;
|
||||
++savedStrEnd;
|
||||
pWild = savedWild + 1;
|
||||
pStr = savedStrEnd;
|
||||
wildcardMatches.push_back(TS(savedStrBegin, savedStrEnd));
|
||||
++wildCount;
|
||||
}
|
||||
}
|
||||
|
||||
while (*pWild == '*')
|
||||
{
|
||||
++pWild;
|
||||
wildcardMatches.push_back(TS());
|
||||
++wildCount;
|
||||
}
|
||||
|
||||
if (*pWild)
|
||||
{
|
||||
wildcardMatches.resize(wildcardMatches.size() - wildCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCaseExt(const string& str, const string& wildcards, std::vector<string>& wildcardMatches)
|
||||
{
|
||||
return MatchesWildcardsIgnoreCaseExt_Tpl(str, wildcards, wildcardMatches);
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCaseExt(const wstring& str, const wstring& wildcards, std::vector<wstring>& wildcardMatches)
|
||||
{
|
||||
return MatchesWildcardsIgnoreCaseExt_Tpl(str, wildcards, wildcardMatches);
|
||||
}
|
||||
|
||||
|
||||
string StringHelpers::TrimLeft(const string& s)
|
||||
{
|
||||
const size_t first = s.find_first_not_of(" \r\t");
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#define CRYINCLUDE_CRYCOMMONTOOLS_STRINGHELPERS_H
|
||||
#pragma once
|
||||
|
||||
#include <CryString.h>
|
||||
|
||||
namespace StringHelpers
|
||||
{
|
||||
// compares two strings to see if they are the same or different, case sensitive
|
||||
@@ -65,19 +63,6 @@ namespace StringHelpers
|
||||
bool ContainsIgnoreCase(const string& str, const string& pattern);
|
||||
bool ContainsIgnoreCase(const wstring& str, const wstring& pattern);
|
||||
|
||||
// checks to see if a string contains a wildcard string pattern, case sensitive
|
||||
// returns true if the string does match the wildcard string pattern or false if it does not
|
||||
bool MatchesWildcards(const string& str, const string& wildcards);
|
||||
bool MatchesWildcards(const wstring& str, const wstring& wildcards);
|
||||
|
||||
// checks to see if a string contains a wildcard string pattern, case is ignored
|
||||
// returns true if the string does match the wildcard string pattern or false if it does not
|
||||
bool MatchesWildcardsIgnoreCase(const string& str, const string& wildcards);
|
||||
bool MatchesWildcardsIgnoreCase(const wstring& str, const wstring& wildcards);
|
||||
|
||||
bool MatchesWildcardsIgnoreCaseExt(const string& str, const string& wildcards, std::vector<string>& wildcardMatches);
|
||||
bool MatchesWildcardsIgnoreCaseExt(const wstring& str, const wstring& wildcards, std::vector<wstring>& wildcardMatches);
|
||||
|
||||
string TrimLeft(const string& s);
|
||||
wstring TrimLeft(const wstring& s);
|
||||
|
||||
|
||||
@@ -21,15 +21,12 @@ namespace O3DELauncher
|
||||
CryAllocatorsRAII()
|
||||
{
|
||||
AZ_Assert(!AZ::AllocatorInstance<AZ::LegacyAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
|
||||
AZ_Assert(!AZ::AllocatorInstance<CryStringAllocator>::IsReady(), "Expected allocator to not be initialized, hunt down the static that is initializing it");
|
||||
|
||||
AZ::AllocatorInstance<AZ::LegacyAllocator>::Create();
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Create();
|
||||
}
|
||||
|
||||
~CryAllocatorsRAII()
|
||||
{
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Destroy();
|
||||
AZ::AllocatorInstance<AZ::LegacyAllocator>::Destroy();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CryLegacyAllocator.h"
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convenient iteration macros
|
||||
@@ -58,18 +59,6 @@ struct fake_move_helper
|
||||
}
|
||||
};
|
||||
|
||||
// Override for string to ensure proper construction
|
||||
template <>
|
||||
struct fake_move_helper<string>
|
||||
{
|
||||
static void move(string& dest, string& source)
|
||||
{
|
||||
::new((void*)&dest) string();
|
||||
dest = source;
|
||||
source.~string();
|
||||
}
|
||||
};
|
||||
|
||||
// Generic move function: transfer an existing source object to uninitialized dest address.
|
||||
// Addresses must not overlap (requirement on caller).
|
||||
// May be specialized for specific types, to provide a more optimal move.
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "CryTypeInfo.h"
|
||||
#include "CryFixedString.h"
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Color.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzCore/std/string/fixed_string.h>
|
||||
|
||||
#define STATIC_CONST(T, name, val) \
|
||||
static inline T name() { static T t = val; return t; }
|
||||
@@ -46,7 +46,7 @@ inline bool HasString(const T& val, FToString flags, const void* def_data = 0)
|
||||
float NumToFromString(float val, int digits, bool floating, char buffer[], int buf_size);
|
||||
|
||||
template<class T>
|
||||
string NumToString(T val, int min_digits, int max_digits, bool floating)
|
||||
AZStd::string NumToString(T val, int min_digits, int max_digits, bool floating)
|
||||
{
|
||||
char buffer[64];
|
||||
float f(val);
|
||||
@@ -68,7 +68,7 @@ struct CStructInfo
|
||||
{
|
||||
CStructInfo(cstr name, size_t size, size_t align, Array<CVarInfo> vars = Array<CVarInfo>(), Array<CTypeInfo const*> templates = Array<CTypeInfo const*>());
|
||||
virtual bool IsType(CTypeInfo const& Info) const;
|
||||
virtual string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const;
|
||||
virtual AZStd::string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const;
|
||||
virtual bool FromString(void* data, cstr str, FFromString flags = 0) const;
|
||||
virtual bool ToValue(const void* data, void* value, const CTypeInfo& typeVal) const;
|
||||
virtual bool FromValue(void* data, const void* value, const CTypeInfo& typeVal) const;
|
||||
@@ -86,9 +86,9 @@ struct CStructInfo
|
||||
}
|
||||
|
||||
protected:
|
||||
Array<CVarInfo> Vars;
|
||||
CryStackStringT<char, 16> EndianDesc; // Encodes instructions for endian swapping.
|
||||
bool HasBitfields;
|
||||
Array<CVarInfo> Vars;
|
||||
AZStd::fixed_string<16> EndianDesc; // Encodes instructions for endian swapping.
|
||||
bool HasBitfields;
|
||||
Array<CTypeInfo const*> TemplateTypes;
|
||||
|
||||
void MakeEndianDesc();
|
||||
@@ -124,11 +124,11 @@ struct TTypeInfo
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const
|
||||
virtual AZStd::string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const
|
||||
{
|
||||
if (!HasString(*(const T*)data, flags, def_data))
|
||||
{
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
return ::ToString(*(const T*)data);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ struct TProxyTypeInfo
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const
|
||||
virtual AZStd::string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const
|
||||
{
|
||||
T val = T(*(const S*)data);
|
||||
T def_val = def_data ? T(*(const S*)def_data) : T();
|
||||
@@ -234,32 +234,32 @@ protected:
|
||||
// Customisation for string.
|
||||
|
||||
template<>
|
||||
inline string TTypeInfo<string>::ToString(const void* data, FToString flags, const void* def_data) const
|
||||
inline AZStd::string TTypeInfo<AZStd::string>::ToString(const void* data, FToString flags, const void* def_data) const
|
||||
{
|
||||
const string& val = *(const string*)data;
|
||||
const AZStd::string& val = *(const AZStd::string*)data;
|
||||
if (def_data && flags.SkipDefault)
|
||||
{
|
||||
if (val == *(const string*)def_data)
|
||||
if (val == *(const AZStd::string*)def_data)
|
||||
{
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline bool TTypeInfo<string>::FromString(void* data, cstr str, FFromString flags) const
|
||||
inline bool TTypeInfo<AZStd::string>::FromString(void* data, cstr str, FFromString flags) const
|
||||
{
|
||||
if (!*str && flags.SkipEmpty)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
*(string*)data = str;
|
||||
*(AZStd::string*)data = str;
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
void TTypeInfo<string>::GetMemoryUsage(ICrySizer* pSizer, void const* data) const;
|
||||
void TTypeInfo<AZStd::string>::GetMemoryUsage(ICrySizer* pSizer, void const* data) const;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
@@ -632,11 +632,11 @@ protected:
|
||||
}
|
||||
|
||||
// Override ToString: Limit to significant digits.
|
||||
virtual string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const
|
||||
virtual AZStd::string ToString(const void* data, FToString flags = 0, const void* def_data = 0) const
|
||||
{
|
||||
if (!HasString(*(const S*)data, flags, def_data))
|
||||
{
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
static int digits = int_ceil(log10f(float(nQUANT)));
|
||||
return NumToString(*(const TFixed*)data, 1, digits + 3, true);
|
||||
@@ -907,12 +907,12 @@ struct TEnumInfo
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual string ToString(const void* data, FToString flags, const void* def_data) const
|
||||
virtual AZStd::string ToString(const void* data, FToString flags, const void* def_data) const
|
||||
{
|
||||
TInt val = *(const TInt*)(data);
|
||||
if (flags.SkipDefault && val == (def_data ? *(const TInt*)def_data : TInt(0)))
|
||||
{
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
|
||||
if (cstr sName = TEnumDef::ToName(val))
|
||||
@@ -1153,13 +1153,13 @@ struct CEnumDefUuid
|
||||
return false;
|
||||
}
|
||||
|
||||
string ToString(const void* data, FToString flags, const void* def_data) const override
|
||||
AZStd::string ToString(const void* data, FToString flags, const void* def_data) const override
|
||||
{
|
||||
const AZ::Uuid& uuidData = *reinterpret_cast<const AZ::Uuid*>(data);
|
||||
const AZ::Uuid& defUuidData = *reinterpret_cast<const AZ::Uuid*>(def_data);
|
||||
if (flags.SkipDefault && uuidData == (def_data ? defUuidData : AZ::Uuid::CreateNull()))
|
||||
{
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
|
||||
if (cstr sName = ToName(uuidData))
|
||||
@@ -1167,7 +1167,7 @@ struct CEnumDefUuid
|
||||
return sName;
|
||||
}
|
||||
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
|
||||
bool FromString(void* data, cstr str, FFromString flags) const override
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <ISystem.h>
|
||||
#include <AzFramework/Archive/IArchive.h>
|
||||
#include <IConsole.h>
|
||||
#include "StringUtils.h"
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -222,7 +221,7 @@ inline CCryFile::~CCryFile()
|
||||
inline bool CCryFile::Open(const char* filename, const char* mode, int nOpenFlagsEx)
|
||||
{
|
||||
char tempfilename[CRYFILE_MAX_PATH] = "";
|
||||
cry_strcpy(tempfilename, filename);
|
||||
azstrcpy(tempfilename, filename);
|
||||
|
||||
#if !defined (_RELEASE)
|
||||
if (gEnv && gEnv->IsEditor() && gEnv->pConsole)
|
||||
@@ -233,8 +232,8 @@ inline bool CCryFile::Open(const char* filename, const char* mode, int nOpenFlag
|
||||
const int lowercasePaths = pCvar->GetIVal();
|
||||
if (lowercasePaths)
|
||||
{
|
||||
const string lowerString = PathUtil::ToLower(tempfilename);
|
||||
cry_strcpy(tempfilename, lowerString.c_str());
|
||||
const AZStd::string lowerString = PathUtil::ToLower(tempfilename);
|
||||
azstrcpy(tempfilename, lowerString.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +242,7 @@ inline bool CCryFile::Open(const char* filename, const char* mode, int nOpenFlag
|
||||
{
|
||||
Close();
|
||||
}
|
||||
cry_strcpy(m_filename, tempfilename);
|
||||
azstrcpy(m_filename, tempfilename);
|
||||
|
||||
if (m_pIArchive)
|
||||
{
|
||||
@@ -430,7 +429,7 @@ inline const char* CCryFile::GetAdjustedFilename() const
|
||||
// Returns standard path otherwise.
|
||||
if (gameUrl != &szAdjustedFile[0])
|
||||
{
|
||||
cry_strcpy(szAdjustedFile, gameUrl);
|
||||
azstrcpy(szAdjustedFile, gameUrl);
|
||||
}
|
||||
return szAdjustedFile;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -182,7 +182,7 @@ private: // DO NOT REMOVE - following methods only to be accessed only via CN
|
||||
};
|
||||
|
||||
typedef std::vector<ListenerRecord> TListenerVec;
|
||||
typedef std::vector<string> TAllocatedNameVec;
|
||||
typedef std::vector<AZStd::string> TAllocatedNameVec;
|
||||
|
||||
inline void StartNotificationScope();
|
||||
inline void EndNotificationScope();
|
||||
|
||||
@@ -395,13 +395,13 @@ inline bool CCryName::operator>(const CCryName& n) const
|
||||
return m_str > n.m_str;
|
||||
}
|
||||
|
||||
inline bool operator==(const string& s, const CCryName& n)
|
||||
inline bool operator==(const AZStd::string& s, const CCryName& n)
|
||||
{
|
||||
return n == s;
|
||||
return s == n;
|
||||
}
|
||||
inline bool operator!=(const string& s, const CCryName& n)
|
||||
inline bool operator!=(const AZStd::string& s, const CCryName& n)
|
||||
{
|
||||
return n != s;
|
||||
return s != n;
|
||||
}
|
||||
|
||||
inline bool operator==(const char* s, const CCryName& n)
|
||||
@@ -543,13 +543,13 @@ inline bool CCryNameCRC::operator>(const CCryNameCRC& n) const
|
||||
return m_nID > n.m_nID;
|
||||
}
|
||||
|
||||
inline bool operator==(const string& s, const CCryNameCRC& n)
|
||||
inline bool operator==(const AZStd::string& s, const CCryNameCRC& n)
|
||||
{
|
||||
return n == s;
|
||||
return s == n;
|
||||
}
|
||||
inline bool operator!=(const string& s, const CCryNameCRC& n)
|
||||
inline bool operator!=(const AZStd::string& s, const CCryNameCRC& n)
|
||||
{
|
||||
return n != s;
|
||||
return s != n;
|
||||
}
|
||||
|
||||
inline bool operator==(const char* s, const CCryNameCRC& n)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include <ISystem.h>
|
||||
#include <AzFramework/Archive/IArchive.h>
|
||||
#include <IConsole.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
@@ -31,26 +33,28 @@
|
||||
#define CRY_NATIVE_PATH_SEPSTR DOS_PATH_SEP_STR
|
||||
#endif
|
||||
|
||||
typedef AZStd::fixed_string<512> stack_string;
|
||||
|
||||
namespace PathUtil
|
||||
{
|
||||
const static int maxAliasLength = 32;
|
||||
inline string GetLocalizationFolder()
|
||||
inline AZStd::string GetLocalizationFolder()
|
||||
{
|
||||
return gEnv->pCryPak->GetLocalizationFolder();
|
||||
}
|
||||
|
||||
inline string GetLocalizationRoot()
|
||||
inline AZStd::string GetLocalizationRoot()
|
||||
{
|
||||
return gEnv->pCryPak->GetLocalizationRoot();
|
||||
}
|
||||
|
||||
//! Convert a path to the uniform form.
|
||||
inline string ToUnixPath(const string& strPath)
|
||||
inline AZStd::string ToUnixPath(const AZStd::string& strPath)
|
||||
{
|
||||
if (strPath.find(DOS_PATH_SEP_CHR) != string::npos)
|
||||
if (strPath.find(DOS_PATH_SEP_CHR) != AZStd::string::npos)
|
||||
{
|
||||
string path = strPath;
|
||||
path.replace(DOS_PATH_SEP_CHR, UNIX_PATH_SEP_CHR);
|
||||
AZStd::string path = strPath;
|
||||
AZ::StringFunc::Replace(path, DOS_PATH_SEP_CHR, UNIX_PATH_SEP_CHR);
|
||||
return path;
|
||||
}
|
||||
return strPath;
|
||||
@@ -73,19 +77,19 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Convert a path to the DOS form.
|
||||
inline string ToDosPath(const string& strPath)
|
||||
inline AZStd::string ToDosPath(const AZStd::string& strPath)
|
||||
{
|
||||
if (strPath.find(UNIX_PATH_SEP_CHR) != string::npos)
|
||||
if (strPath.find(UNIX_PATH_SEP_CHR) != AZStd::string::npos)
|
||||
{
|
||||
string path = strPath;
|
||||
path.replace(UNIX_PATH_SEP_CHR, DOS_PATH_SEP_CHR);
|
||||
AZStd::string path = strPath;
|
||||
AZ::StringFunc::Replace(path, UNIX_PATH_SEP_CHR, DOS_PATH_SEP_CHR);
|
||||
return path;
|
||||
}
|
||||
return strPath;
|
||||
}
|
||||
|
||||
//! Convert a path to the Native form.
|
||||
inline string ToNativePath(const string& strPath)
|
||||
inline AZStd::string ToNativePath(const AZStd::string& strPath)
|
||||
{
|
||||
#if AZ_LEGACY_CRYCOMMON_TRAIT_USE_UNIX_PATHS
|
||||
return ToUnixPath(strPath);
|
||||
@@ -95,10 +99,10 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Convert a path to lowercase form
|
||||
inline string ToLower(const string& strPath)
|
||||
inline AZStd::string ToLower(const AZStd::string& strPath)
|
||||
{
|
||||
string path = strPath;
|
||||
path.MakeLower();
|
||||
AZStd::string path = strPath;
|
||||
AZStd::to_lower(path.begin(), path.end());
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -108,9 +112,9 @@ namespace PathUtil
|
||||
//! @param path [OUT] Extracted file path.
|
||||
//! @param filename [OUT] Extracted file (without extension).
|
||||
//! @param ext [OUT] Extracted files extension.
|
||||
inline void Split(const string& filepath, string& path, string& filename, string& fext)
|
||||
inline void Split(const AZStd::string& filepath, AZStd::string& path, AZStd::string& filename, AZStd::string& fext)
|
||||
{
|
||||
path = filename = fext = string();
|
||||
path = filename = fext = AZStd::string();
|
||||
if (filepath.empty())
|
||||
{
|
||||
return;
|
||||
@@ -142,16 +146,16 @@ namespace PathUtil
|
||||
//! @param filepath [IN] Full file name inclusing path.
|
||||
//! @param path [OUT] Extracted file path.
|
||||
//! @param file [OUT] Extracted file (with extension).
|
||||
inline void Split(const string& filepath, string& path, string& file)
|
||||
inline void Split(const AZStd::string& filepath, AZStd::string& path, AZStd::string& file)
|
||||
{
|
||||
string fext;
|
||||
AZStd::string fext;
|
||||
Split(filepath, path, file, fext);
|
||||
file += fext;
|
||||
}
|
||||
|
||||
// Extract extension from full specified file path
|
||||
// Returns
|
||||
// pointer to the extension (without .) or pointer to an empty 0-terminated string
|
||||
// pointer to the extension (without .) or pointer to an empty 0-terminated AZStd::string
|
||||
inline const char* GetExt(const char* filepath)
|
||||
{
|
||||
const char* str = filepath;
|
||||
@@ -174,7 +178,7 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Extract path from full specified file path.
|
||||
inline string GetPath(const string& filepath)
|
||||
inline AZStd::string GetPath(const AZStd::string& filepath)
|
||||
{
|
||||
const char* str = filepath.c_str();
|
||||
for (const char* p = str + filepath.length() - 1; p >= str; --p)
|
||||
@@ -191,9 +195,9 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Extract path from full specified file path.
|
||||
inline string GetPath(const char* filepath)
|
||||
inline AZStd::string GetPath(const char* filepath)
|
||||
{
|
||||
return GetPath(string(filepath));
|
||||
return GetPath(AZStd::string(filepath));
|
||||
}
|
||||
|
||||
//! Extract path from full specified file path.
|
||||
@@ -214,7 +218,7 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Extract file name with extension from full specified file path.
|
||||
inline string GetFile(const string& filepath)
|
||||
inline AZStd::string GetFile(const AZStd::string& filepath)
|
||||
{
|
||||
const char* str = filepath.c_str();
|
||||
for (const char* p = str + filepath.length() - 1; p >= str; --p)
|
||||
@@ -247,7 +251,7 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Replace extension for given file.
|
||||
inline void RemoveExtension(string& filepath)
|
||||
inline void RemoveExtension(AZStd::string& filepath)
|
||||
{
|
||||
const char* str = filepath.c_str();
|
||||
for (const char* p = str + filepath.length() - 1; p >= str; --p)
|
||||
@@ -291,15 +295,15 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Extract file name without extension from full specified file path.
|
||||
inline string GetFileName(const string& filepath)
|
||||
inline AZStd::string GetFileName(const AZStd::string& filepath)
|
||||
{
|
||||
string file = filepath;
|
||||
AZStd::string file = filepath;
|
||||
RemoveExtension(file);
|
||||
return GetFile(file);
|
||||
}
|
||||
|
||||
//! Removes the trailing slash or backslash from a given path.
|
||||
inline string RemoveSlash(const string& path)
|
||||
inline AZStd::string RemoveSlash(const AZStd::string& path)
|
||||
{
|
||||
if (path.empty() || (path[path.length() - 1] != '/' && path[path.length() - 1] != '\\'))
|
||||
{
|
||||
@@ -309,13 +313,13 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! get slash
|
||||
inline string GetSlash()
|
||||
inline AZStd::string GetSlash()
|
||||
{
|
||||
return CRY_NATIVE_PATH_SEPSTR;
|
||||
}
|
||||
|
||||
//! add a backslash if needed
|
||||
inline string AddSlash(const string& path)
|
||||
inline AZStd::string AddSlash(const AZStd::string& path)
|
||||
{
|
||||
if (path.empty() || path[path.length() - 1] == '/')
|
||||
{
|
||||
@@ -343,9 +347,9 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! add a backslash if needed
|
||||
inline string AddSlash(const char* path)
|
||||
inline AZStd::string AddSlash(const char* path)
|
||||
{
|
||||
return AddSlash(string(path));
|
||||
return AddSlash(AZStd::string(path));
|
||||
}
|
||||
|
||||
inline stack_string ReplaceExtension(const stack_string& filepath, const char* ext)
|
||||
@@ -364,9 +368,9 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Replace extension for given file.
|
||||
inline string ReplaceExtension(const string& filepath, const char* ext)
|
||||
inline AZStd::string ReplaceExtension(const AZStd::string& filepath, const char* ext)
|
||||
{
|
||||
string str = filepath;
|
||||
AZStd::string str = filepath;
|
||||
if (ext != 0)
|
||||
{
|
||||
RemoveExtension(str);
|
||||
@@ -380,29 +384,30 @@ namespace PathUtil
|
||||
}
|
||||
|
||||
//! Replace extension for given file.
|
||||
inline string ReplaceExtension(const char* filepath, const char* ext)
|
||||
inline AZStd::string ReplaceExtension(const char* filepath, const char* ext)
|
||||
{
|
||||
return ReplaceExtension(string(filepath), ext);
|
||||
return ReplaceExtension(AZStd::string(filepath), ext);
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const string& path, const string& file)
|
||||
inline AZStd::string Make(const AZStd::string& path, const AZStd::string& file)
|
||||
{
|
||||
return AddSlash(path) + file;
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const string& dir, const string& filename, const string& ext)
|
||||
inline AZStd::string Make(const AZStd::string& dir, const AZStd::string& filename, const AZStd::string& ext)
|
||||
{
|
||||
string path = ReplaceExtension(filename, ext);
|
||||
AZStd::string path = filename;
|
||||
AZ::StringFunc::Path::ReplaceExtension(path, ext.c_str());
|
||||
path = AddSlash(dir) + path;
|
||||
return path;
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const string& dir, const string& filename, const char* ext)
|
||||
inline AZStd::string Make(const AZStd::string& dir, const AZStd::string& filename, const char* ext)
|
||||
{
|
||||
return Make(dir, filename, string(ext));
|
||||
return Make(dir, filename, AZStd::string(ext));
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
@@ -414,42 +419,43 @@ namespace PathUtil
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline stack_string Make(const stack_string& dir, const stack_string& filename, const stack_string& ext)
|
||||
{
|
||||
stack_string path = ReplaceExtension(filename, ext);
|
||||
path = AddSlash(dir) + path;
|
||||
return path;
|
||||
AZStd::string path = filename;
|
||||
AZ::StringFunc::Path::ReplaceExtension(path, ext.c_str());
|
||||
path = AddSlash(dir.c_str()) + path;
|
||||
return stack_string(path.c_str());
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const char* path, const string& file)
|
||||
inline AZStd::string Make(const char* path, const AZStd::string& file)
|
||||
{
|
||||
return Make(string(path), file);
|
||||
return Make(AZStd::string(path), file);
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const string& path, const char* file)
|
||||
inline AZStd::string Make(const AZStd::string& path, const char* file)
|
||||
{
|
||||
return Make(path, string(file));
|
||||
return Make(path, AZStd::string(file));
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const char path[], const char file[])
|
||||
inline AZStd::string Make(const char path[], const char file[])
|
||||
{
|
||||
return Make(string(path), string(file));
|
||||
return Make(AZStd::string(path), AZStd::string(file));
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string Make(const char* path, const char* file, const char* ext)
|
||||
inline AZStd::string Make(const char* path, const char* file, const char* ext)
|
||||
{
|
||||
return Make(string(path), string(file), string(ext));
|
||||
return Make(AZStd::string(path), AZStd::string(file), AZStd::string(ext));
|
||||
}
|
||||
|
||||
//! Makes a fully specified file path from path and file name.
|
||||
inline string MakeFullPath(const string& relativePath)
|
||||
inline AZStd::string MakeFullPath(const AZStd::string& relativePath)
|
||||
{
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
inline string GetParentDirectory (const string& strFilePath, int nGeneration = 1)
|
||||
inline AZStd::string GetParentDirectory (const AZStd::string& strFilePath, int nGeneration = 1)
|
||||
{
|
||||
for (const char* p = strFilePath.c_str() + strFilePath.length() - 2; // -2 is for the possible trailing slash: there always must be some trailing symbol which is the file/directory name for which we should get the parent
|
||||
p >= strFilePath.c_str();
|
||||
@@ -458,23 +464,23 @@ namespace PathUtil
|
||||
switch (*p)
|
||||
{
|
||||
case ':':
|
||||
return string (strFilePath.c_str(), p);
|
||||
return AZStd::string(strFilePath.c_str(), p);
|
||||
case '/':
|
||||
case '\\':
|
||||
// we've reached a path separator - return everything before it.
|
||||
if (!--nGeneration)
|
||||
{
|
||||
return string(strFilePath.c_str(), p);
|
||||
return AZStd::string(strFilePath.c_str(), p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// it seems the file name is a pure name, without path or extension
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
|
||||
template<typename T, size_t SIZE>
|
||||
inline CryStackStringT<T, SIZE> GetParentDirectoryStackString(const CryStackStringT<T, SIZE>& strFilePath, int nGeneration = 1)
|
||||
inline AZStd::basic_fixed_string<T, SIZE> GetParentDirectoryStackString(const AZStd::basic_fixed_string<T, SIZE>& strFilePath, int nGeneration = 1)
|
||||
{
|
||||
for (const char* p = strFilePath.c_str() + strFilePath.length() - 2; // -2 is for the possible trailing slash: there always must be some trailing symbol which is the file/directory name for which we should get the parent
|
||||
p >= strFilePath.c_str();
|
||||
@@ -483,19 +489,19 @@ namespace PathUtil
|
||||
switch (*p)
|
||||
{
|
||||
case ':':
|
||||
return CryStackStringT<T, SIZE> (strFilePath.c_str(), p);
|
||||
return AZStd::basic_fixed_string<T, SIZE> (strFilePath.c_str(), p);
|
||||
case '/':
|
||||
case '\\':
|
||||
// we've reached a path separator - return everything before it.
|
||||
if (!--nGeneration)
|
||||
{
|
||||
return CryStackStringT<T, SIZE>(strFilePath.c_str(), p);
|
||||
return AZStd::basic_fixed_string<T, SIZE>(strFilePath.c_str(), p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// it seems the file name is a pure name, without path or extension
|
||||
return CryStackStringT<T, SIZE>();
|
||||
return AZStd::basic_fixed_string<T, SIZE>();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -503,7 +509,8 @@ namespace PathUtil
|
||||
// Make a game correct path out of any input path.
|
||||
inline stack_string MakeGamePath(const stack_string& path)
|
||||
{
|
||||
stack_string relativePath(ToUnixPath(path));
|
||||
stack_string relativePath = path;
|
||||
ToUnixPath(relativePath);
|
||||
|
||||
if ((!gEnv) || (!gEnv->pFileIO))
|
||||
{
|
||||
@@ -512,7 +519,7 @@ namespace PathUtil
|
||||
unsigned int index = 0;
|
||||
if (relativePath.length() && relativePath[index] == '@') // already aliased
|
||||
{
|
||||
if (relativePath.compareNoCase(0, 9, "@assets@/") == 0)
|
||||
if (AZ::StringFunc::Equal(relativePath.c_str(), "@assets@/", false, 9))
|
||||
{
|
||||
return relativePath.substr(9); // assets is assumed.
|
||||
}
|
||||
@@ -526,7 +533,7 @@ namespace PathUtil
|
||||
if (
|
||||
(rootPath.size() > 0) &&
|
||||
(rootPath.size() < relativePath.size()) &&
|
||||
(relativePath.compareNoCase(0, rootPath.size(), rootPath) == 0)
|
||||
(AZ::StringFunc::Equal(relativePath.c_str(), rootPath.c_str(), false, rootPath.size()))
|
||||
)
|
||||
{
|
||||
stack_string chopped_string = relativePath.substr(rootPath.size());
|
||||
@@ -543,13 +550,13 @@ namespace PathUtil
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Description:
|
||||
// Make a game correct path out of any input path.
|
||||
inline string MakeGamePath(const string& path)
|
||||
inline AZStd::string MakeGamePath(const AZStd::string& path)
|
||||
{
|
||||
stack_string stackPath(path.c_str());
|
||||
return MakeGamePath(stackPath).c_str();
|
||||
}
|
||||
|
||||
// returns true if the string matches the wildcard
|
||||
// returns true if the AZStd::string matches the wildcard
|
||||
inline bool MatchWildcard (const char* szString, const char* szWildcard)
|
||||
{
|
||||
const char* pString = szString, * pWildcard = szWildcard;
|
||||
@@ -595,7 +602,7 @@ namespace PathUtil
|
||||
|
||||
if (!*pWildcard)
|
||||
{
|
||||
return true; // the rest of the string doesn't matter: the wildcard ends with *
|
||||
return true; // the rest of the AZStd::string doesn't matter: the wildcard ends with *
|
||||
}
|
||||
for (; *pString; ++pString)
|
||||
{
|
||||
|
||||
@@ -208,9 +208,7 @@ public:
|
||||
this->AddObject(rPair.first);
|
||||
this->AddObject(rPair.second);
|
||||
}
|
||||
void AddObject(const string& rString) {this->AddObject(rString.c_str(), rString.capacity()); }
|
||||
void AddObject(const CryStringT<wchar_t>& rString) {this->AddObject(rString.c_str(), rString.capacity()); }
|
||||
void AddObject(const CryFixedStringT<32>&){}
|
||||
void AddObject(const AZStd::string& rString) {this->AddObject(rString.c_str(), rString.capacity()); }
|
||||
void AddObject(const wchar_t&) {}
|
||||
void AddObject(const char&) {}
|
||||
void AddObject(const unsigned char&) {}
|
||||
@@ -427,7 +425,7 @@ public:
|
||||
#endif
|
||||
|
||||
#ifndef NOT_USE_CRY_STRING
|
||||
bool Add (const string& strText)
|
||||
bool Add (const AZStd::string& strText)
|
||||
{
|
||||
AddString(strText);
|
||||
return true;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -260,7 +260,7 @@ private:
|
||||
volatile bool m_bIsStarted;
|
||||
volatile bool m_bIsRunning;
|
||||
volatile bool m_bCreatedThread;
|
||||
string m_name;
|
||||
AZStd::string m_name;
|
||||
|
||||
protected:
|
||||
virtual void Terminate()
|
||||
|
||||
@@ -114,7 +114,7 @@ TYPE_INFO_INT(uint64)
|
||||
TYPE_INFO_BASIC(float)
|
||||
TYPE_INFO_BASIC(double)
|
||||
|
||||
TYPE_INFO_BASIC(string)
|
||||
TYPE_INFO_BASIC(AZStd::string)
|
||||
|
||||
|
||||
const CTypeInfo&PtrTypeInfo()
|
||||
@@ -129,9 +129,9 @@ const CTypeInfo&PtrTypeInfo()
|
||||
// String conversion functions needed by TypeInfo.
|
||||
|
||||
// bool
|
||||
string ToString(bool const& val)
|
||||
AZStd::string ToString(bool const& val)
|
||||
{
|
||||
static string sTrue = "true", sFalse = "false";
|
||||
static AZStd::string sTrue = "true", sFalse = "false";
|
||||
return val ? sTrue : sFalse;
|
||||
}
|
||||
|
||||
@@ -151,14 +151,14 @@ bool FromString(bool& val, cstr s)
|
||||
}
|
||||
|
||||
// int64
|
||||
string ToString(int64 const& val)
|
||||
AZStd::string ToString(int64 const& val)
|
||||
{
|
||||
char buffer[64];
|
||||
_i64toa_s(val, buffer, sizeof(buffer), 10);
|
||||
return buffer;
|
||||
}
|
||||
// uint64
|
||||
string ToString(uint64 const& val)
|
||||
AZStd::string ToString(uint64 const& val)
|
||||
{
|
||||
char buffer[64];
|
||||
sprintf_s(buffer, "%" PRIu64, val);
|
||||
@@ -168,7 +168,7 @@ string ToString(uint64 const& val)
|
||||
|
||||
|
||||
// long
|
||||
string ToString(long const& val)
|
||||
AZStd::string ToString(long const& val)
|
||||
{
|
||||
char buffer[64];
|
||||
_ltoa_s(val, buffer, sizeof(buffer), 10);
|
||||
@@ -176,7 +176,7 @@ string ToString(long const& val)
|
||||
}
|
||||
|
||||
// ulong
|
||||
string ToString(unsigned long const& val)
|
||||
AZStd::string ToString(unsigned long const& val)
|
||||
{
|
||||
char buffer[64];
|
||||
_ultoa_s(val, buffer, sizeof(buffer), 10);
|
||||
@@ -233,33 +233,33 @@ bool FromString(uint64& val, const char* s) { return Clamped
|
||||
bool FromString(long& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
bool FromString(unsigned long& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(int const& val) { return ToString(long(val)); }
|
||||
AZStd::string ToString(int const& val) { return ToString(long(val)); }
|
||||
bool FromString(int& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(unsigned int const& val) { return ToString((unsigned long)(val)); }
|
||||
AZStd::string ToString(unsigned int const& val) { return ToString((unsigned long)(val)); }
|
||||
bool FromString(unsigned int& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(short const& val) { return ToString(long(val)); }
|
||||
AZStd::string ToString(short const& val) { return ToString(long(val)); }
|
||||
bool FromString(short& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(unsigned short const& val) { return ToString((unsigned long)(val)); }
|
||||
AZStd::string ToString(unsigned short const& val) { return ToString((unsigned long)(val)); }
|
||||
bool FromString(unsigned short& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(char const& val) { return ToString(long(val)); }
|
||||
AZStd::string ToString(char const& val) { return ToString(long(val)); }
|
||||
bool FromString(char& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(wchar_t const& val) { return ToString(long(val)); }
|
||||
AZStd::string ToString(wchar_t const& val) { return ToString(long(val)); }
|
||||
bool FromString(wchar_t& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(signed char const& val) { return ToString(long(val)); }
|
||||
AZStd::string ToString(signed char const& val) { return ToString(long(val)); }
|
||||
bool FromString(signed char& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(unsigned char const& val) { return ToString((unsigned long)(val)); }
|
||||
AZStd::string ToString(unsigned char const& val) { return ToString((unsigned long)(val)); }
|
||||
bool FromString(unsigned char& val, const char* s) { return ClampedIntFromString(val, s); }
|
||||
|
||||
string ToString(const AZ::Uuid& val)
|
||||
AZStd::string ToString(const AZ::Uuid& val)
|
||||
{
|
||||
return val.ToString<string>();
|
||||
return val.ToString<AZStd::string>();
|
||||
}
|
||||
|
||||
bool FromString(AZ::Uuid& val, const char* s)
|
||||
@@ -295,7 +295,7 @@ float NumToFromString(float val, int digits, bool floating, char buffer[], int b
|
||||
}
|
||||
|
||||
// double
|
||||
string ToString(double const& val)
|
||||
AZStd::string ToString(double const& val)
|
||||
{
|
||||
char buffer[64];
|
||||
sprintf_s(buffer, "%.16g", val);
|
||||
@@ -307,7 +307,7 @@ bool FromString(double& val, const char* s)
|
||||
}
|
||||
|
||||
// float
|
||||
string ToString(float const& val)
|
||||
AZStd::string ToString(float const& val)
|
||||
{
|
||||
char buffer[64];
|
||||
for (int digits = 7; digits < 10; digits++)
|
||||
@@ -329,11 +329,11 @@ bool FromString(float& val, const char* s)
|
||||
|
||||
// string override.
|
||||
template <>
|
||||
void TTypeInfo<string>::GetMemoryUsage(ICrySizer* pSizer, void const* data) const
|
||||
void TTypeInfo<AZStd::string>::GetMemoryUsage(ICrySizer* pSizer, void const* data) const
|
||||
{
|
||||
// CRAIG: just a temp hack to try and get things working
|
||||
#if !defined(LINUX) && !defined(APPLE)
|
||||
pSizer->AddString(*(string*)data);
|
||||
pSizer->AddString(*(AZStd::string*)data);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ struct STypeInfoTest
|
||||
{
|
||||
STypeInfoTest()
|
||||
{
|
||||
TestType(string("well"));
|
||||
TestType(AZStd::string("well"));
|
||||
|
||||
TestType(true);
|
||||
|
||||
@@ -435,7 +435,7 @@ bool CTypeInfo::CVarInfo::GetAttr(cstr name) const
|
||||
return FindAttr(Attrs, name) != 0;
|
||||
}
|
||||
|
||||
bool CTypeInfo::CVarInfo::GetAttr(cstr name, string& val) const
|
||||
bool CTypeInfo::CVarInfo::GetAttr(cstr name, AZStd::string& val) const
|
||||
{
|
||||
cstr valstr = FindAttr(Attrs, name);
|
||||
if (!valstr)
|
||||
@@ -459,7 +459,7 @@ bool CTypeInfo::CVarInfo::GetAttr(cstr name, string& val) const
|
||||
end--;
|
||||
}
|
||||
}
|
||||
val = string(valstr, end - valstr);
|
||||
val = AZStd::string(valstr, end - valstr);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ bool CStructInfo::ToValue(const void* data, void* value, const CTypeInfo& typeVa
|
||||
Nameless , 1, ,2 1,2 ;
|
||||
*/
|
||||
|
||||
static void StripCommas(string& str)
|
||||
static void StripCommas(AZStd::string& str)
|
||||
{
|
||||
size_t nLast = str.size();
|
||||
while (nLast > 0 && str[nLast - 1] == ',')
|
||||
@@ -745,9 +745,9 @@ static void StripCommas(string& str)
|
||||
str.resize(nLast);
|
||||
}
|
||||
|
||||
string CStructInfo::ToString(const void* data, FToString flags, const void* def_data) const
|
||||
AZStd::string CStructInfo::ToString(const void* data, FToString flags, const void* def_data) const
|
||||
{
|
||||
string str; // Return str.
|
||||
AZStd::string str; // Return str.
|
||||
|
||||
for (int i = 0; i < Vars.size(); i++)
|
||||
{
|
||||
@@ -763,7 +763,7 @@ string CStructInfo::ToString(const void* data, FToString flags, const void* def_
|
||||
str += ",";
|
||||
}
|
||||
|
||||
string substr = var.ToString(data, FToString(flags).Sub(0), def_data);
|
||||
AZStd::string substr = var.ToString(data, FToString(flags).Sub(0), def_data);
|
||||
|
||||
if (flags.SkipDefault && substr.empty())
|
||||
{
|
||||
@@ -772,7 +772,7 @@ string CStructInfo::ToString(const void* data, FToString flags, const void* def_
|
||||
|
||||
if (flags.NamedFields)
|
||||
{
|
||||
if (*str)
|
||||
if (*str.c_str())
|
||||
{
|
||||
str += ",";
|
||||
}
|
||||
@@ -782,7 +782,7 @@ string CStructInfo::ToString(const void* data, FToString flags, const void* def_
|
||||
str += "=";
|
||||
}
|
||||
}
|
||||
if (substr.find(',') != string::npos || substr.find('=') != string::npos)
|
||||
if (substr.find(',') != AZStd::string::npos || substr.find('=') != AZStd::string::npos)
|
||||
{
|
||||
// Encase nested composite types in parens.
|
||||
str += "(";
|
||||
@@ -811,7 +811,7 @@ string CStructInfo::ToString(const void* data, FToString flags, const void* def_
|
||||
// Retrieve and return one subelement from src, advancing the pointer.
|
||||
// Copy to tempstr if necessary.
|
||||
|
||||
typedef CryStackStringT<char, 256> CTempStr;
|
||||
typedef AZStd::fixed_string<256> CTempStr;
|
||||
|
||||
void ParseElement(cstr& src, cstr& varname, cstr& val, CTempStr& tempstr)
|
||||
{
|
||||
@@ -882,21 +882,24 @@ void ParseElement(cstr& src, cstr& varname, cstr& val, CTempStr& tempstr)
|
||||
if (*end)
|
||||
{
|
||||
// Must copy sub string to temp.
|
||||
val = (cstr)tempstr + (val - varname);
|
||||
eq = (cstr)tempstr + (eq - varname);
|
||||
varname = tempstr.assign(varname, end);
|
||||
val = tempstr.c_str() + (val - varname);
|
||||
eq = tempstr.c_str() + (eq - varname);
|
||||
tempstr.assign(varname, end);
|
||||
varname = tempstr.c_str();
|
||||
non_const(*eq) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy just varname to temp, return val in place.
|
||||
varname = tempstr.assign(varname, eq);
|
||||
tempstr.assign(varname, eq);
|
||||
varname = tempstr.c_str();
|
||||
}
|
||||
}
|
||||
else if (*end)
|
||||
{
|
||||
// Must copy sub string to temp.
|
||||
val = tempstr.assign(val, end);
|
||||
tempstr.assign(val, end);
|
||||
val = tempstr.c_str();
|
||||
}
|
||||
|
||||
// Else can return val without copying.
|
||||
@@ -963,7 +966,7 @@ void CStructInfo::SwapEndian(void* data, size_t nCount, bool bWriting) const
|
||||
{
|
||||
non_const(*this).MakeEndianDesc();
|
||||
|
||||
if (EndianDesc.length() == 1 && !HasBitfields && EndianDescSize(EndianDesc) == Size)
|
||||
if (EndianDesc.length() == 1 && !HasBitfields && EndianDescSize(EndianDesc.c_str()) == Size)
|
||||
{
|
||||
// Optimised array swap.
|
||||
size_t nElems = (EndianDesc[0u] & 0x3F) * nCount;
|
||||
@@ -989,7 +992,7 @@ void CStructInfo::SwapEndian(void* data, size_t nCount, bool bWriting) const
|
||||
// First swap bits.
|
||||
// Iterate the endian descriptor.
|
||||
void* step = data;
|
||||
for (cstr desc = EndianDesc; *desc; desc++)
|
||||
for (cstr desc = EndianDesc.c_str(); *desc; desc++)
|
||||
{
|
||||
size_t nElems = *desc & 0x3F;
|
||||
switch (*desc & 0xC0)
|
||||
@@ -1064,7 +1067,7 @@ void CStructInfo::MakeEndianDesc()
|
||||
// Struct-computed endian desc.
|
||||
CStructInfo const& infoSub = static_cast<CStructInfo const&>(var.Type);
|
||||
non_const(infoSub).MakeEndianDesc();
|
||||
subdesc = infoSub.EndianDesc;
|
||||
subdesc = infoSub.EndianDesc.c_str();
|
||||
if (!*subdesc)
|
||||
{
|
||||
// No swapping.
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
#include <platform.h>
|
||||
#include "CryArray.h"
|
||||
#include "Options.h"
|
||||
#include "CryString.h"
|
||||
#include "TypeInfo_decl.h"
|
||||
|
||||
class ICrySizer;
|
||||
|
||||
class CCryName;
|
||||
string ToString(CCryName const& val);
|
||||
AZStd::string ToString(CCryName const& val);
|
||||
bool FromString(CCryName& val, const char* s);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -85,7 +84,7 @@ struct CTypeInfo
|
||||
//
|
||||
|
||||
// Convert value to string.
|
||||
virtual string ToString([[maybe_unused]] const void* data, [[maybe_unused]] FToString flags = 0, [[maybe_unused]] const void* def_data = 0) const
|
||||
virtual AZStd::string ToString([[maybe_unused]] const void* data, [[maybe_unused]] FToString flags = 0, [[maybe_unused]] const void* def_data = 0) const
|
||||
{ return ""; }
|
||||
|
||||
// Write value from string, return success.
|
||||
@@ -180,7 +179,7 @@ struct CTypeInfo
|
||||
assert(!bBitfield);
|
||||
return Type.FromString((char*)base + Offset, str, flags);
|
||||
}
|
||||
string ToString(const void* base, FToString flags = 0, const void* def_base = 0) const
|
||||
AZStd::string ToString(const void* base, FToString flags = 0, const void* def_base = 0) const
|
||||
{
|
||||
assert(!bBitfield);
|
||||
return Type.ToString((const char*)base + Offset, flags, def_base ? (const char*)def_base + Offset : 0);
|
||||
@@ -189,7 +188,7 @@ struct CTypeInfo
|
||||
// Attribute access. Not fast.
|
||||
bool GetAttr(cstr name) const;
|
||||
bool GetAttr(cstr name, float& val) const;
|
||||
bool GetAttr(cstr name, string& val) const;
|
||||
bool GetAttr(cstr name, AZStd::string& val) const;
|
||||
|
||||
// Comment, excluding attributes.
|
||||
cstr GetComment() const;
|
||||
|
||||
@@ -205,7 +205,7 @@ struct IRenderNode
|
||||
// Debug info about object.
|
||||
virtual const char* GetName() const = 0;
|
||||
virtual const char* GetEntityClassName() const = 0;
|
||||
virtual string GetDebugString([[maybe_unused]] char type = 0) const { return ""; }
|
||||
virtual AZStd::string GetDebugString([[maybe_unused]] char type = 0) const { return ""; }
|
||||
virtual float GetImportance() const { return 1.f; }
|
||||
|
||||
// Description:
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Color.h>
|
||||
#include <CryString.h>
|
||||
#include <smartptr.h>
|
||||
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
@@ -101,7 +100,7 @@ struct ICryFont
|
||||
// All font names separated by ,
|
||||
// Example:
|
||||
// "console,default,hud"
|
||||
virtual string GetLoadedFontNames() const = 0;
|
||||
virtual AZStd::string GetLoadedFontNames() const = 0;
|
||||
|
||||
//! \brief Called when the g_language (current language) setting changes.
|
||||
//!
|
||||
@@ -264,7 +263,7 @@ struct IFFont
|
||||
|
||||
// Description:
|
||||
// Wraps text based on specified maximum line width (UTF-8)
|
||||
virtual void WrapText(string& result, float maxWidth, const char* pStr, const STextDrawContext& ctx) = 0;
|
||||
virtual void WrapText(AZStd::string& result, float maxWidth, const char* pStr, const STextDrawContext& ctx) = 0;
|
||||
|
||||
// Description:
|
||||
// Puts the memory used by this font into the given sizer.
|
||||
@@ -338,7 +337,7 @@ struct FontFamily
|
||||
FontFamily& operator=(const FontFamily&) = delete;
|
||||
FontFamily& operator=(const FontFamily&&) = delete;
|
||||
|
||||
string familyName;
|
||||
AZStd::string familyName;
|
||||
IFFont* normal;
|
||||
IFFont* bold;
|
||||
IFFont* italic;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "Cry_Matrix33.h"
|
||||
#include "Cry_Color.h"
|
||||
#include "smartptr.h"
|
||||
#include "StringUtils.h"
|
||||
#include <IXml.h> // <> required for Interfuscator
|
||||
#include "smartptr.h"
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
@@ -1449,7 +1448,7 @@ struct IRenderer
|
||||
virtual const char* EF_GetShaderMissLogPath() = 0;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
virtual string* EF_GetShaderNames(int& nNumShaders) = 0;
|
||||
virtual AZStd::string* EF_GetShaderNames(int& nNumShaders) = 0;
|
||||
// Summary:
|
||||
// Reloads file
|
||||
virtual bool EF_ReloadFile (const char* szFileName) = 0;
|
||||
|
||||
@@ -179,28 +179,16 @@ struct SSerializeString
|
||||
void resize(int sz) { m_str.resize(sz); }
|
||||
void reserve(int sz) { m_str.reserve(sz); }
|
||||
|
||||
void set_string(const string& s)
|
||||
void set_string(const AZStd::string& s)
|
||||
{
|
||||
m_str.assign(s.begin(), s.size());
|
||||
}
|
||||
#if !defined(RESOURCE_COMPILER)
|
||||
void set_string(const CryStringLocal& s)
|
||||
{
|
||||
m_str.assign(s.begin(), s.size());
|
||||
}
|
||||
#endif
|
||||
template<size_t S>
|
||||
void set_string(const CryFixedStringT<S>& s)
|
||||
{
|
||||
m_str.assign(s.begin(), s.size());
|
||||
}
|
||||
|
||||
operator const string () const {
|
||||
operator const AZStd::string() const {
|
||||
return m_str;
|
||||
}
|
||||
|
||||
private:
|
||||
string m_str;
|
||||
AZStd::string m_str;
|
||||
};
|
||||
|
||||
// the ISerialize is intended to be implemented by objects that need
|
||||
@@ -308,7 +296,7 @@ public:
|
||||
m_pSerialize->Value(szName, value);
|
||||
}
|
||||
|
||||
void Value(const char* szName, string& value, int policy)
|
||||
void Value(const char* szName, AZStd::string& value, int policy)
|
||||
{
|
||||
if (IsWriting())
|
||||
{
|
||||
@@ -327,11 +315,11 @@ public:
|
||||
value = serializeString.c_str();
|
||||
}
|
||||
}
|
||||
ILINE void Value(const char* szName, string& value)
|
||||
ILINE void Value(const char* szName, AZStd::string& value)
|
||||
{
|
||||
Value(szName, value, 0);
|
||||
}
|
||||
void Value(const char* szName, const string& value, int policy)
|
||||
void Value(const char* szName, const AZStd::string& value, int policy)
|
||||
{
|
||||
if (IsWriting())
|
||||
{
|
||||
@@ -343,76 +331,7 @@ public:
|
||||
assert(0 && "This function can only be used for Writing");
|
||||
}
|
||||
}
|
||||
ILINE void Value(const char* szName, const string& value)
|
||||
{
|
||||
Value(szName, value, 0);
|
||||
}
|
||||
template <typename T>
|
||||
void Value(const char* szName, CryStringLocalT<T>& value, int policy)
|
||||
{
|
||||
if (IsWriting())
|
||||
{
|
||||
SSerializeString& serializeString = SetSharedSerializeString(value);
|
||||
m_pSerialize->WriteStringValue(szName, serializeString, policy);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetSerializationTarget() != eST_Script)
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
SSerializeString& serializeString = SetSharedSerializeString(value);
|
||||
m_pSerialize->ReadStringValue(szName, serializeString, policy);
|
||||
value = serializeString.c_str();
|
||||
}
|
||||
}
|
||||
template <typename T>
|
||||
ILINE void Value(const char* szName, CryStringLocalT<T>& value)
|
||||
{
|
||||
Value(szName, value, 0);
|
||||
}
|
||||
template <typename T>
|
||||
void Value(const char* szName, const CryStringLocalT<T>& value, int policy)
|
||||
{
|
||||
if (IsWriting())
|
||||
{
|
||||
SSerializeString& serializeString = SetSharedSerializeString(value);
|
||||
m_pSerialize->WriteStringValue(szName, serializeString, policy);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(0 && "This function can only be used for Writing");
|
||||
}
|
||||
}
|
||||
template <typename T>
|
||||
ILINE void Value(const char* szName, const CryStringLocalT<T>& value)
|
||||
{
|
||||
Value(szName, value, 0);
|
||||
}
|
||||
template<size_t S>
|
||||
void Value(const char* szName, CryFixedStringT<S>& value, int policy)
|
||||
{
|
||||
if (IsWriting())
|
||||
{
|
||||
SSerializeString& serializeString = SetSharedSerializeString(value);
|
||||
m_pSerialize->WriteStringValue(szName, serializeString, policy);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetSerializationTarget() != eST_Script)
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
SSerializeString& serializeString = SetSharedSerializeString(value);
|
||||
m_pSerialize->ReadStringValue(szName, serializeString, policy);
|
||||
assert(serializeString.length() <= S);
|
||||
value = serializeString.c_str();
|
||||
}
|
||||
}
|
||||
template<size_t S>
|
||||
ILINE void Value(const char* szName, CryFixedStringT<S>& value)
|
||||
ILINE void Value(const char* szName, const AZStd::string& value)
|
||||
{
|
||||
Value(szName, value, 0);
|
||||
}
|
||||
@@ -493,7 +412,7 @@ public:
|
||||
m_pSerialize->ValueWithDefault(name, x, defaultValue);
|
||||
}
|
||||
|
||||
void ValueWithDefault(const char* szName, string& value, const string& defaultValue)
|
||||
void ValueWithDefault(const char* szName, AZStd::string& value, const AZStd::string& defaultValue)
|
||||
{
|
||||
static SSerializeString defaultSerializeString;
|
||||
|
||||
@@ -919,34 +838,13 @@ public:
|
||||
return CSerializeWrapper<ISerialize>(m_pSerialize);
|
||||
}
|
||||
|
||||
SSerializeString& SetSharedSerializeString(const string& str)
|
||||
SSerializeString& SetSharedSerializeString(const AZStd::string& str)
|
||||
{
|
||||
static SSerializeString serializeString;
|
||||
serializeString.set_string(str);
|
||||
return serializeString;
|
||||
}
|
||||
|
||||
#if !defined(RESOURCE_COMPILER)
|
||||
SSerializeString& SetSharedSerializeString(const CryStringLocal& str)
|
||||
{
|
||||
|
||||
|
||||
static SSerializeString serializeString;
|
||||
serializeString.set_string(str);
|
||||
return serializeString;
|
||||
}
|
||||
#endif
|
||||
|
||||
template<size_t S>
|
||||
SSerializeString& SetSharedSerializeString(const CryFixedStringT<S>& str)
|
||||
{
|
||||
|
||||
|
||||
static SSerializeString serializeString;
|
||||
serializeString.set_string(str);
|
||||
return serializeString;
|
||||
}
|
||||
|
||||
private:
|
||||
TISerialize* m_pSerialize;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "Cry_Matrix33.h"
|
||||
#include "Cry_Color.h"
|
||||
#include "smartptr.h"
|
||||
#include "StringUtils.h"
|
||||
#include <IXml.h> // <> required for Interfuscator
|
||||
#include "smartptr.h"
|
||||
#include "VertexFormats.h"
|
||||
@@ -1394,12 +1393,12 @@ struct IRenderTarget
|
||||
struct STexSamplerFX
|
||||
{
|
||||
#if SHADER_REFLECT_TEXTURE_SLOTS
|
||||
string m_szUIName;
|
||||
string m_szUIDescription;
|
||||
AZStd::string m_szUIName;
|
||||
AZStd::string m_szUIDescription;
|
||||
#endif
|
||||
|
||||
string m_szName;
|
||||
string m_szTexture;
|
||||
AZStd::string m_szName;
|
||||
AZStd::string m_szTexture;
|
||||
|
||||
union
|
||||
{
|
||||
@@ -1708,7 +1707,7 @@ struct SEfResTextureExt
|
||||
//------------------------------------------------------------------------------
|
||||
struct SEfResTexture
|
||||
{
|
||||
string m_Name;
|
||||
AZStd::string m_Name;
|
||||
bool m_bUTile;
|
||||
bool m_bVTile;
|
||||
signed char m_Filter;
|
||||
@@ -1890,7 +1889,7 @@ struct SEfResTexture
|
||||
struct SBaseShaderResources
|
||||
{
|
||||
AZStd::vector<SShaderParam> m_ShaderParams;
|
||||
string m_TexturePath;
|
||||
AZStd::string m_TexturePath;
|
||||
const char* m_szMaterialName;
|
||||
|
||||
float m_AlphaRef;
|
||||
@@ -2146,8 +2145,8 @@ struct SShaderTextureSlot
|
||||
m_TexType = eTT_MaxTexType;
|
||||
}
|
||||
|
||||
string m_Name;
|
||||
string m_Description;
|
||||
AZStd::string m_Name;
|
||||
AZStd::string m_Description;
|
||||
byte m_TexType; // 2D, 3D, Cube etc..
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
@@ -2726,7 +2725,7 @@ protected:
|
||||
virtual ~ILightAnimWrapper() {}
|
||||
|
||||
protected:
|
||||
string m_name;
|
||||
AZStd::string m_name;
|
||||
IAnimNode* m_pNode;
|
||||
};
|
||||
|
||||
@@ -3256,12 +3255,12 @@ enum EGrNodeIOSemantic
|
||||
|
||||
struct SShaderGraphFunction
|
||||
{
|
||||
string m_Data;
|
||||
string m_Name;
|
||||
std::vector<string> inParams;
|
||||
std::vector<string> outParams;
|
||||
std::vector<string> szInTypes;
|
||||
std::vector<string> szOutTypes;
|
||||
AZStd::string m_Data;
|
||||
AZStd::string m_Name;
|
||||
std::vector<AZStd::string> inParams;
|
||||
std::vector<AZStd::string> outParams;
|
||||
std::vector<AZStd::string> szInTypes;
|
||||
std::vector<AZStd::string> szOutTypes;
|
||||
};
|
||||
|
||||
struct SShaderGraphNode
|
||||
@@ -3269,8 +3268,8 @@ struct SShaderGraphNode
|
||||
EGrNodeType m_eType;
|
||||
EGrNodeFormat m_eFormat;
|
||||
EGrNodeIOSemantic m_eSemantic;
|
||||
string m_CustomSemantics;
|
||||
string m_Name;
|
||||
AZStd::string m_CustomSemantics;
|
||||
AZStd::string m_Name;
|
||||
bool m_bEditable;
|
||||
bool m_bWasAdded;
|
||||
SShaderGraphFunction* m_pFunction;
|
||||
@@ -3296,7 +3295,7 @@ struct SShaderGraphBlock
|
||||
{
|
||||
EGrBlockType m_eType;
|
||||
EGrBlockSamplerType m_eSamplerType;
|
||||
string m_ClassName;
|
||||
AZStd::string m_ClassName;
|
||||
FXShaderGraphNodes m_Nodes;
|
||||
|
||||
~SShaderGraphBlock();
|
||||
|
||||
@@ -946,7 +946,7 @@ struct ISystem
|
||||
// If m_GraphicsSettingsMap is defined (in Graphics Settings Dialog box), fills in mapping based on sys_spec_Full
|
||||
// Arguments:
|
||||
// sPath - e.g. "Game/Config/CVarGroups"
|
||||
virtual void AddCVarGroupDirectory(const string& sPath) = 0;
|
||||
virtual void AddCVarGroupDirectory(const AZStd::string& sPath) = 0;
|
||||
|
||||
// Summary:
|
||||
// Saves system configuration.
|
||||
|
||||
@@ -94,12 +94,12 @@ void testXml(bool bReuseStrings)
|
||||
// Summary:
|
||||
// Special string wrapper for xml nodes.
|
||||
class XmlString
|
||||
: public string
|
||||
: public AZStd::string
|
||||
{
|
||||
public:
|
||||
XmlString() {};
|
||||
XmlString(const char* str)
|
||||
: string(str) {};
|
||||
: AZStd::string(str) {};
|
||||
|
||||
operator const char*() const {
|
||||
return c_str();
|
||||
|
||||
@@ -329,9 +329,6 @@ inline uint32 GetTickCount()
|
||||
|
||||
#define _wtof(str) wcstod(str, 0)
|
||||
|
||||
// Need to include this before using it's used in finddata, but after the strnicmp definition
|
||||
#include "CryString.h"
|
||||
|
||||
typedef struct __finddata64_t
|
||||
{
|
||||
//!< atributes set by find request
|
||||
|
||||
@@ -65,6 +65,5 @@ namespace AZ
|
||||
AZ_TYPE_INFO_SPECIALIZE(ColorF, "{63782551-A309-463B-A301-3A360800DF1E}");
|
||||
AZ_TYPE_INFO_SPECIALIZE(ColorB, "{6F0CC2C0-0CC6-4DBF-9297-B043F270E6A4}");
|
||||
AZ_TYPE_INFO_SPECIALIZE(Vec4, "{CAC9510C-8C00-41D4-BC4D-2C6A8136EB30}");
|
||||
AZ_TYPE_INFO_SPECIALIZE(CryStringT<char>, "{835199FB-292B-4DB3-BC7C-366E356300FA}");
|
||||
} // namespace AZ
|
||||
|
||||
|
||||
@@ -22,154 +22,6 @@
|
||||
|
||||
namespace LyShine
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Helper function to VersionConverter to convert a CryString field to an AZStd::String
|
||||
// Inline to avoid DLL linkage issues
|
||||
inline bool ConvertSubElementFromCryStringToAzString(
|
||||
AZ::SerializeContext& context,
|
||||
AZ::SerializeContext::DataElementNode& classElement,
|
||||
const char* subElementName)
|
||||
{
|
||||
int index = classElement.FindElement(AZ_CRC(subElementName));
|
||||
if (index != -1)
|
||||
{
|
||||
AZ::SerializeContext::DataElementNode& elementNode = classElement.GetSubElement(index);
|
||||
|
||||
CryStringT<char> oldData;
|
||||
|
||||
if (!elementNode.GetData(oldData))
|
||||
{
|
||||
// Error, old subElement was not a string or not valid
|
||||
AZ_Error("Serialization", false, "Cannot get string data for element %s.", subElementName);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove old version.
|
||||
classElement.RemoveElement(index);
|
||||
|
||||
// Add a new element for the new data.
|
||||
int newElementIndex = classElement.AddElement<AZStd::string>(context, subElementName);
|
||||
if (newElementIndex == -1)
|
||||
{
|
||||
// Error adding the new sub element
|
||||
AZ_Error("Serialization", false, "AddElement failed for converted element %s", subElementName);
|
||||
return false;
|
||||
}
|
||||
|
||||
AZStd::string newData(oldData.c_str());
|
||||
classElement.GetSubElement(newElementIndex).SetData(context, newData);
|
||||
}
|
||||
|
||||
// if the field did not exist then we do not report an error
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Helper function to VersionConverter to convert a CryString field to a char
|
||||
// Inline to avoid DLL linkage issues
|
||||
inline bool ConvertSubElementFromCryStringToChar(
|
||||
AZ::SerializeContext& context,
|
||||
AZ::SerializeContext::DataElementNode& classElement,
|
||||
const char* subElementName,
|
||||
char defaultValue)
|
||||
{
|
||||
int index = classElement.FindElement(AZ_CRC(subElementName));
|
||||
if (index != -1)
|
||||
{
|
||||
AZ::SerializeContext::DataElementNode& elementNode = classElement.GetSubElement(index);
|
||||
|
||||
CryStringT<char> oldData;
|
||||
|
||||
if (!elementNode.GetData(oldData))
|
||||
{
|
||||
// Error, old subElement was not a CryString
|
||||
AZ_Error("Serialization", false, "Element %s is not a CryString.", subElementName);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove old version.
|
||||
classElement.RemoveElement(index);
|
||||
|
||||
// Add a new element for the new data.
|
||||
int newElementIndex = classElement.AddElement<char>(context, subElementName);
|
||||
if (newElementIndex == -1)
|
||||
{
|
||||
// Error adding the new sub element
|
||||
AZ_Error("Serialization", false, "AddElement failed for converted element %s", subElementName);
|
||||
return false;
|
||||
}
|
||||
|
||||
char newData = (oldData.empty()) ? defaultValue : oldData[0];
|
||||
classElement.GetSubElement(newElementIndex).SetData(context, newData);
|
||||
}
|
||||
|
||||
// if the field did not exist then we do not report an error
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Helper function to VersionConverter to convert a CryString field to a simple asset reference
|
||||
// Inline to avoid DLL linkage issues
|
||||
template<typename T>
|
||||
inline bool ConvertSubElementFromCryStringToAssetRef(
|
||||
AZ::SerializeContext& context,
|
||||
AZ::SerializeContext::DataElementNode& classElement,
|
||||
const char* subElementName)
|
||||
{
|
||||
int index = classElement.FindElement(AZ_CRC(subElementName));
|
||||
if (index != -1)
|
||||
{
|
||||
AZ::SerializeContext::DataElementNode& elementNode = classElement.GetSubElement(index);
|
||||
|
||||
CryStringT<char> oldData;
|
||||
|
||||
if (!elementNode.GetData(oldData))
|
||||
{
|
||||
// Error, old subElement was not a CryString
|
||||
AZ_Error("Serialization", false, "Element %s is not a CryString.", subElementName);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove old version.
|
||||
classElement.RemoveElement(index);
|
||||
|
||||
// Add a new element for the new data.
|
||||
int simpleAssetRefIndex = classElement.AddElement<AzFramework::SimpleAssetReference<T> >(context, subElementName);
|
||||
if (simpleAssetRefIndex == -1)
|
||||
{
|
||||
// Error adding the new sub element
|
||||
AZ_Error("Serialization", false, "AddElement failed for simpleAssetRefIndex %s", subElementName);
|
||||
return false;
|
||||
}
|
||||
|
||||
// add a sub element for the SimpleAssetReferenceBase within the SimpleAssetReference
|
||||
AZ::SerializeContext::DataElementNode& simpleAssetRefNode = classElement.GetSubElement(simpleAssetRefIndex);
|
||||
int simpleAssetRefBaseIndex = simpleAssetRefNode.AddElement<AzFramework::SimpleAssetReferenceBase>(context, "BaseClass1");
|
||||
if (simpleAssetRefBaseIndex == -1)
|
||||
{
|
||||
// Error adding the new sub element
|
||||
AZ_Error("Serialization", false, "AddElement failed for converted element BaseClass1");
|
||||
return false;
|
||||
}
|
||||
|
||||
// add a sub element for the AssetPath within the SimpleAssetReference
|
||||
AZ::SerializeContext::DataElementNode& simpleAssetRefBaseNode = simpleAssetRefNode.GetSubElement(simpleAssetRefBaseIndex);
|
||||
int assetPathElementIndex = simpleAssetRefBaseNode.AddElement<AZStd::string>(context, "AssetPath");
|
||||
if (assetPathElementIndex == -1)
|
||||
{
|
||||
// Error adding the new sub element
|
||||
AZ_Error("Serialization", false, "AddElement failed for converted element AssetPath");
|
||||
return false;
|
||||
}
|
||||
|
||||
AZStd::string newData(oldData.c_str());
|
||||
simpleAssetRefBaseNode.GetSubElement(assetPathElementIndex).SetData(context, newData);
|
||||
}
|
||||
|
||||
// if the field did not exist then we do not report an error
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Helper function to VersionConverter to convert an AZStd::string field to a simple asset reference
|
||||
// Inline to avoid DLL linkage issues
|
||||
|
||||
@@ -494,7 +494,7 @@ namespace stl
|
||||
|
||||
//! Specialization of string to const char cast.
|
||||
template <>
|
||||
inline const char* constchar_cast(const string& type)
|
||||
inline const char* constchar_cast(const AZStd::string& type)
|
||||
{
|
||||
return type.c_str();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Meta-type support.
|
||||
@@ -55,7 +56,7 @@ inline const CTypeInfo& TypeInfo(const T* t)
|
||||
|
||||
// Type info declaration, with additional prototypes for string conversions.
|
||||
#define BASIC_TYPE_INFO(Type) \
|
||||
string ToString(Type const & val); \
|
||||
AZStd::string ToString(Type const & val); \
|
||||
bool FromString(Type & val, const char* s); \
|
||||
DECLARE_TYPE_INFO(Type)
|
||||
|
||||
@@ -105,7 +106,7 @@ BASIC_TYPE_INFO(double)
|
||||
|
||||
BASIC_TYPE_INFO(AZ::Uuid)
|
||||
|
||||
DECLARE_TYPE_INFO(string)
|
||||
DECLARE_TYPE_INFO(AZStd::string)
|
||||
|
||||
// All pointers share same TypeInfo.
|
||||
const CTypeInfo&PtrTypeInfo();
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
//
|
||||
// (At least) the following string types can be bound with these helper functions:
|
||||
// Types Input Output Null-Terminator
|
||||
// CryStringT<T>, (::string, ::wstring): yes yes implied by type (also Stack and Fixed variants)
|
||||
// std::basic_string<T>, std::string, std::wstring: yes yes implied by type
|
||||
// QString: yes yes implied by type
|
||||
// std::vector<T>, std::list<T>, std::deque<T>: yes yes not present
|
||||
@@ -56,18 +55,14 @@
|
||||
// Forward declare the supported types.
|
||||
// Before actually instantiating a binding however, you need to have the full definition included.
|
||||
// Also, this allows us to work with QChar/QString as declared names without a dependency on Qt.
|
||||
template<typename T, size_t S>
|
||||
class CryStackStringT;
|
||||
template<size_t S>
|
||||
class CryFixedStringT;
|
||||
template<size_t S>
|
||||
class CryFixedWStringT;
|
||||
template<typename T>
|
||||
class CryStringLocalT;
|
||||
template<typename T>
|
||||
class CryStringT;
|
||||
namespace AZStd
|
||||
{
|
||||
template<class Element, size_t MaxElementCount, class Traits>
|
||||
class basic_fixed_string;
|
||||
}
|
||||
class QChar;
|
||||
class QString;
|
||||
|
||||
namespace Unicode
|
||||
{
|
||||
namespace Detail
|
||||
@@ -253,36 +248,15 @@ namespace Unicode
|
||||
static const bool isValid = SValidChar<T, InferEncoding, true>::value;
|
||||
static const EBind value = isValid ? eBind_Iterators : eBind_Impossible;
|
||||
};
|
||||
template<typename T, bool InferEncoding>
|
||||
struct SBindObject<CryStringT<T>, InferEncoding>
|
||||
{
|
||||
typedef typename add_const<T>::type CharType;
|
||||
static const bool isValid = SValidChar<T, InferEncoding, true>::value;
|
||||
static const EBind value = isValid ? eBind_Data : eBind_Impossible;
|
||||
};
|
||||
template<typename T, bool InferEncoding>
|
||||
struct SBindObject<CryStringLocalT<T>, InferEncoding>
|
||||
{
|
||||
typedef typename add_const<T>::type CharType;
|
||||
static const bool isValid = SValidChar<T, InferEncoding, true>::value;
|
||||
static const EBind value = isValid ? eBind_Data : eBind_Impossible;
|
||||
};
|
||||
template<typename T, size_t S, bool InferEncoding>
|
||||
struct SBindObject<CryStackStringT<T, S>, InferEncoding>
|
||||
struct SBindObject<AZStd::basic_fixed_string<T, S>, InferEncoding>
|
||||
{
|
||||
typedef typename add_const<T>::type CharType;
|
||||
static const bool isValid = SValidChar<T, InferEncoding, true>::value;
|
||||
static const EBind value = isValid ? eBind_Data : eBind_Impossible;
|
||||
};
|
||||
template<size_t S, bool InferEncoding>
|
||||
struct SBindObject<CryFixedStringT<S>, InferEncoding>
|
||||
{
|
||||
typedef char CharType;
|
||||
static const bool isValid = SValidChar<CharType, InferEncoding, true>::value;
|
||||
static const EBind value = isValid ? eBind_Data : eBind_Impossible;
|
||||
};
|
||||
template<size_t S, bool InferEncoding>
|
||||
struct SBindObject<CryFixedWStringT<S>, InferEncoding>
|
||||
struct SBindObject<AZStd::fixed_wstring<S>, InferEncoding>
|
||||
{
|
||||
typedef wchar_t CharType;
|
||||
static const bool isValid = SValidChar<CharType, InferEncoding, true>::value;
|
||||
@@ -348,22 +322,8 @@ namespace Unicode
|
||||
static const bool isValid = SValidChar<T, InferEncoding, false>::value;
|
||||
static const EBind value = isValid ? eBind_Iterators : eBind_Impossible;
|
||||
};
|
||||
template<typename T, bool InferEncoding>
|
||||
struct SBindOutput<CryStringT<T>, InferEncoding>
|
||||
{
|
||||
typedef T CharType;
|
||||
static const bool isValid = SValidChar<T, InferEncoding, false>::value;
|
||||
static const EBind value = isValid ? eBind_Data : eBind_Impossible;
|
||||
};
|
||||
template<typename T, bool InferEncoding>
|
||||
struct SBindOutput<CryStringLocalT<T>, InferEncoding>
|
||||
{
|
||||
typedef T CharType;
|
||||
static const bool isValid = SValidChar<T, InferEncoding, false>::value;
|
||||
static const EBind value = isValid ? eBind_Data : eBind_Impossible;
|
||||
};
|
||||
template<typename T, size_t S, bool InferEncoding>
|
||||
struct SBindOutput<CryStackStringT<T, S>, InferEncoding>
|
||||
struct SBindOutput<AZStd::basic_fixed_string<T, S>, InferEncoding>
|
||||
{
|
||||
typedef T CharType;
|
||||
static const bool isValid = SValidChar<T, InferEncoding, false>::value;
|
||||
|
||||
@@ -486,7 +486,7 @@ void _splitpath(const char* inpath, char* drv, char* dir, char* fname, char* ext
|
||||
drv[0] = 0;
|
||||
}
|
||||
|
||||
typedef CryStackStringT<char, AZ_MAX_PATH_LEN> path_stack_string;
|
||||
typedef AZStd::fixed_string<AZ_MAX_PATH_LEN> path_stack_string;
|
||||
|
||||
const path_stack_string inPath(inpath);
|
||||
string::size_type s = inPath.rfind('/', inPath.size());//position of last /
|
||||
|
||||
@@ -78,7 +78,6 @@ set(FILES
|
||||
CryCrc32.h
|
||||
CryCustomTypes.h
|
||||
CryFile.h
|
||||
CryFixedString.h
|
||||
CryHeaders.h
|
||||
CryHeaders_info.cpp
|
||||
CryListenerSet.h
|
||||
@@ -87,7 +86,6 @@ set(FILES
|
||||
CryPath.h
|
||||
CryPodArray.h
|
||||
CrySizer.h
|
||||
CryString.h
|
||||
CrySystemBus.h
|
||||
CryThread.h
|
||||
CryThreadImpl.h
|
||||
@@ -111,7 +109,6 @@ set(FILES
|
||||
SimpleSerialize.h
|
||||
smartptr.h
|
||||
StlUtils.h
|
||||
StringUtils.h
|
||||
Synchronization.h
|
||||
Tarray.h
|
||||
Timer.h
|
||||
|
||||
@@ -689,9 +689,6 @@ void SetFlags(T& dest, U flags, bool b)
|
||||
#include AZ_RESTRICTED_FILE(platform_h)
|
||||
#endif
|
||||
|
||||
// Platform wrappers must be included before CryString.h
|
||||
# include "CryString.h"
|
||||
|
||||
// Include support for meta-type data.
|
||||
#include "TypeInfo_decl.h"
|
||||
|
||||
@@ -701,12 +698,6 @@ void SetFlags(T& dest, U flags, bool b)
|
||||
bool CrySetFileAttributes(const char* lpFileName, uint32 dwFileAttributes);
|
||||
threadID CryGetCurrentThreadId();
|
||||
|
||||
#if !defined(NOT_USE_CRY_STRING)
|
||||
// Fixed-Sized (stack based string)
|
||||
// put after the platform wrappers because of missing wcsicmp/wcsnicmp functions
|
||||
#include "CryFixedString.h"
|
||||
#endif
|
||||
|
||||
// need this in a common header file and any other file would be too misleading
|
||||
enum ETriState
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
|
||||
#include <platform.h>
|
||||
#include <StringUtils.h>
|
||||
#include <ISystem.h>
|
||||
#include <Random.h>
|
||||
#include <UnicodeFunctions.h>
|
||||
@@ -248,10 +247,7 @@ int CryMessageBox([[maybe_unused]] const char* lpText, [[maybe_unused]] const ch
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
wstring wideText, wideCaption;
|
||||
Unicode::Convert(wideText, lpText);
|
||||
Unicode::Convert(wideCaption, lpCaption);
|
||||
return MessageBoxW(NULL, wideText.c_str(), wideCaption.c_str(), uType);
|
||||
return MessageBox(NULL, lpText, lpCaption, uType);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "CmdLine.h"
|
||||
|
||||
|
||||
void CCmdLine::PushCommand(const string& sCommand, const string& sParameter)
|
||||
void CCmdLine::PushCommand(const AZStd::string& sCommand, const AZStd::string& sParameter)
|
||||
{
|
||||
if (sCommand.empty())
|
||||
{
|
||||
@@ -47,7 +47,7 @@ CCmdLine::CCmdLine(const char* commandLine)
|
||||
|
||||
char* src = (char*)commandLine;
|
||||
|
||||
string command, parameter;
|
||||
AZStd::string command, parameter;
|
||||
|
||||
for (;; )
|
||||
{
|
||||
@@ -56,12 +56,12 @@ CCmdLine::CCmdLine(const char* commandLine)
|
||||
break;
|
||||
}
|
||||
|
||||
string arg = Next(src);
|
||||
AZStd::string arg = Next(src);
|
||||
|
||||
if (m_args.empty())
|
||||
{
|
||||
// this is the filename, convert backslash to forward slash
|
||||
arg.replace('\\', '/');
|
||||
AZ::StringFunc::Replace(arg, '\\', '/');
|
||||
m_args.push_back(CCmdLineArg("filename", arg.c_str(), eCLAT_Executable));
|
||||
}
|
||||
else
|
||||
@@ -90,7 +90,7 @@ CCmdLine::CCmdLine(const char* commandLine)
|
||||
}
|
||||
else
|
||||
{
|
||||
parameter += string(" ") + arg;
|
||||
parameter += AZStd::string(" ") + arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ const ICmdLineArg* CCmdLine::FindArg(const ECmdLineArgType ArgType, const char*
|
||||
}
|
||||
|
||||
|
||||
string CCmdLine::Next(char*& src)
|
||||
AZStd::string CCmdLine::Next(char*& src)
|
||||
{
|
||||
char ch = 0;
|
||||
char* org = src;
|
||||
@@ -170,7 +170,7 @@ string CCmdLine::Next(char*& src)
|
||||
;
|
||||
}
|
||||
|
||||
return string(org, src - 1);
|
||||
return AZStd::string(org, src - 1);
|
||||
|
||||
case '[':
|
||||
org = src;
|
||||
@@ -178,7 +178,7 @@ string CCmdLine::Next(char*& src)
|
||||
{
|
||||
;
|
||||
}
|
||||
return string(org, src - 1);
|
||||
return AZStd::string(org, src - 1);
|
||||
|
||||
case ' ':
|
||||
ch = *src++;
|
||||
@@ -190,12 +190,12 @@ string CCmdLine::Next(char*& src)
|
||||
;
|
||||
}
|
||||
|
||||
return string(org, src);
|
||||
return AZStd::string(org, src);
|
||||
}
|
||||
ch = *src++;
|
||||
}
|
||||
|
||||
return string();
|
||||
return AZStd::string();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -430,18 +430,18 @@ void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex)
|
||||
{
|
||||
const char* const szMessage = m_bIsFatalError ? s_szFatalErrorCode : m_szBugMessage;
|
||||
excName = szMessage;
|
||||
cry_strcpy(excCode, szMessage);
|
||||
cry_strcpy(excAddr, "");
|
||||
cry_strcpy(desc, "");
|
||||
cry_strcpy(m_excModule, "");
|
||||
cry_strcpy(excDesc, szMessage);
|
||||
azstrcpy(excCode, szMessage);
|
||||
azstrcpy(excAddr, "");
|
||||
azstrcpy(desc, "");
|
||||
azstrcpy(m_excModule, "");
|
||||
azstrcpy(excDesc, szMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf_s(excAddr, "0x%04X:0x%p", pex->ContextRecord->SegCs, pex->ExceptionRecord->ExceptionAddress);
|
||||
sprintf_s(excCode, "0x%08X", pex->ExceptionRecord->ExceptionCode);
|
||||
excName = TranslateExceptionCode(pex->ExceptionRecord->ExceptionCode);
|
||||
cry_strcpy(desc, "");
|
||||
azstrcpy(desc, "");
|
||||
sprintf_s(excDesc, "%s\r\n%s", excName, desc);
|
||||
|
||||
|
||||
@@ -471,9 +471,9 @@ void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex)
|
||||
WriteLineToLog("Exception Description: %s", desc);
|
||||
|
||||
|
||||
cry_strcpy(m_excDesc, excDesc);
|
||||
cry_strcpy(m_excAddr, excAddr);
|
||||
cry_strcpy(m_excCode, excCode);
|
||||
azstrcpy(m_excDesc, excDesc);
|
||||
azstrcpy(m_excAddr, excAddr);
|
||||
azstrcpy(m_excCode, excCode);
|
||||
|
||||
|
||||
char errs[32768];
|
||||
@@ -499,7 +499,7 @@ void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex)
|
||||
dumpCallStack(funcs);
|
||||
// Fill call stack.
|
||||
char str[s_iCallStackSize];
|
||||
cry_strcpy(str, "");
|
||||
azstrcpy(str, "");
|
||||
for (unsigned int i = 0; i < funcs.size(); i++)
|
||||
{
|
||||
char temp[s_iCallStackSize];
|
||||
@@ -509,7 +509,7 @@ void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex)
|
||||
cry_strcat(errs, temp);
|
||||
cry_strcat(errs, "\n");
|
||||
}
|
||||
cry_strcpy(m_excCallstack, str);
|
||||
azstrcpy(m_excCallstack, str);
|
||||
}
|
||||
|
||||
cry_strcat(errorString, errs);
|
||||
|
||||
@@ -567,7 +567,7 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
|
||||
INDENT_LOG_DURING_SCOPE();
|
||||
|
||||
char levelName[256];
|
||||
cry_strcpy(levelName, _levelName);
|
||||
azstrcpy(levelName, _levelName);
|
||||
|
||||
// Not remove a scope!!!
|
||||
{
|
||||
|
||||
@@ -528,7 +528,7 @@ static void CopyLowercase(char* dst, size_t dstSize, const char* src, size_t src
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static void ReplaceEndOfLine(CryFixedStringT<CLocalizedStringsManager::LOADING_FIXED_STRING_LENGTH>& s)
|
||||
static void ReplaceEndOfLine(AZStd::fixed_string<CLocalizedStringsManager::LOADING_FIXED_STRING_LENGTH>& s)
|
||||
{
|
||||
const string oldSubstr("\\n");
|
||||
const string newSubstr(" \n");
|
||||
@@ -536,7 +536,7 @@ static void ReplaceEndOfLine(CryFixedStringT<CLocalizedStringsManager::LOADING_F
|
||||
for (;; )
|
||||
{
|
||||
pos = s.find(oldSubstr, pos);
|
||||
if (pos == CryFixedStringT<CLocalizedStringsManager::LOADING_FIXED_STRING_LENGTH>::npos)
|
||||
if (pos == AZStd::fixed_string<CLocalizedStringsManager::LOADING_FIXED_STRING_LENGTH>::npos)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -955,7 +955,7 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
|
||||
|
||||
bool bFirstRow = true;
|
||||
|
||||
CryFixedStringT<LOADING_FIXED_STRING_LENGTH> sTmp;
|
||||
AZStd::fixed_string<LOADING_FIXED_STRING_LENGTH> sTmp;
|
||||
|
||||
// lower case event name
|
||||
char szLowerCaseEvent[128];
|
||||
@@ -1609,7 +1609,7 @@ bool CLocalizedStringsManager::DoLoadAGSXmlDocument(const char* sFileName, uint8
|
||||
{
|
||||
continue;
|
||||
}
|
||||
AzFramework::StringFunc::Replace(textValue, "\\n", " \n"); // carried over from helper func ReplaceEndOfLine(CryFixedStringT<>& s)
|
||||
AzFramework::StringFunc::Replace(textValue, "\\n", " \n");
|
||||
if (keyString[0] == '@')
|
||||
{
|
||||
AzFramework::StringFunc::LChop(keyString, 1);
|
||||
@@ -2536,7 +2536,7 @@ void CLocalizedStringsManager::LocalizeNumber(int number, string& outNumberStrin
|
||||
|
||||
int n = abs(number);
|
||||
string separator;
|
||||
CryFixedStringT<64> tmp;
|
||||
AZStd::fixed_string<64> tmp;
|
||||
LocalizeString_ch("@ui_thousand_separator", separator);
|
||||
while (n > 0)
|
||||
{
|
||||
@@ -2565,7 +2565,7 @@ void CLocalizedStringsManager::LocalizeNumber_Decimal(float number, int decimals
|
||||
{
|
||||
if (number == 0.0f)
|
||||
{
|
||||
CryFixedStringT<64> tmp;
|
||||
AZStd::fixed_string<64> tmp;
|
||||
tmp.Format("%.*f", decimals, number);
|
||||
outNumberString.assign(tmp.c_str());
|
||||
return;
|
||||
@@ -2585,7 +2585,7 @@ void CLocalizedStringsManager::LocalizeNumber_Decimal(float number, int decimals
|
||||
|
||||
int decimalsAsInt = aznumeric_cast<int>(int_round(decimalsOnly * pow(10.0f, decimals)));
|
||||
|
||||
CryFixedStringT<64> tmp;
|
||||
AZStd::fixed_string<64> tmp;
|
||||
tmp.Format("%s%s%0*d", intPart.c_str(), commaSeparator.c_str(), decimals, decimalsAsInt);
|
||||
|
||||
outNumberString.assign(tmp.c_str());
|
||||
@@ -2657,7 +2657,7 @@ void CLocalizedStringsManager::LocalizeTime(time_t t, bool bMakeLocalTime, bool
|
||||
if (len > 0)
|
||||
{
|
||||
// len includes terminating null!
|
||||
CryFixedWStringT<256> tmpString;
|
||||
AZStd::fixed_wstring<256> tmpString;
|
||||
tmpString.resize(len);
|
||||
::GetTimeFormatW(lcID, flags, &systemTime, 0, (wchar_t*) tmpString.c_str(), len);
|
||||
Unicode::Convert(outTimeString, tmpString);
|
||||
@@ -2678,7 +2678,7 @@ void CLocalizedStringsManager::LocalizeDate(time_t t, bool bMakeLocalTime, bool
|
||||
UnixTimeToSystemTime(t, &systemTime);
|
||||
|
||||
// len includes terminating null!
|
||||
CryFixedWStringT<256> tmpString;
|
||||
AZStd::fixed_wstring<256> tmpString;
|
||||
|
||||
if (bIncludeWeekday)
|
||||
{
|
||||
|
||||
@@ -509,7 +509,7 @@ void CLog::LogV(const ELogType type, [[maybe_unused]]int flags, const char* szFo
|
||||
stack_string s = szBuffer;
|
||||
s += "\t<Scope> ";
|
||||
s += sAssetScope;
|
||||
cry_strcpy(szBuffer, s.c_str());
|
||||
azstrcpy(szBuffer, s.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,7 +863,7 @@ bool CLog::LogToMainThread(const char* szString, ELogType logType, bool bAdd, SL
|
||||
{
|
||||
// When logging from other thread then main, push all log strings to queue.
|
||||
SLogMsg msg;
|
||||
cry_strcpy(msg.msg, szString);
|
||||
azstrcpy(msg.msg, szString);
|
||||
msg.bAdd = bAdd;
|
||||
msg.destination = destination;
|
||||
msg.logType = logType;
|
||||
@@ -1286,7 +1286,7 @@ void CLog::CreateBackupFile() const
|
||||
|
||||
string bakdest = PathUtil::Make(LOG_BACKUP_PATH, sFileWithoutExt + sBackupNameAttachment + "." + sExt);
|
||||
fileSystem->CreatePath(LOG_BACKUP_PATH);
|
||||
cry_strcpy(m_sBackupFilename, bakdest.c_str());
|
||||
azstrcpy(m_sBackupFilename, bakdest.c_str());
|
||||
// Remove any existing backup file with the same name first since the copy will fail otherwise.
|
||||
fileSystem->Remove(m_sBackupFilename);
|
||||
fileSystem->Copy(m_szFilename, bakdest);
|
||||
|
||||
@@ -37,7 +37,7 @@ class CLog
|
||||
{
|
||||
public:
|
||||
typedef std::list<ILogCallback*> Callbacks;
|
||||
typedef CryStackStringT<char, MAX_TEMP_LENGTH_SIZE> LogStringType;
|
||||
typedef AZStd::fixed_string<MAX_TEMP_LENGTH_SIZE> LogStringType;
|
||||
|
||||
// constructor
|
||||
CLog(ISystem* pSystem);
|
||||
|
||||
@@ -1190,7 +1190,7 @@ void CSystem::WarningV(EValidatorModule module, EValidatorSeverity severity, int
|
||||
|
||||
if (file && *file)
|
||||
{
|
||||
CryFixedStringT<MAX_WARNING_LENGTH> fmt = szBuffer;
|
||||
AZStd::fixed_string<MAX_WARNING_LENGTH> fmt = szBuffer;
|
||||
fmt += " [File=";
|
||||
fmt += file;
|
||||
fmt += "]";
|
||||
|
||||
@@ -127,7 +127,7 @@ const char* CSystem::GetUserName()
|
||||
DWORD dwSize = iNameBufferSize;
|
||||
wchar_t nameW[iNameBufferSize];
|
||||
::GetUserNameW(nameW, &dwSize);
|
||||
cry_strcpy(szNameBuffer, CryStringUtils::WStrToUTF8(nameW));
|
||||
azstrcpy(szNameBuffer, CryStringUtils::WStrToUTF8(nameW));
|
||||
return szNameBuffer;
|
||||
#else
|
||||
#if defined(LINUX)
|
||||
@@ -283,7 +283,7 @@ static const char* GetLastSystemErrorMessage()
|
||||
0,
|
||||
NULL))
|
||||
{
|
||||
cry_strcpy(szBuffer, (char*)lpMsgBuf);
|
||||
azstrcpy(szBuffer, (char*)lpMsgBuf);
|
||||
LocalFree(lpMsgBuf);
|
||||
}
|
||||
else
|
||||
@@ -505,7 +505,9 @@ bool CSystem::GetWinGameFolder(char* szMyDocumentsPath, int maxPathSize)
|
||||
if (bSucceeded)
|
||||
{
|
||||
// Convert from UNICODE to UTF-8
|
||||
cry_strcpy(szMyDocumentsPath, maxPathSize, CryStringUtils::WStrToUTF8(wMyDocumentsPath));
|
||||
AZStd::string str;
|
||||
AZStd::to_string(str, AZStd::wstring(wMyDocumentsPath));
|
||||
azstrcpy(szMyDocumentsPath, maxPathSize, str.c_str());
|
||||
CoTaskMemFree(wMyDocumentsPath);
|
||||
}
|
||||
}
|
||||
@@ -519,7 +521,9 @@ bool CSystem::GetWinGameFolder(char* szMyDocumentsPath, int maxPathSize)
|
||||
bSucceeded = SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, 0, wMyDocumentsPath));
|
||||
if (bSucceeded)
|
||||
{
|
||||
cry_strcpy(szMyDocumentsPath, maxPathSize, CryStringUtils::WStrToUTF8(wMyDocumentsPath));
|
||||
AZStd::string str;
|
||||
AZStd::to_string(str, AZStd::wstring(wMyDocumentsPath));
|
||||
azstrcpy(szMyDocumentsPath, maxPathSize, str.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1554,7 +1554,7 @@ const char* CXConsole::GetFlagsString(const uint32 dwFlags)
|
||||
// hiding this makes it a bit more difficult for cheaters
|
||||
// if(dwFlags&VF_CHEAT) cry_strcat( sFlags,"CHEAT, ");
|
||||
|
||||
cry_strcpy(sFlags, "");
|
||||
azstrcpy(sFlags, "");
|
||||
|
||||
if (dwFlags & VF_READONLY)
|
||||
{
|
||||
|
||||
@@ -42,11 +42,11 @@ enum ScrollDir
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct CConsoleCommand
|
||||
{
|
||||
string m_sName; // Console command name
|
||||
string m_sCommand; // lua code that is executed when this command is invoked
|
||||
string m_sHelp; // optional help string - can be shown in the console with "<commandname> ?"
|
||||
int m_nFlags; // bitmask consist of flag starting with VF_ e.g. VF_CHEAT
|
||||
ConsoleCommandFunc m_func; // Pointer to console command.
|
||||
AZStd::string m_sName; // Console command name
|
||||
AZStd::string m_sCommand; // lua code that is executed when this command is invoked
|
||||
AZStd::string m_sHelp; // optional help string - can be shown in the console with "<commandname> ?"
|
||||
int m_nFlags; // bitmask consist of flag starting with VF_ e.g. VF_CHEAT
|
||||
ConsoleCommandFunc m_func; // Pointer to console command.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CConsoleCommand()
|
||||
@@ -67,7 +67,7 @@ struct CConsoleCommand
|
||||
struct CConsoleCommandArgs
|
||||
: public IConsoleCmdArgs
|
||||
{
|
||||
CConsoleCommandArgs(string& line, std::vector<string>& args)
|
||||
CConsoleCommandArgs(AZStd::string& line, std::vector<AZStd::string>& args)
|
||||
: m_line(line)
|
||||
, m_args(args) {};
|
||||
virtual int GetArgCount() const { return m_args.size(); };
|
||||
@@ -87,8 +87,8 @@ struct CConsoleCommandArgs
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<string>& m_args;
|
||||
string& m_line;
|
||||
std::vector<AZStd::string>& m_args;
|
||||
AZStd::string& m_line;
|
||||
};
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ class CXConsole
|
||||
, public AzFramework::CommandRegistrationBus::Handler
|
||||
{
|
||||
public:
|
||||
typedef std::deque<string> ConsoleBuffer;
|
||||
typedef std::deque<AZStd::string> ConsoleBuffer;
|
||||
typedef ConsoleBuffer::iterator ConsoleBufferItor;
|
||||
typedef ConsoleBuffer::reverse_iterator ConsoleBufferRItor;
|
||||
|
||||
@@ -262,7 +262,7 @@ protected: // ------------------------------------------------------------------
|
||||
void AddInputUTF8(const AZStd::string& textUTF8);
|
||||
void RemoveInputChar(bool bBackSpace);
|
||||
void ExecuteInputBuffer();
|
||||
void ExecuteCommand(CConsoleCommand& cmd, string& params, bool bIgnoreDevMode = false);
|
||||
void ExecuteCommand(CConsoleCommand& cmd, AZStd::string& params, bool bIgnoreDevMode = false);
|
||||
|
||||
void ScrollConsole();
|
||||
|
||||
@@ -294,7 +294,7 @@ protected: // ------------------------------------------------------------------
|
||||
|
||||
// Arguments:
|
||||
// bFromConsole - true=from console, false=from outside
|
||||
void SplitCommands(const char* line, std::list<string>& split);
|
||||
void SplitCommands(const char* line, std::list<AZStd::string>& split);
|
||||
void ExecuteStringInternal(const char* command, const bool bFromConsole, const bool bSilentMode = false);
|
||||
void ExecuteDeferredCommands();
|
||||
|
||||
@@ -320,27 +320,27 @@ private: // ----------------------------------------------------------
|
||||
|
||||
void PostLine(const char* lineOfText, size_t len);
|
||||
|
||||
typedef std::map<string, CConsoleCommand, string_nocase_lt> ConsoleCommandsMap;
|
||||
typedef std::map<AZStd::string, CConsoleCommand, string_nocase_lt> ConsoleCommandsMap;
|
||||
typedef ConsoleCommandsMap::iterator ConsoleCommandsMapItor;
|
||||
|
||||
typedef std::map<string, string> ConsoleBindsMap;
|
||||
typedef std::map<AZStd::string, AZStd::string> ConsoleBindsMap;
|
||||
typedef ConsoleBindsMap::iterator ConsoleBindsMapItor;
|
||||
|
||||
typedef std::map<string, IConsoleArgumentAutoComplete*, stl::less_stricmp<string> > ArgumentAutoCompleteMap;
|
||||
typedef std::map<AZStd::string, IConsoleArgumentAutoComplete*, stl::less_stricmp<AZStd::string> > ArgumentAutoCompleteMap;
|
||||
|
||||
struct SConfigVar
|
||||
{
|
||||
string m_value;
|
||||
AZStd::string m_value;
|
||||
bool m_partOfGroup;
|
||||
};
|
||||
typedef std::map<string, SConfigVar, string_nocase_lt> ConfigVars;
|
||||
typedef std::map<AZStd::string, SConfigVar, string_nocase_lt> ConfigVars;
|
||||
|
||||
struct SDeferredCommand
|
||||
{
|
||||
string command;
|
||||
AZStd::string command;
|
||||
bool silentMode;
|
||||
|
||||
SDeferredCommand(const string& _command, bool _silentMode)
|
||||
SDeferredCommand(const AZStd::string& _command, bool _silentMode)
|
||||
: command(_command)
|
||||
, silentMode(_silentMode)
|
||||
{}
|
||||
@@ -359,10 +359,10 @@ private: // ----------------------------------------------------------
|
||||
int m_nProgress;
|
||||
int m_nProgressRange;
|
||||
|
||||
string m_sInputBuffer;
|
||||
string m_sReturnString;
|
||||
AZStd::string m_sInputBuffer;
|
||||
AZStd::string m_sReturnString;
|
||||
|
||||
string m_sPrevTab;
|
||||
AZStd::string m_sPrevTab;
|
||||
int m_nTabCount;
|
||||
|
||||
ConsoleCommandsMap m_mapCommands; //
|
||||
|
||||
@@ -49,7 +49,7 @@ bool CSerializeXMLReaderImpl::Value(const char* name, int8& value)
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool CSerializeXMLReaderImpl::Value(const char* name, string& value)
|
||||
bool CSerializeXMLReaderImpl::Value(const char* name, AZStd::string& value)
|
||||
{
|
||||
DefaultValue(value); // Set input value to default.
|
||||
if (m_nErrors)
|
||||
@@ -177,7 +177,7 @@ void CSerializeXMLReaderImpl::EndGroup()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
const char* CSerializeXMLReaderImpl::GetStackInfo() const
|
||||
{
|
||||
static string str;
|
||||
static AZStd::string str;
|
||||
str.assign("");
|
||||
for (int i = 0; i < (int)m_nodeStack.size(); i++)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
g_pXmlStrCmp = pPrevCmpFunc;
|
||||
return bReturn;
|
||||
}
|
||||
ILINE bool GetAttr([[maybe_unused]] XmlNodeRef& node, [[maybe_unused]] const char* name, [[maybe_unused]] const string& value)
|
||||
ILINE bool GetAttr([[maybe_unused]] XmlNodeRef& node, [[maybe_unused]] const char* name, [[maybe_unused]] const AZStd::string& value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
}
|
||||
|
||||
bool Value(const char* name, int8& value);
|
||||
bool Value(const char* name, string& value);
|
||||
bool Value(const char* name, AZStd::string& value);
|
||||
bool Value(const char* name, CTimeValue& value);
|
||||
bool Value(const char* name, XmlNodeRef& value);
|
||||
|
||||
@@ -172,8 +172,8 @@ private:
|
||||
void DefaultValue(Quat& v) const { v.w = 1.0f; v.v.x = 0; v.v.y = 0; v.v.z = 0; }
|
||||
void DefaultValue(CTimeValue& v) const { v.SetValue(0); }
|
||||
//void DefaultValue( char *str ) const { if (str) str[0] = 0; }
|
||||
void DefaultValue(string& str) const { str = ""; }
|
||||
void DefaultValue([[maybe_unused]] const string& str) const {}
|
||||
void DefaultValue(AZStd::string& str) const { str = ""; }
|
||||
void DefaultValue([[maybe_unused]] const AZStd::string& str) const {}
|
||||
void DefaultValue([[maybe_unused]] SNetObjectID& id) const {}
|
||||
void DefaultValue([[maybe_unused]] SSerializeString& str) const {}
|
||||
void DefaultValue(XmlNodeRef& ref) const { ref = NULL; }
|
||||
|
||||
@@ -32,7 +32,7 @@ const char* XMLBinary::XMLBinaryReader::GetErrorDescription() const
|
||||
|
||||
void XMLBinary::XMLBinaryReader::SetErrorDescription(const char* text)
|
||||
{
|
||||
cry_strcpy(m_errorDescription, text);
|
||||
azstrcpy(m_errorDescription, text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ static void write(XMLBinary::IDataWriter* const pFile, size_t& nPosition, const
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node, bool bNeedSwapEndian, XMLBinary::IFilter* pFilter, string& error)
|
||||
bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node, bool bNeedSwapEndian, XMLBinary::IFilter* pFilter, AZStd::string& error)
|
||||
{
|
||||
error = "";
|
||||
|
||||
@@ -99,7 +99,7 @@ bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node,
|
||||
static const uint nMaxNodeCount = (NodeIndex) ~0;
|
||||
if (m_nodes.size() > nMaxNodeCount)
|
||||
{
|
||||
error.Format("XMLBinary: Too many nodes: %d (max is %i)", m_nodes.size(), nMaxNodeCount);
|
||||
error = AZStd::string::format("XMLBinary: Too many nodes: %d (max is %i)", m_nodes.size(), nMaxNodeCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XMLBinary::CXMLBinaryWriter::CompileTables(XmlNodeRef node, XMLBinary::IFilter* pFilter, string& error)
|
||||
bool XMLBinary::CXMLBinaryWriter::CompileTables(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error)
|
||||
{
|
||||
bool ok = CompileTablesForNode(node, -1, pFilter, error);
|
||||
ok = ok && CompileChildTable(node, pFilter, error);
|
||||
@@ -200,7 +200,7 @@ bool XMLBinary::CXMLBinaryWriter::CompileTables(XmlNodeRef node, XMLBinary::IFil
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nParentIndex, XMLBinary::IFilter* pFilter, string& error)
|
||||
bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nParentIndex, XMLBinary::IFilter* pFilter, AZStd::string& error)
|
||||
{
|
||||
// Add the tag to the string table.
|
||||
int nTagStringOffset = AddString(node->getTag());
|
||||
@@ -231,7 +231,7 @@ bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nPar
|
||||
static const int nMaxAttributeCount = (uint16) ~0;
|
||||
if (nAttributeCount > nMaxAttributeCount)
|
||||
{
|
||||
error.Format("XMLBinary: Too many attributes in a node: %d (max is %i)", nAttributeCount, nMaxAttributeCount);
|
||||
error = AZStd::string::format("XMLBinary: Too many attributes in a node: %d (max is %i)", nAttributeCount, nMaxAttributeCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nPar
|
||||
{
|
||||
if (++nChildCount > nMaxChildCount)
|
||||
{
|
||||
error.Format("XMLBinary: Too many children in node '%s': %d (max is %i)", childNode->getTag(), nChildCount, nMaxChildCount);
|
||||
error = AZStd::string::format("XMLBinary: Too many children in node '%s': %d (max is %i)", childNode->getTag(), nChildCount, nMaxChildCount);
|
||||
return false;
|
||||
}
|
||||
if (!CompileTablesForNode(childNode, nIndex, pFilter, error))
|
||||
@@ -277,7 +277,7 @@ bool XMLBinary::CXMLBinaryWriter::CompileTablesForNode(XmlNodeRef node, int nPar
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool XMLBinary::CXMLBinaryWriter::CompileChildTable(XmlNodeRef node, XMLBinary::IFilter* pFilter, string& error)
|
||||
bool XMLBinary::CXMLBinaryWriter::CompileChildTable(XmlNodeRef node, XMLBinary::IFilter* pFilter, AZStd::string& error)
|
||||
{
|
||||
const int nIndex = m_nodesMap.find(node)->second; // Assume node always exist in map.
|
||||
const int nFirstChildIndex = (int)m_childs.size();
|
||||
@@ -298,7 +298,7 @@ bool XMLBinary::CXMLBinaryWriter::CompileChildTable(XmlNodeRef node, XMLBinary::
|
||||
}
|
||||
if (nChildCount != nd.nChildCount)
|
||||
{
|
||||
error.Format("XMLBinary: Internal error in CompileChildTable()");
|
||||
error = AZStd::string::format("XMLBinary: Internal error in CompileChildTable()");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ void CXMLPatcher::DumpXMLNodes(
|
||||
AZ::IO::HandleType inFileHandle,
|
||||
int inIndent,
|
||||
const XmlNodeRef& inNode,
|
||||
CryFixedStringT<512>* ioTempString)
|
||||
AZStd::fixed_string<512>* ioTempString)
|
||||
{
|
||||
auto pPak = gEnv->pCryPak;
|
||||
|
||||
@@ -393,7 +393,7 @@ void CXMLPatcher::DumpFiles(
|
||||
|
||||
DumpXMLFile(string().Format("PATCH_%s", pOrigFileName), inBefore);
|
||||
|
||||
CryFixedStringT<128> newFileName(pOrigFileName);
|
||||
AZStd::fixed_string<128> newFileName(pOrigFileName);
|
||||
newFileName.replace(".xml", "_patched.xml");
|
||||
|
||||
DumpXMLFile(string().Format("PATCH_%s", newFileName.c_str()), inAfter);
|
||||
@@ -414,7 +414,7 @@ void CXMLPatcher::DumpXMLFile(
|
||||
|
||||
if (fileHandle != AZ::IO::InvalidHandle)
|
||||
{
|
||||
CryFixedStringT<512> tempStr;
|
||||
AZStd::fixed_string<512> tempStr;
|
||||
|
||||
DumpXMLNodes(fileHandle, 0, inNode, &tempStr);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ protected:
|
||||
AZ::IO::HandleType inFileHandle,
|
||||
int inIndent,
|
||||
const XmlNodeRef& inNode,
|
||||
CryFixedStringT<512>* ioTempString);
|
||||
AZStd::fixed_string<512>* ioTempString);
|
||||
void DumpFiles(
|
||||
const char* pInXMLFileName,
|
||||
const XmlNodeRef& inBefore,
|
||||
|
||||
@@ -1691,8 +1691,8 @@ XmlNodeRef XmlParserImp::ParseFile(const char* filename, XmlString& errorString,
|
||||
|
||||
char str[1024];
|
||||
|
||||
CryStackStringT<char, 256> adjustedFilename;
|
||||
CryStackStringT<char, 256> pakPath;
|
||||
AZStd::fixed_string<256> adjustedFilename;
|
||||
AZStd::fixed_string<256> pakPath;
|
||||
if (fileSize <= 0)
|
||||
{
|
||||
CCryFile xmlFile;
|
||||
@@ -1761,7 +1761,7 @@ XmlNodeRef XmlParserImp::ParseFile(const char* filename, XmlString& errorString,
|
||||
// not binary XML - refuse to load if in scripts dir and not in bin xml to help reduce hacking
|
||||
// wish we could compile the text xml parser out, but too much work to get everything moved over
|
||||
static const char SCRIPTS_DIR[] = "Scripts/";
|
||||
CryFixedStringT<32> strScripts("S");
|
||||
AZStd::fixed_string<32> strScripts("S");
|
||||
strScripts += "c";
|
||||
strScripts += "r";
|
||||
strScripts += "i";
|
||||
@@ -1770,7 +1770,7 @@ XmlNodeRef XmlParserImp::ParseFile(const char* filename, XmlString& errorString,
|
||||
strScripts += "s";
|
||||
strScripts += "/";
|
||||
// exclude files and PAKs from Mods folder
|
||||
CryFixedStringT<8> modsStr("M");
|
||||
AZStd::fixed_string<8> modsStr("M");
|
||||
modsStr += "o";
|
||||
modsStr += "d";
|
||||
modsStr += "s";
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <vector>
|
||||
#include <CryCommon/Cry_Math.h>
|
||||
#include <CryCommon/Cry_Color.h>
|
||||
#include <CryCommon/CryString.h>
|
||||
#include <CryCommon/VertexFormats.h>
|
||||
#include <CryCommon/IRenderer.h>
|
||||
#include "AtomFont.h"
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace AtomFontInternal
|
||||
if (SUCCEEDED(SHGetFolderPath(0, CSIDL_FONTS, 0, SHGFP_TYPE_DEFAULT, sysFontPath)))
|
||||
{
|
||||
const char* fontPath = m_strFontPath.c_str();
|
||||
const char* fontName = CryStringUtils::FindFileNameInPath(fontPath);
|
||||
const char* fontName = AZ::IO::PathView(fontPath).Filename();
|
||||
|
||||
string newFontPath(sysFontPath);
|
||||
newFontPath += "/";
|
||||
|
||||
@@ -437,8 +437,6 @@ namespace Blast
|
||||
|
||||
static void CmdToggleBlastDebugVisualization(IConsoleCmdArgs* args)
|
||||
{
|
||||
using namespace CryStringUtils;
|
||||
|
||||
const int argumentCount = args->GetArgCount();
|
||||
|
||||
if (argumentCount == 2)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace LmbrCentral
|
||||
{
|
||||
static const char* s_assetCatalogFilename = "assetcatalog.xml";
|
||||
|
||||
using LmbrCentralAllocatorScope = AZ::AllocatorScope<AZ::LegacyAllocator, CryStringAllocator>;
|
||||
using LmbrCentralAllocatorScope = AZ::AllocatorScope<AZ::LegacyAllocator>;
|
||||
|
||||
// This component boots the required allocators for LmbrCentral everywhere but AssetBuilders
|
||||
class LmbrCentralAllocatorComponent
|
||||
@@ -347,12 +347,6 @@ namespace LmbrCentral
|
||||
m_allocatorShutdowns.push_back([]() { AZ::AllocatorInstance<AZ::LegacyAllocator>::Destroy(); });
|
||||
}
|
||||
|
||||
if (!AZ::AllocatorInstance<CryStringAllocator>::IsReady())
|
||||
{
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Create();
|
||||
m_allocatorShutdowns.push_back([]() { AZ::AllocatorInstance<CryStringAllocator>::Destroy(); });
|
||||
}
|
||||
|
||||
// Register asset handlers. Requires "AssetDatabaseService"
|
||||
AZ_Assert(AZ::Data::AssetManager::IsReady(), "Asset manager isn't ready!");
|
||||
|
||||
|
||||
@@ -1512,7 +1512,7 @@ int CUiAnimViewNodesCtrl::GetMatNameAndSubMtlIndexFromName(QString& matName, con
|
||||
if (const char* pCh = strstr(nodeName, ".["))
|
||||
{
|
||||
char matPath[MAX_PATH];
|
||||
cry_strcpy(matPath, nodeName, (size_t)(pCh - nodeName));
|
||||
azstrcpy(matPath, nodeName, (size_t)(pCh - nodeName));
|
||||
matName = matPath;
|
||||
pCh += 2;
|
||||
if ((*pCh) != 0)
|
||||
|
||||
@@ -47,7 +47,8 @@ bool PropertyHandlerChar::ReadValuesIntoGUI(size_t index, AzToolsFramework::Prop
|
||||
// NOTE: this assumes the uint32_t can be interpreted as a wchar_t, it seems to
|
||||
// work for cases tested but may not in general.
|
||||
wchar_t wcharString[2] = { static_cast<wchar_t>(instance), 0 };
|
||||
AZStd::string val(CryStringUtils::WStrToUTF8(wcharString));
|
||||
AZStd::string val;
|
||||
AZStd::to_string(val, AZStd::wstring(wcharString));
|
||||
GUI->setValue(val);
|
||||
}
|
||||
GUI->blockSignals(false);
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
namespace LyShine
|
||||
{
|
||||
// LyShine depends on the LegacyAllocator and CryStringAllocator. This will be managed
|
||||
// LyShine depends on the LegacyAllocator. This will be managed
|
||||
// by the LyShineSystemComponent
|
||||
using LyShineAllocatorScope = AZ::AllocatorScope<AZ::LegacyAllocator, CryStringAllocator>;
|
||||
using LyShineAllocatorScope = AZ::AllocatorScope<AZ::LegacyAllocator>;
|
||||
|
||||
class LyShineSystemComponent
|
||||
: public AZ::Component
|
||||
|
||||
@@ -20,7 +20,8 @@ bool UiClipboard::SetText(const AZStd::string& text)
|
||||
{
|
||||
if (text.length() > 0)
|
||||
{
|
||||
auto wstr = CryStringUtils::UTF8ToWStr(text.c_str());
|
||||
AZStd::wstring wstr;
|
||||
AZStd::to_wstring(wstr, text);
|
||||
const SIZE_T buffSize = (wstr.size() + 1) * sizeof(WCHAR);
|
||||
if (HGLOBAL hBuffer = GlobalAlloc(GMEM_MOVEABLE, buffSize))
|
||||
{
|
||||
@@ -46,7 +47,7 @@ AZStd::string UiClipboard::GetText()
|
||||
if (HANDLE hText = GetClipboardData(CF_UNICODETEXT))
|
||||
{
|
||||
const WCHAR* text = static_cast<const WCHAR*>(GlobalLock(hText));
|
||||
outText = CryStringUtils::WStrToUTF8(text);
|
||||
AZStd::to_string(outText, AZStd::wstring(text));
|
||||
GlobalUnlock(hText);
|
||||
}
|
||||
CloseClipboard();
|
||||
|
||||
@@ -36,7 +36,8 @@ namespace LyShine
|
||||
// In the long run it would be better to eliminate
|
||||
// this function and use Unicode::CIterator<>::Position instead.
|
||||
wchar_t wcharString[2] = { static_cast<wchar_t>(multiByteChar), 0 };
|
||||
AZStd::string utf8String(CryStringUtils::WStrToUTF8(wcharString));
|
||||
AZStd::string utf8String;
|
||||
AZStd::to_string(utf8String, AZStd::wstring(wcharString));
|
||||
int utf8Length = utf8String.length();
|
||||
return utf8Length;
|
||||
}
|
||||
|
||||
@@ -220,48 +220,9 @@ bool UiButtonComponent::VersionConverter(AZ::SerializeContext& context,
|
||||
// conversion from version 1 to 2:
|
||||
// - Need to convert CryString elements to AZStd::string
|
||||
// - Need to convert Color to Color and Alpha
|
||||
if (classElement.GetVersion() < 2)
|
||||
{
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "SelectedSprite"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "PressedSprite"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "DisabledSprite"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "SelectedColor", "SelectedAlpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "PressedColor", "PressedAlpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "DisabledColor", "DisabledAlpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// conversion from version 2 to 3:
|
||||
// - Need to convert CryString ActionName elements to AZStd::string
|
||||
if (classElement.GetVersion() < 3)
|
||||
{
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "ActionName"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
AZ_Assert(classElement.GetVersion() < 3, "Unsupported UiButtonComponent version: %d", classElement.GetVersion());
|
||||
|
||||
// conversion from version 3 to 4:
|
||||
// - Need to convert AZStd::string sprites to AzFramework::SimpleAssetReference<LmbrCentral::TextureAsset>
|
||||
|
||||
@@ -2663,18 +2663,7 @@ bool UiImageComponent::VersionConverter(AZ::SerializeContext& context,
|
||||
// conversion from version 1:
|
||||
// - Need to convert CryString elements to AZStd::string
|
||||
// - Need to convert Color to Color and Alpha
|
||||
if (classElement.GetVersion() <= 1)
|
||||
{
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "SpritePath"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "Color", "Alpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
AZ_Assert(classElement.GetVersion() <= 1, "Unsupported UiImageComponent version: %d", classElement.GetVersion());
|
||||
|
||||
// conversion from version 1 or 2 to current:
|
||||
// - Need to convert AZStd::string sprites to AzFramework::SimpleAssetReference<LmbrCentral::TextureAsset>
|
||||
|
||||
@@ -31,67 +31,6 @@
|
||||
|
||||
namespace UiSerialize
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class CryStringTCharSerializer
|
||||
: public AZ::SerializeContext::IDataSerializer
|
||||
{
|
||||
/// Return the size of binary buffer necessary to store the value in binary format
|
||||
size_t GetRequiredBinaryBufferSize(const void* classPtr) const
|
||||
{
|
||||
const CryStringT<char>* string = reinterpret_cast<const CryStringT<char>*>(classPtr);
|
||||
return string->length() + 1;
|
||||
}
|
||||
|
||||
/// Store the class data into a stream.
|
||||
size_t Save(const void* classPtr, AZ::IO::GenericStream& stream, [[maybe_unused]] bool isDataBigEndian /*= false*/) override
|
||||
{
|
||||
const CryStringT<char>* string = reinterpret_cast<const CryStringT<char>*>(classPtr);
|
||||
const char* data = string->c_str();
|
||||
|
||||
return static_cast<size_t>(stream.Write(string->length() + 1, reinterpret_cast<const void*>(data)));
|
||||
}
|
||||
|
||||
size_t DataToText(AZ::IO::GenericStream& in, AZ::IO::GenericStream& out, [[maybe_unused]] bool isDataBigEndian /*= false*/) override
|
||||
{
|
||||
size_t len = in.GetLength();
|
||||
char* buffer = static_cast<char*>(azmalloc(len));
|
||||
in.Read(in.GetLength(), reinterpret_cast<void*>(buffer));
|
||||
|
||||
AZStd::string outText = buffer;
|
||||
azfree(buffer);
|
||||
|
||||
return static_cast<size_t>(out.Write(outText.size(), outText.data()));
|
||||
}
|
||||
|
||||
size_t TextToData(const char* text, unsigned int textVersion, AZ::IO::GenericStream& stream, [[maybe_unused]] bool isDataBigEndian /*= false*/) override
|
||||
{
|
||||
(void)textVersion;
|
||||
|
||||
size_t len = strlen(text) + 1;
|
||||
stream.Seek(0, AZ::IO::GenericStream::ST_SEEK_BEGIN);
|
||||
return static_cast<size_t>(stream.Write(len, reinterpret_cast<const void*>(text)));
|
||||
}
|
||||
|
||||
bool Load(void* classPtr, AZ::IO::GenericStream& stream, unsigned int /*version*/, [[maybe_unused]] bool isDataBigEndian /*= false*/) override
|
||||
{
|
||||
CryStringT<char>* string = reinterpret_cast<CryStringT<char>*>(classPtr);
|
||||
|
||||
size_t len = stream.GetLength();
|
||||
char* buffer = static_cast<char*>(azmalloc(len));
|
||||
|
||||
stream.Read(len, reinterpret_cast<void*>(buffer));
|
||||
|
||||
*string = buffer;
|
||||
azfree(buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CompareValueData(const void* lhs, const void* rhs) override
|
||||
{
|
||||
return AZ::SerializeContext::EqualityCompareHelper<CryStringT<char> >::CompareValues(lhs, rhs);
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void UiOffsetsScriptConstructor(UiTransform2dInterface::Offsets* thisPtr, AZ::ScriptDataContext& dc)
|
||||
{
|
||||
@@ -553,9 +492,6 @@ namespace UiSerialize
|
||||
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<CryStringT<char> >()->
|
||||
Serializer(&AZ::Serialize::StaticInstance<CryStringTCharSerializer>::s_instance);
|
||||
|
||||
serializeContext->Class<AnimationData>()
|
||||
->Version(1)
|
||||
->Field("SerializeString", &AnimationData::m_serializeData);
|
||||
|
||||
@@ -4995,28 +4995,8 @@ bool UiTextComponent::VersionConverter(AZ::SerializeContext& context,
|
||||
AZ::SerializeContext::DataElementNode& classElement)
|
||||
{
|
||||
// conversion from version 1: Need to convert Color to Color and Alpha
|
||||
if (classElement.GetVersion() == 1)
|
||||
{
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAssetRef<LyShine::FontAsset>(context, classElement, "FontFileName"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "Color", "Alpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// conversion from version 1 or 2: Need to convert Text from CryString to AzString
|
||||
if (classElement.GetVersion() <= 2)
|
||||
{
|
||||
// Call internal function to work-around serialization of empty AZ std string
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "Text"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
AZ_Assert(classElement.GetVersion() <= 2, "Unsupported UiTextComponent version: %d", classElement.GetVersion());
|
||||
|
||||
// Versions prior to v4: Change default font
|
||||
if (classElement.GetVersion() <= 3)
|
||||
|
||||
@@ -1185,7 +1185,8 @@ void UiTextInputComponent::UpdateDisplayedTextFunction()
|
||||
// NOTE: this assumes the uint32_t can be interpreted as a wchar_t, it seems to
|
||||
// work for cases tested but may not in general.
|
||||
wchar_t wcharString[2] = { static_cast<wchar_t>(this->GetReplacementCharacter()), 0 };
|
||||
AZStd::string replacementCharString(CryStringUtils::WStrToUTF8(wcharString));
|
||||
AZStd::string replacementCharString;
|
||||
AZStd::to_string(replacementCharString, AZStd::wstring(wcharString));
|
||||
|
||||
int numReplacementChars = LyShine::GetUtf8StringLength(originalText);
|
||||
|
||||
@@ -1475,54 +1476,10 @@ bool UiTextInputComponent::VersionConverter(AZ::SerializeContext& context,
|
||||
// conversion from version 1:
|
||||
// - Need to convert CryString elements to AZStd::string
|
||||
// - Need to convert Color to Color and Alpha
|
||||
if (classElement.GetVersion() <= 1)
|
||||
{
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "SelectedSprite"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "PressedSprite"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "SelectedColor", "SelectedAlpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromColorToColorPlusAlpha(context, classElement, "PressedColor", "PressedAlpha"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromCryStringToChar(context, classElement, "ReplacementCharacter", defaultReplacementChar))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// conversion from version 1 or 2 to current:
|
||||
// - Need to convert CryString ActionName elements to AZStd::string
|
||||
if (classElement.GetVersion() <= 2)
|
||||
{
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "ChangeAction"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "EndEditAction"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LyShine::ConvertSubElementFromCryStringToAzString(context, classElement, "EnterAction"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
AZ_Assert(classElement.GetVersion() <= 2, "Unsupported UiTextInputComponent version: %d", classElement.GetVersion());
|
||||
|
||||
// conversion from version 1, 2 or 3 to current:
|
||||
// - Need to convert AZStd::string sprites to AzFramework::SimpleAssetReference<LmbrCentral::TextureAsset>
|
||||
if (classElement.GetVersion() <= 3)
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace UnitTest
|
||||
appDesc.m_stackRecordLevels = 20;
|
||||
|
||||
AZ::ComponentApplication::StartupParameters appStartup;
|
||||
// Module needs to be created this way to create CryString allocator for test
|
||||
appStartup.m_createStaticModulesCallback =
|
||||
[](AZStd::vector<AZ::Module*>& modules)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace UnitTest
|
||||
appDesc.m_stackRecordLevels = 20;
|
||||
|
||||
AZ::ComponentApplication::StartupParameters appStartup;
|
||||
// Module needs to be created this way to create CryString allocator for test
|
||||
appStartup.m_createStaticModulesCallback =
|
||||
[](AZStd::vector<AZ::Module*>& modules)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ void CCaptureTrack::GetKeyInfo(int key, const char*& description, float& duratio
|
||||
char prefix[64] = "Frame";
|
||||
if (!m_keys[key].prefix.empty())
|
||||
{
|
||||
cry_strcpy(prefix, m_keys[key].prefix.c_str());
|
||||
azstrcpy(prefix, m_keys[key].prefix.c_str());
|
||||
}
|
||||
description = buffer;
|
||||
if (!m_keys[key].folder.empty())
|
||||
|
||||
@@ -25,7 +25,7 @@ void CCommentTrack::GetKeyInfo(int key, const char*& description, float& duratio
|
||||
description = 0;
|
||||
duration = m_keys[key].m_duration;
|
||||
|
||||
cry_strcpy(desc, m_keys[key].m_strComment.c_str());
|
||||
azstrcpy(desc, m_keys[key].m_strComment.c_str());
|
||||
|
||||
description = desc;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void CEventTrack::GetKeyInfo(int key, const char*& description, float& duration)
|
||||
CheckValid();
|
||||
description = 0;
|
||||
duration = 0;
|
||||
cry_strcpy(desc, m_keys[key].event.c_str());
|
||||
azstrcpy(desc, m_keys[key].event.c_str());
|
||||
if (!m_keys[key].eventValue.empty())
|
||||
{
|
||||
cry_strcat(desc, ", ");
|
||||
|
||||
@@ -916,7 +916,7 @@ void CAnimSceneNode::ApplyCameraKey(ISelectKey& key, SAnimContext& ec)
|
||||
void CAnimSceneNode::ApplyEventKey(IEventKey& key, [[maybe_unused]] SAnimContext& ec)
|
||||
{
|
||||
char funcName[1024];
|
||||
cry_strcpy(funcName, "Event_");
|
||||
azstrcpy(funcName, "Event_");
|
||||
cry_strcat(funcName, key.event.c_str());
|
||||
gEnv->pMovieSystem->SendGlobalEvent(funcName);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ void CTrackEventTrack::GetKeyInfo(int key, const char*& description, float& dura
|
||||
CheckValid();
|
||||
description = 0;
|
||||
duration = 0;
|
||||
cry_strcpy(desc, m_keys[key].event.c_str());
|
||||
azstrcpy(desc, m_keys[key].event.c_str());
|
||||
if (!m_keys[key].eventValue.empty())
|
||||
{
|
||||
cry_strcat(desc, ", ");
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
namespace Maestro
|
||||
{
|
||||
// Ensure that Maestro always has the LegacyAllocator and CryStringAllocators available
|
||||
// Ensure that Maestro always has the LegacyAllocator available
|
||||
// NOTE: This component is only activated in the AssetBuilder, as the required allocators are
|
||||
// booted by the launcher or editor.
|
||||
using MaestroAllocatorScope = AZ::AllocatorScope<AZ::LegacyAllocator, CryStringAllocator>;
|
||||
using MaestroAllocatorScope = AZ::AllocatorScope<AZ::LegacyAllocator>;
|
||||
|
||||
class MaestroAllocatorComponent
|
||||
: public AZ::Component
|
||||
|
||||
@@ -38,12 +38,10 @@ protected:
|
||||
AZ::AllocatorInstance<AZ::OSAllocator>::Create();
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Create();
|
||||
AZ::AllocatorInstance<AZ::LegacyAllocator>::Create();
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Create();
|
||||
}
|
||||
|
||||
void TeardownEnvironment() override
|
||||
{
|
||||
AZ::AllocatorInstance<CryStringAllocator>::Destroy();
|
||||
AZ::AllocatorInstance<AZ::LegacyAllocator>::Destroy();
|
||||
AZ::AllocatorInstance<AZ::SystemAllocator>::Destroy();
|
||||
AZ::AllocatorInstance<AZ::OSAllocator>::Destroy();
|
||||
|
||||
@@ -577,8 +577,6 @@ namespace PhysXDebug
|
||||
|
||||
static void physx_Debug([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments)
|
||||
{
|
||||
using namespace CryStringUtils;
|
||||
|
||||
const int argumentCount = arguments.size();
|
||||
|
||||
if (argumentCount == 1)
|
||||
|
||||
Reference in New Issue
Block a user