diff --git a/Code/Editor/BaseLibraryManager.cpp b/Code/Editor/BaseLibraryManager.cpp index 8e555cae8c..2189156454 100644 --- a/Code/Editor/BaseLibraryManager.cpp +++ b/Code/Editor/BaseLibraryManager.cpp @@ -560,7 +560,7 @@ QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QS return srcName; } - std::sort(possibleDuplicates.begin(), possibleDuplicates.end(), [](const string& strOne, const string& strTwo) + std::sort(possibleDuplicates.begin(), possibleDuplicates.end(), [](const AZStd::string& strOne, const AZStd::string& strTwo) { // I can assume size sorting since if the length is different, either one of the two strings doesn't // closely match the string we are trying to duplicate, or it's a bigger number (X1 vs X10) diff --git a/Code/Editor/Commands/CommandManager.cpp b/Code/Editor/Commands/CommandManager.cpp index 90059ea195..708fccd16b 100644 --- a/Code/Editor/Commands/CommandManager.cpp +++ b/Code/Editor/Commands/CommandManager.cpp @@ -79,7 +79,7 @@ CEditorCommandManager::~CEditorCommandManager() m_uiCommands.clear(); } -string CEditorCommandManager::GetFullCommandName(const string& module, const string& name) +string CEditorCommandManager::GetFullCommandName(const AZStd::string& module, const string& name) { string fullName = module; fullName += "."; diff --git a/Code/Editor/Commands/CommandManager.h b/Code/Editor/Commands/CommandManager.h index 2ec4a137bc..a76df830d0 100644 --- a/Code/Editor/Commands/CommandManager.h +++ b/Code/Editor/Commands/CommandManager.h @@ -48,20 +48,20 @@ public: const AZStd::function& functor, const CCommand0::SUIInfo& uiInfo); bool AttachUIInfo(const char* fullCmdName, const CCommand0::SUIInfo& uiInfo); - bool GetUIInfo(const string& module, const string& name, CCommand0::SUIInfo& uiInfo) const; - bool GetUIInfo(const string& fullCmdName, CCommand0::SUIInfo& uiInfo) const; - QString Execute(const string& cmdLine); - QString Execute(const string& module, const string& name, const CCommand::CArgs& args); + bool GetUIInfo(const AZStd::string& module, const AZStd::string& name, CCommand0::SUIInfo& uiInfo) const; + bool GetUIInfo(const AZStd::string& fullCmdName, CCommand0::SUIInfo& uiInfo) const; + QString Execute(const AZStd::string& cmdLine); + QString Execute(const AZStd::string& module, const AZStd::string& name, const CCommand::CArgs& args); void Execute(int commandId); void GetCommandList(std::vector& cmds) const; //! Used in the console dialog - string AutoComplete(const string& substr) const; + string AutoComplete(const AZStd::string& substr) const; bool IsRegistered(const char* module, const char* name) const; bool IsRegistered(const char* cmdLine) const; bool IsRegistered(int commandId) const; - void SetCommandAvailableInScripting(const string& module, const string& name); - bool IsCommandAvailableInScripting(const string& module, const string& name) const; - bool IsCommandAvailableInScripting(const string& fullCmdName) const; + void SetCommandAvailableInScripting(const AZStd::string& module, const AZStd::string& name); + bool IsCommandAvailableInScripting(const AZStd::string& module, const AZStd::string& name) const; + bool IsCommandAvailableInScripting(const AZStd::string& fullCmdName) const; //! Turning off the warning is needed for reloading the ribbon bar. void TurnDuplicateWarningOn() { m_bWarnDuplicate = true; } void TurnDuplicateWarningOff() { m_bWarnDuplicate = false; } @@ -86,9 +86,9 @@ protected: bool m_bWarnDuplicate; static int GenNewCommandId(); - static string GetFullCommandName(const string& module, const string& name); - static void GetArgsFromString(const string& argsTxt, CCommand::CArgs& argList); - void LogCommand(const string& fullCmdName, const CCommand::CArgs& args) const; + static string GetFullCommandName(const AZStd::string& module, const AZStd::string& name); + static void GetArgsFromString(const AZStd::string& argsTxt, CCommand::CArgs& argList); + void LogCommand(const AZStd::string& fullCmdName, const CCommand::CArgs& args) const; QString ExecuteAndLogReturn(CCommand* pCommand, const CCommand::CArgs& args); }; diff --git a/Code/Editor/ConfigGroup.h b/Code/Editor/ConfigGroup.h index 35c0b8e47f..5d9b22b2b9 100644 --- a/Code/Editor/ConfigGroup.h +++ b/Code/Editor/ConfigGroup.h @@ -47,12 +47,12 @@ namespace Config return m_type; } - ILINE const string& GetName() const + ILINE const AZStd::string& GetName() const { return m_name; } - ILINE const string& GetDescription() const + ILINE const AZStd::string& GetDescription() const { return m_description; } @@ -71,7 +71,7 @@ namespace Config static EType TranslateType(const bool&) { return eType_BOOL; } static EType TranslateType(const int&) { return eType_INT; } static EType TranslateType(const float&) { return eType_FLOAT; } - static EType TranslateType(const string&) { return eType_STRING; } + static EType TranslateType(const AZStd::string&) { return eType_STRING; } protected: EType m_type; diff --git a/Code/Editor/Controls/SplineCtrlEx.h b/Code/Editor/Controls/SplineCtrlEx.h index 8592febf88..de07c4214b 100644 --- a/Code/Editor/Controls/SplineCtrlEx.h +++ b/Code/Editor/Controls/SplineCtrlEx.h @@ -53,7 +53,7 @@ class QRubberBand; class ISplineSet { public: - virtual ISplineInterpolator* GetSplineFromID(const string& id) = 0; + virtual ISplineInterpolator* GetSplineFromID(const AZStd::string& id) = 0; virtual string GetIDFromSpline(ISplineInterpolator* pSpline) = 0; virtual int GetSplineCount() const = 0; virtual int GetKeyCountAtTime(float time, float threshold) const = 0; diff --git a/Code/Editor/Include/Command.h b/Code/Editor/Include/Command.h index 69853ddb4f..92a7736446 100644 --- a/Code/Editor/Include/Command.h +++ b/Code/Editor/Include/Command.h @@ -27,10 +27,10 @@ class CCommand { public: CCommand( - const string& module, - const string& name, - const string& description, - const string& example) + const AZStd::string& module, + const AZStd::string& name, + const AZStd::string& description, + const AZStd::string& example) : m_module(module) , m_name(name) , m_description(description) @@ -79,7 +79,7 @@ public: } int GetArgCount() const { return m_args.size(); } - const string& GetArg(int i) const + const AZStd::string& GetArg(int i) const { assert(0 <= i && i < GetArgCount()); return m_args[i]; @@ -89,10 +89,10 @@ public: unsigned char m_stringFlags; // This is needed to quote string parameters when logging a command. }; - const string& GetName() const { return m_name; } - const string& GetModule() const { return m_module; } - const string& GetDescription() const { return m_description; } - const string& GetExample() const { return m_example; } + const AZStd::string& GetName() const { return m_name; } + const AZStd::string& GetModule() const { return m_module; } + const AZStd::string& GetDescription() const { return m_description; } + const AZStd::string& GetExample() const { return m_example; } void SetAvailableInScripting() { m_bAlsoAvailableInScripting = true; }; bool IsAvailableInScripting() const { return m_bAlsoAvailableInScripting; } @@ -137,8 +137,8 @@ class CCommand0 : public CCommand { public: - CCommand0(const string& module, const string& name, - const string& description, const string& example, + CCommand0(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) {} @@ -179,8 +179,8 @@ class CCommand0wRet : public CCommand { public: - CCommand0wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand0wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -195,8 +195,8 @@ class CCommand1 : public CCommand { public: - CCommand1(const string& module, const string& name, - const string& description, const string& example, + CCommand1(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -211,8 +211,8 @@ class CCommand1wRet : public CCommand { public: - CCommand1wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand1wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -227,8 +227,8 @@ class CCommand2 : public CCommand { public: - CCommand2(const string& module, const string& name, - const string& description, const string& example, + CCommand2(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -243,8 +243,8 @@ class CCommand2wRet : public CCommand { public: - CCommand2wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand2wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -259,8 +259,8 @@ class CCommand3 : public CCommand { public: - CCommand3(const string& module, const string& name, - const string& description, const string& example, + CCommand3(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -275,8 +275,8 @@ class CCommand3wRet : public CCommand { public: - CCommand3wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand3wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -291,8 +291,8 @@ class CCommand4 : public CCommand { public: - CCommand4(const string& module, const string& name, - const string& description, const string& example, + CCommand4(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -307,8 +307,8 @@ class CCommand4wRet : public CCommand { public: - CCommand4wRet(const string& module, const string& name, - const string& description, const string& example, + CCommand4wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -323,8 +323,8 @@ class CCommand5 : public CCommand { public: - CCommand5(const string& module, const string& name, - const string& description, const string& example, + CCommand5(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -339,8 +339,8 @@ class CCommand6 : public CCommand { public: - CCommand6(const string& module, const string& name, - const string& description, const string& example, + CCommand6(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor); QString Execute(const CArgs& args); @@ -353,8 +353,8 @@ protected: ////////////////////////////////////////////////////////////////////////// template -CCommand0wRet::CCommand0wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand0wRet::CCommand0wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -373,8 +373,8 @@ QString CCommand0wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand1::CCommand1(const string& module, const string& name, - const string& description, const string& example, +CCommand1::CCommand1(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -410,8 +410,8 @@ QString CCommand1::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand1wRet::CCommand1wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand1wRet::CCommand1wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -448,8 +448,8 @@ QString CCommand1wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand2::CCommand2(const string& module, const string& name, - const string& description, const string& example, +CCommand2::CCommand2(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -487,8 +487,8 @@ QString CCommand2::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand2wRet::CCommand2wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand2wRet::CCommand2wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -527,8 +527,8 @@ QString CCommand2wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand3::CCommand3(const string& module, const string& name, - const string& description, const string& example, +CCommand3::CCommand3(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -568,8 +568,8 @@ QString CCommand3::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand3wRet::CCommand3wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand3wRet::CCommand3wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -610,8 +610,8 @@ QString CCommand3wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand4::CCommand4(const string& module, const string& name, - const string& description, const string& example, +CCommand4::CCommand4(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -654,8 +654,8 @@ QString CCommand4::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand4wRet::CCommand4wRet(const string& module, const string& name, - const string& description, const string& example, +CCommand4wRet::CCommand4wRet(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -699,8 +699,8 @@ QString CCommand4wRet::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand5::CCommand5(const string& module, const string& name, - const string& description, const string& example, +CCommand5::CCommand5(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) @@ -745,8 +745,8 @@ QString CCommand5::Execute(const CCommand::CArgs& args) ////////////////////////////////////////////////////////////////////////// template -CCommand6::CCommand6(const string& module, const string& name, - const string& description, const string& example, +CCommand6::CCommand6(const AZStd::string& module, const AZStd::string& name, + const AZStd::string& description, const AZStd::string& example, const AZStd::function& functor) : CCommand(module, name, description, example) , m_functor(functor) diff --git a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterPlugin.h b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterPlugin.h index c5b6694af4..8bdfb48774 100644 --- a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterPlugin.h +++ b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterPlugin.h @@ -41,7 +41,7 @@ public: return m_editor; } - const string& GetToolName() const + const AZStd::string& GetToolName() const { return m_toolName; } diff --git a/Code/Editor/Util/EditorUtils.h b/Code/Editor/Util/EditorUtils.h index fb767c98b3..1eb73532ef 100644 --- a/Code/Editor/Util/EditorUtils.h +++ b/Code/Editor/Util/EditorUtils.h @@ -18,6 +18,7 @@ #include #include "Util/FileUtil.h" #include +#include //! Typedef for quaternion. //typedef CryQuat Quat; diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp index 9e4f688f69..d57d690154 100644 --- a/Code/Editor/Util/FileUtil.cpp +++ b/Code/Editor/Util/FileUtil.cpp @@ -1330,7 +1330,7 @@ IFileUtil::ECopyTreeResult CFileUtil::CopyTree(const QString& strSourceDirectory const QString fileName = QFileInfo(filePath).fileName(); bool ignored = false; - for (const string& ignoredFile : ignoredPatterns) + for (const AZStd::string& ignoredFile : ignoredPatterns) { if (StringHelpers::CompareIgnoreCase(fileName.toStdString().c_str(), ignoredFile.c_str()) == 0) { diff --git a/Code/Editor/Util/IXmlHistoryManager.h b/Code/Editor/Util/IXmlHistoryManager.h index 78d849df7d..e133d073bc 100644 --- a/Code/Editor/Util/IXmlHistoryManager.h +++ b/Code/Editor/Util/IXmlHistoryManager.h @@ -62,7 +62,7 @@ struct IXmlHistoryManager // History virtual void ClearHistory(bool flagAsSaved = false) = 0; virtual int GetVersionCount() const = 0; - virtual const string& GetVersionDesc(int number) const = 0; + virtual const AZStd::string& GetVersionDesc(int number) const = 0; virtual int GetCurrentVersionNumber() const = 0; // Views diff --git a/Code/Editor/Util/StringHelpers.cpp b/Code/Editor/Util/StringHelpers.cpp index a6bf622ad0..bf607e475e 100644 --- a/Code/Editor/Util/StringHelpers.cpp +++ b/Code/Editor/Util/StringHelpers.cpp @@ -84,7 +84,7 @@ static inline int Vsnprintf_s(wchar_t* str, size_t sizeInBytes, [[maybe_unused]] } -int StringHelpers::Compare(const string& str0, const string& str1) +int StringHelpers::Compare(const AZStd::string& str0, const AZStd::string& str1) { const size_t minLength = Util::getMin(str0.length(), str1.length()); const int result = std::memcmp(str0.c_str(), str1.c_str(), minLength); @@ -119,7 +119,7 @@ int StringHelpers::Compare(const wstring& str0, const wstring& str1) } -int StringHelpers::CompareIgnoreCase(const string& str0, const string& str1) +int StringHelpers::CompareIgnoreCase(const AZStd::string& str0, const AZStd::string& str1) { const size_t minLength = Util::getMin(str0.length(), str1.length()); const int result = azmemicmp(str0.c_str(), str1.c_str(), minLength); @@ -154,7 +154,7 @@ int StringHelpers::CompareIgnoreCase(const wstring& str0, const wstring& str1) } -bool StringHelpers::Equals(const string& str0, const string& str1) +bool StringHelpers::Equals(const AZStd::string& str0, const AZStd::string& str1) { if (str0.length() != str1.length()) { @@ -173,7 +173,7 @@ bool StringHelpers::Equals(const wstring& str0, const wstring& str1) } -bool StringHelpers::EqualsIgnoreCase(const string& str0, const string& str1) +bool StringHelpers::EqualsIgnoreCase(const AZStd::string& str0, const AZStd::string& str1) { if (str0.length() != str1.length()) { @@ -200,7 +200,7 @@ bool StringHelpers::EqualsIgnoreCase(const wstring& str0, const wstring& str1) } -bool StringHelpers::StartsWith(const string& str, const string& pattern) +bool StringHelpers::StartsWith(const AZStd::string& str, const AZStd::string& pattern) { if (str.length() < pattern.length()) { @@ -219,7 +219,7 @@ bool StringHelpers::StartsWith(const wstring& str, const wstring& pattern) } -bool StringHelpers::StartsWithIgnoreCase(const string& str, const string& pattern) +bool StringHelpers::StartsWithIgnoreCase(const AZStd::string& str, const AZStd::string& pattern) { if (str.length() < pattern.length()) { @@ -246,7 +246,7 @@ bool StringHelpers::StartsWithIgnoreCase(const wstring& str, const wstring& patt } -bool StringHelpers::EndsWith(const string& str, const string& pattern) +bool StringHelpers::EndsWith(const AZStd::string& str, const AZStd::string& pattern) { if (str.length() < pattern.length()) { @@ -265,7 +265,7 @@ bool StringHelpers::EndsWith(const wstring& str, const wstring& pattern) } -bool StringHelpers::EndsWithIgnoreCase(const string& str, const string& pattern) +bool StringHelpers::EndsWithIgnoreCase(const AZStd::string& str, const AZStd::string& pattern) { if (str.length() < pattern.length()) { @@ -292,7 +292,7 @@ bool StringHelpers::EndsWithIgnoreCase(const wstring& str, const wstring& patter } -bool StringHelpers::Contains(const string& str, const string& pattern) +bool StringHelpers::Contains(const AZStd::string& str, const AZStd::string& pattern) { const size_t patternLength = pattern.length(); if (str.length() < patternLength) @@ -329,7 +329,7 @@ bool StringHelpers::Contains(const wstring& str, const wstring& pattern) } -bool StringHelpers::ContainsIgnoreCase(const string& str, const string& pattern) +bool StringHelpers::ContainsIgnoreCase(const AZStd::string& str, const AZStd::string& pattern) { const size_t patternLength = pattern.length(); if (str.length() < patternLength) @@ -380,7 +380,7 @@ bool StringHelpers::ContainsIgnoreCase(const wstring& str, const wstring& patter return false; } -string StringHelpers::TrimLeft(const string& s) +string StringHelpers::TrimLeft(const AZStd::string& s) { const size_t first = s.find_first_not_of(" \r\t"); return (first == s.npos) ? string() : s.substr(first); @@ -393,7 +393,7 @@ wstring StringHelpers::TrimLeft(const wstring& s) } -string StringHelpers::TrimRight(const string& s) +string StringHelpers::TrimRight(const AZStd::string& s) { const size_t last = s.find_last_not_of(" \r\t"); return (last == s.npos) ? s : s.substr(0, last + 1); @@ -406,7 +406,7 @@ wstring StringHelpers::TrimRight(const wstring& s) } -string StringHelpers::Trim(const string& s) +string StringHelpers::Trim(const AZStd::string& s) { return TrimLeft(TrimRight(s)); } @@ -447,7 +447,7 @@ static inline TS RemoveDuplicateSpaces_Tpl(const TS& s) return res; } -string StringHelpers::RemoveDuplicateSpaces(const string& s) +string StringHelpers::RemoveDuplicateSpaces(const AZStd::string& s) { return RemoveDuplicateSpaces_Tpl(s); } @@ -470,7 +470,7 @@ static inline TS MakeLowerCase_Tpl(const TS& s) return copy; } -string StringHelpers::MakeLowerCase(const string& s) +string StringHelpers::MakeLowerCase(const AZStd::string& s) { return MakeLowerCase_Tpl(s); } @@ -493,7 +493,7 @@ static inline TS MakeUpperCase_Tpl(const TS& s) return copy; } -string StringHelpers::MakeUpperCase(const string& s) +string StringHelpers::MakeUpperCase(const AZStd::string& s) { return MakeUpperCase_Tpl(s); } @@ -517,7 +517,7 @@ static inline TS Replace_Tpl(const TS& s, const typename TS::value_type oldChar, return copy; } -string StringHelpers::Replace(const string& s, char oldChar, char newChar) +string StringHelpers::Replace(const AZStd::string& s, char oldChar, char newChar) { return Replace_Tpl(s, oldChar, newChar); } @@ -528,12 +528,12 @@ wstring StringHelpers::Replace(const wstring& s, wchar_t oldChar, wchar_t newCha } -void StringHelpers::ConvertStringByRef(string& out, const string& in) +void StringHelpers::ConvertStringByRef(string& out, const AZStd::string& in) { out = in; } -void StringHelpers::ConvertStringByRef(wstring& out, const string& in) +void StringHelpers::ConvertStringByRef(wstring& out, const AZStd::string& in) { Unicode::Convert(out, in); } @@ -630,7 +630,7 @@ static inline void SplitByAnyOf_Tpl(const TS& str, const TS& separators, bool bR -void StringHelpers::Split(const string& str, const string& separator, bool bReturnEmptyPartsToo, std::vector& outParts) +void StringHelpers::Split(const AZStd::string& str, const AZStd::string& separator, bool bReturnEmptyPartsToo, std::vector& outParts) { Split_Tpl(str, separator, bReturnEmptyPartsToo, outParts); } @@ -641,7 +641,7 @@ void StringHelpers::Split(const wstring& str, const wstring& separator, bool bRe } -void StringHelpers::SplitByAnyOf(const string& str, const string& separators, bool bReturnEmptyPartsToo, std::vector& outParts) +void StringHelpers::SplitByAnyOf(const AZStd::string& str, const AZStd::string& separators, bool bReturnEmptyPartsToo, std::vector& outParts) { SplitByAnyOf_Tpl(str, separators, bReturnEmptyPartsToo, outParts); } diff --git a/Code/Editor/Util/StringHelpers.h b/Code/Editor/Util/StringHelpers.h index da4aa9c9cc..ec5515fbc9 100644 --- a/Code/Editor/Util/StringHelpers.h +++ b/Code/Editor/Util/StringHelpers.h @@ -15,83 +15,83 @@ namespace StringHelpers { // compares two strings to see if they are the same or different, case sensitive // returns 0 if the strings are the same, a -1 if the first string is bigger, or a 1 if the second string is bigger - int Compare(const string& str0, const string& str1); + int Compare(const AZStd::string& str0, const AZStd::string& str1); int Compare(const wstring& str0, const wstring& str1); // compares two strings to see if they are the same or different, case is ignored // returns 0 if the strings are the same, a -1 if the first string is bigger, or a 1 if the second string is bigger - int CompareIgnoreCase(const string& str0, const string& str1); + int CompareIgnoreCase(const AZStd::string& str0, const AZStd::string& str1); int CompareIgnoreCase(const wstring& str0, const wstring& str1); // compares two strings to see if they are the same, case senstive // returns true if they are the same or false if they are different - bool Equals(const string& str0, const string& str1); + bool Equals(const AZStd::string& str0, const AZStd::string& str1); bool Equals(const wstring& str0, const wstring& str1); // compares two strings to see if they are the same, case is ignored // returns true if they are the same or false if they are different - bool EqualsIgnoreCase(const string& str0, const string& str1); + bool EqualsIgnoreCase(const AZStd::string& str0, const AZStd::string& str1); bool EqualsIgnoreCase(const wstring& str0, const wstring& str1); // checks to see if a string starts with a specified string, case sensitive // returns true if the string does start with a specified string or false if it does not - bool StartsWith(const string& str, const string& pattern); + bool StartsWith(const AZStd::string& str, const AZStd::string& pattern); bool StartsWith(const wstring& str, const wstring& pattern); // checks to see if a string starts with a specified string, case is ignored // returns true if the string does start with a specified string or false if it does not - bool StartsWithIgnoreCase(const string& str, const string& pattern); + bool StartsWithIgnoreCase(const AZStd::string& str, const AZStd::string& pattern); bool StartsWithIgnoreCase(const wstring& str, const wstring& pattern); // checks to see if a string ends with a specified string, case sensitive // returns true if the string does end with a specified string or false if it does not - bool EndsWith(const string& str, const string& pattern); + bool EndsWith(const AZStd::string& str, const AZStd::string& pattern); bool EndsWith(const wstring& str, const wstring& pattern); // checks to see if a string ends with a specified string, case is ignored // returns true if the string does end with a specified string or false if it does not - bool EndsWithIgnoreCase(const string& str, const string& pattern); + bool EndsWithIgnoreCase(const AZStd::string& str, const AZStd::string& pattern); bool EndsWithIgnoreCase(const wstring& str, const wstring& pattern); // checks to see if a string contains a specified string, case sensitive // returns true if the string does contain the specified string or false if it does not - bool Contains(const string& str, const string& pattern); + bool Contains(const AZStd::string& str, const AZStd::string& pattern); bool Contains(const wstring& str, const wstring& pattern); // checks to see if a string contains a specified string, case is ignored // returns true if the string does contain the specified string or false if it does not - bool ContainsIgnoreCase(const string& str, const string& pattern); + bool ContainsIgnoreCase(const AZStd::string& str, const AZStd::string& pattern); bool ContainsIgnoreCase(const wstring& str, const wstring& pattern); - string TrimLeft(const string& s); + string TrimLeft(const AZStd::string& s); wstring TrimLeft(const wstring& s); - string TrimRight(const string& s); + string TrimRight(const AZStd::string& s); wstring TrimRight(const wstring& s); - string Trim(const string& s); + string Trim(const AZStd::string& s); wstring Trim(const wstring& s); - string RemoveDuplicateSpaces(const string& s); + string RemoveDuplicateSpaces(const AZStd::string& s); wstring RemoveDuplicateSpaces(const wstring& s); // converts a string with upper case characters to be all lower case // returns the string in all lower case - string MakeLowerCase(const string& s); + string MakeLowerCase(const AZStd::string& s); wstring MakeLowerCase(const wstring& s); // converts a string with lower case characters to be all upper case // returns the string in all upper case - string MakeUpperCase(const string& s); + string MakeUpperCase(const AZStd::string& s); wstring MakeUpperCase(const wstring& s); // replace a specified character in a string with a specified replacement character // returns string with specified character replaced - string Replace(const string& s, char oldChar, char newChar); + string Replace(const AZStd::string& s, char oldChar, char newChar); wstring Replace(const wstring& s, wchar_t oldChar, wchar_t newChar); - void ConvertStringByRef(string& out, const string& in); - void ConvertStringByRef(wstring& out, const string& in); + void ConvertStringByRef(string& out, const AZStd::string& in); + void ConvertStringByRef(wstring& out, const AZStd::string& in); void ConvertStringByRef(string& out, const wstring& in); void ConvertStringByRef(wstring& out, const wstring& in); @@ -103,10 +103,10 @@ namespace StringHelpers return out; } - void Split(const string& str, const string& separator, bool bReturnEmptyPartsToo, std::vector& outParts); + void Split(const AZStd::string& str, const AZStd::string& separator, bool bReturnEmptyPartsToo, std::vector& outParts); void Split(const wstring& str, const wstring& separator, bool bReturnEmptyPartsToo, std::vector& outParts); - void SplitByAnyOf(const string& str, const string& separators, bool bReturnEmptyPartsToo, std::vector& outParts); + void SplitByAnyOf(const AZStd::string& str, const AZStd::string& separators, bool bReturnEmptyPartsToo, std::vector& outParts); void SplitByAnyOf(const wstring& str, const wstring& separators, bool bReturnEmptyPartsToo, std::vector& outParts); string FormatVA(const char* const format, va_list parg); diff --git a/Code/Editor/Util/XmlHistoryManager.cpp b/Code/Editor/Util/XmlHistoryManager.cpp index 3aea041d29..5a1bc237bb 100644 --- a/Code/Editor/Util/XmlHistoryManager.cpp +++ b/Code/Editor/Util/XmlHistoryManager.cpp @@ -419,7 +419,7 @@ void CXmlHistoryManager::ClearHistory(bool flagAsSaved) } ///////////////////////////////////////////////////////////////////////////// -const string& CXmlHistoryManager::GetVersionDesc(int number) const +const AZStd::string& CXmlHistoryManager::GetVersionDesc(int number) const { THistoryInfoMap::const_iterator it = m_HistoryInfoMap.find(number); if (it != m_HistoryInfoMap.end()) diff --git a/Code/Editor/Util/XmlHistoryManager.h b/Code/Editor/Util/XmlHistoryManager.h index d894bc7f00..12699536e5 100644 --- a/Code/Editor/Util/XmlHistoryManager.h +++ b/Code/Editor/Util/XmlHistoryManager.h @@ -103,7 +103,7 @@ public: // History void ClearHistory(bool flagAsSaved = false); int GetVersionCount() const { return m_LatestVersion; } - const string& GetVersionDesc(int number) const; + const AZStd::string& GetVersionDesc(int number) const; int GetCurrentVersionNumber() const { return m_CurrentVersion; } // Views diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp index 3c3c1183e4..23e967c3fa 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp @@ -417,7 +417,7 @@ namespace GridMate { GM_CLASS_ALLOCATOR(Connection); // make a pool and use it... - Connection(CarrierThread* threadOwner, const string& address); + Connection(CarrierThread* threadOwner, const AZStd::string& address); ~Connection(); CarrierThread* m_threadOwner; ///< Pointer to the carrier thread that operates with this connection. @@ -999,7 +999,7 @@ namespace GridMate /// Connect with host and port. This is ASync operation, the connection is active after OnConnectionEstablished is called. ConnectionID Connect(const char* hostAddress, unsigned int port) override; /// Connect with internal address format. This is ASync operation, the connection is active after OnConnectionEstablished is called. - ConnectionID Connect(const string& address) override; + ConnectionID Connect(const AZStd::string& address) override; /// Request a disconnect procedure. This is ASync operation, the connection is closed after OnDisconnect is called. void Disconnect(ConnectionID id) override; @@ -1118,7 +1118,7 @@ using namespace GridMate; // Connection ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -Connection::Connection(CarrierThread* threadOwner, const string& address) +Connection::Connection(CarrierThread* threadOwner, const AZStd::string& address) : m_threadOwner(threadOwner) , m_threadConn(NULL) , m_fullAddress(address) @@ -3740,7 +3740,7 @@ CarrierImpl::Connect(const char* hostAddress, unsigned int port) // [1/12/2011] //========================================================================= ConnectionID -CarrierImpl::Connect(const string& address) +CarrierImpl::Connect(const AZStd::string& address) { // check if we don't have it in the list. for(auto& i : m_connections) diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.h b/Code/Framework/GridMate/GridMate/Carrier/Carrier.h index 5bfa621af1..2968582c0d 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.h @@ -88,7 +88,7 @@ namespace GridMate /// Connect with host and port. This is ASync operation, the connection is active after OnConnectionEstablished is called. virtual ConnectionID Connect(const char* hostAddress, unsigned int port) = 0; /// Connect with internal address format. This is ASync operation, the connection is active after OnConnectionEstablished is called. - virtual ConnectionID Connect(const string& address) = 0; + virtual ConnectionID Connect(const AZStd::string& address) = 0; /// Request a disconnect procedure. This is ASync operation, the connection is closed after OnDisconnect is called. virtual void Disconnect(ConnectionID id) = 0; diff --git a/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.cpp b/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.cpp index bc657becbc..58436bb757 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.cpp @@ -98,7 +98,7 @@ DefaultHandshake::OnConfirmAck(ConnectionID id, ReadBuffer& rb) // [11/5/2010] //========================================================================= bool -DefaultHandshake::OnNewConnection(const string& address) +DefaultHandshake::OnNewConnection(const AZStd::string& address) { (void)address; return true; /// We don't have a ban list yet diff --git a/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.h b/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.h index 0b9240dfa3..8f456e4649 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.h +++ b/Code/Framework/GridMate/GridMate/Carrier/DefaultHandshake.h @@ -47,7 +47,7 @@ namespace GridMate */ virtual bool OnConfirmAck(ConnectionID id, ReadBuffer& rb); /// Return true if you want to reject early reject a connection. - virtual bool OnNewConnection(const string& address); + virtual bool OnNewConnection(const AZStd::string& address); /// Called when we close a connection. virtual void OnDisconnect(ConnectionID id); /// Return timeout in milliseconds of the handshake procedure. diff --git a/Code/Framework/GridMate/GridMate/Carrier/Driver.h b/Code/Framework/GridMate/GridMate/Carrier/Driver.h index 84e43b5acf..2c806be5e0 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Driver.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Driver.h @@ -140,7 +140,7 @@ namespace GridMate /// @{ Address conversion functionality. They MUST implemented thread safe. Generally this is not a problem since they just part local data. /// Create address from ip and port. If ip == NULL we will assign a broadcast address. virtual string IPPortToAddress(const char* ip, unsigned int port) const = 0; - virtual bool AddressToIPPort(const string& address, string& ip, unsigned int& port) const = 0; + virtual bool AddressToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) const = 0; /// @} /** @@ -150,7 +150,7 @@ namespace GridMate * \note Driver address allocates internal resources, use it only when you intend to communicate. Otherwise operate with * the string address. */ - virtual AZStd::intrusive_ptr CreateDriverAddress(const string& address) = 0; + virtual AZStd::intrusive_ptr CreateDriverAddress(const AZStd::string& address) = 0; /** * Returns true if the driver can accept new data (ex, has buffer space). diff --git a/Code/Framework/GridMate/GridMate/Carrier/Handshake.h b/Code/Framework/GridMate/GridMate/Carrier/Handshake.h index 5d06f2f1b8..ffd332b65c 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Handshake.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Handshake.h @@ -53,7 +53,7 @@ namespace GridMate */ virtual bool OnConfirmAck(ConnectionID id, ReadBuffer& rb) = 0; /// Return true if you want to reject early reject a connection. - virtual bool OnNewConnection(const string& address) = 0; + virtual bool OnNewConnection(const AZStd::string& address) = 0; /// Called when we close a connection. virtual void OnDisconnect(ConnectionID id) = 0; /// Return timeout in milliseconds of the handshake procedure. diff --git a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp index b75de6f383..fc3062062c 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp @@ -498,7 +498,7 @@ namespace GridMate } } - SocketDriverAddress::SocketDriverAddress(Driver* driver, const string& ip, unsigned int port) + SocketDriverAddress::SocketDriverAddress(Driver* driver, const AZStd::string& ip, unsigned int port) : DriverAddress(driver) { AZ_Assert(!ip.empty(), "Invalid address string!"); @@ -1156,7 +1156,7 @@ namespace GridMate // [3/4/2013] //========================================================================= bool - SocketDriverCommon::AddressStringToIPPort(const string& address, string& ip, unsigned int& port) + SocketDriverCommon::AddressStringToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) { AZStd::size_t pos = address.find('|'); AZ_Assert(pos != string::npos, "Invalid driver address!"); @@ -1176,7 +1176,7 @@ namespace GridMate // [7/11/2013] //========================================================================= Driver::BSDSocketFamilyType - SocketDriverCommon::AddressFamilyType(const string& ip) + SocketDriverCommon::AddressFamilyType(const AZStd::string& ip) { // TODO: We can/should use inet_ntop() to detect the family type AZStd::size_t pos = ip.find("."); @@ -1198,13 +1198,13 @@ namespace GridMate ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// //========================================================================= - // CreateDriverAddress(const string&) + // CreateDriverAddress(const AZStd::string&) // [1/12/2011] //========================================================================= AZStd::intrusive_ptr - SocketDriver::CreateDriverAddress(const string& address) + SocketDriver::CreateDriverAddress(const AZStd::string& address) { - string ip; + AZStd::string ip; unsigned int port; if (!AddressToIPPort(address, ip, port)) { @@ -1243,7 +1243,7 @@ namespace GridMate namespace Utils { // \note function moved here to use addinfo when IPV6 is not in use, consider moving those definitions to a header file - bool GetIpByHostName(int familyType, const char* hostName, string& ip) + bool GetIpByHostName(int familyType, const char* hostName, AZStd::string& ip) { static const size_t kMaxLen = 64; // max length of ipv6 ip is 45 chars, so all ips should be able to fit in this buf char ipBuf[kMaxLen]; diff --git a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h index bda135f532..7555c92639 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h +++ b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h @@ -83,7 +83,7 @@ namespace GridMate SocketDriverAddress(Driver* driver); SocketDriverAddress(Driver* driver, const sockaddr* addr); - SocketDriverAddress(Driver* driver, const string& ip, unsigned int port); + SocketDriverAddress(Driver* driver, const AZStd::string& ip, unsigned int port); bool operator==(const SocketDriverAddress& rhs) const; bool operator!=(const SocketDriverAddress& rhs) const; @@ -164,17 +164,17 @@ namespace GridMate /// @{ Address conversion functionality. They MUST implemented thread safe. Generally this is not a problem since they just part local data. /// Create address from ip and port. If ip == NULL we will assign a broadcast address. virtual string IPPortToAddress(const char* ip, unsigned int port) const { return IPPortToAddressString(ip, port); } - virtual bool AddressToIPPort(const string& address, string& ip, unsigned int& port) const { return AddressStringToIPPort(address, ip, port); } + virtual bool AddressToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) const { return AddressStringToIPPort(address, ip, port); } /// Create address for the socket driver from IP and port static string IPPortToAddressString(const char* ip, unsigned int port); /// Decompose an address to IP and port - static bool AddressStringToIPPort(const string& address, string& ip, unsigned int& port); + static bool AddressStringToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port); /// Return the family type of the address (AF_INET,AF_INET6 AF_UNSPEC) - static BSDSocketFamilyType AddressFamilyType(const string& ip); + static BSDSocketFamilyType AddressFamilyType(const AZStd::string& ip); static BSDSocketFamilyType AddressFamilyType(const char* ip) { return AddressFamilyType(string(ip)); } /// @} - virtual AZStd::intrusive_ptr CreateDriverAddress(const string& address) = 0; + virtual AZStd::intrusive_ptr CreateDriverAddress(const AZStd::string& address) = 0; /// Additional CreateDriverAddress function should be implemented. virtual AZStd::intrusive_ptr CreateDriverAddress(const sockaddr* sockAddr) = 0; @@ -352,7 +352,7 @@ namespace GridMate * \note Driver address allocates internal resources, use it only when you intend to communicate. Otherwise operate with * the string address. */ - virtual AZStd::intrusive_ptr CreateDriverAddress(const string& address); + virtual AZStd::intrusive_ptr CreateDriverAddress(const AZStd::string& address); virtual AZStd::intrusive_ptr CreateDriverAddress(const sockaddr* addr); /// Called only from the DriverAddress when the use count becomes 0 virtual void DestroyDriverAddress(DriverAddress* address); @@ -364,7 +364,7 @@ namespace GridMate namespace Utils { ///< Retrieves ip address corresponding to a host name. Blocks thread until dns resolving is happened. - bool GetIpByHostName(int familyType, const char* hostName, string& ip); + bool GetIpByHostName(int familyType, const char* hostName, AZStd::string& ip); } /** diff --git a/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.cpp b/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.cpp index 5a34b70e74..a7130218f8 100644 --- a/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.cpp +++ b/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.cpp @@ -224,7 +224,7 @@ namespace GridMate // [4/15/2011] //========================================================================= void - SessionDriller::OnSessionError(GridSession* session, const string& errorMsg) + SessionDriller::OnSessionError(GridSession* session, const AZStd::string& errorMsg) { m_output->BeginTag(m_drillerTag); m_output->BeginTag(AZ_CRC("SessionError", 0xc689cc40)); diff --git a/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.h b/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.h index b89fae3d73..59f178976f 100644 --- a/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.h +++ b/Code/Framework/GridMate/GridMate/Drillers/SessionDriller.h @@ -62,7 +62,7 @@ namespace GridMate /// Callback that notifies the title when a session will be left. session pointer is NOT valid after the callback returns. virtual void OnSessionDelete(GridSession* session); /// Called when a session error occurs. - virtual void OnSessionError(GridSession* session, const string& errorMsg); + virtual void OnSessionError(GridSession* session, const AZStd::string& errorMsg); /// Called when the actual game(match) starts virtual void OnSessionStart(GridSession* session); /// Called when the actual game(match) ends diff --git a/Code/Framework/GridMate/GridMate/Session/LANSession.cpp b/Code/Framework/GridMate/GridMate/Session/LANSession.cpp index fca43c2709..0127d8fa23 100644 --- a/Code/Framework/GridMate/GridMate/Session/LANSession.cpp +++ b/Code/Framework/GridMate/GridMate/Session/LANSession.cpp @@ -37,7 +37,7 @@ namespace GridMate { friend class LANMemberIDMarshaler; - static LANMemberID Create(MemberIDCompact id, const string& address) + static LANMemberID Create(MemberIDCompact id, const AZStd::string& address) { LANMemberID mid; mid.m_id = id; @@ -45,7 +45,7 @@ namespace GridMate return mid; } - void SetAddress(const string& address) + void SetAddress(const AZStd::string& address) { m_address = address; } @@ -120,14 +120,14 @@ namespace GridMate /// Creates the local player. GridMember* CreateLocalMember(bool isHost, bool isInvited, RemotePeerMode peerMode); /// Creates remote player, when he wants to join. - GridMember* CreateRemoteMember(const string& address, ReadBuffer& data, RemotePeerMode peerMode, ConnectionID connId = InvalidConnectionID) override; + GridMember* CreateRemoteMember(const AZStd::string& address, ReadBuffer& data, RemotePeerMode peerMode, ConnectionID connId = InvalidConnectionID) override; /// Called when we receive the session replica. We create one and return the pointer. LANSessionReplica* OnSessionReplicaArrived(); /// Called when session parameters have changed. void OnSessionParamChanged(const GridSessionParam& param) override { (void)param; } - void OnSessionParamRemoved(const string& paramId) override { (void)paramId; } + void OnSessionParamRemoved(const AZStd::string& paramId) override { (void)paramId; } private: explicit LANSession(LANSessionService* service); @@ -762,7 +762,7 @@ LANSession::CreateLocalMember(bool isHost, bool isInvited, RemotePeerMode peerMo // [2/2/2011] //========================================================================== GridMember* -LANSession::CreateRemoteMember(const string& address, ReadBuffer& data, RemotePeerMode peerMode, ConnectionID connId) +LANSession::CreateRemoteMember(const AZStd::string& address, ReadBuffer& data, RemotePeerMode peerMode, ConnectionID connId) { MemberIDCompact id; data.Read(id); @@ -803,7 +803,7 @@ LANSession::OnStateCreate(AZ::HSM& sm, const AZ::HSM::Event& e) { // patch the ID if we use implicit port AZ_Assert(m_carrier, "Carrier must be created!"); - string ip; + AZStd::string ip; unsigned int port; SocketDriverCommon::AddressStringToIPPort(m_myMember->GetId().ToAddress(), ip, port); AZ_Assert(port == 0 || port == m_carrier->GetPort(), "Carrier port missmatch! It should either be 0 (and patched here) in the implicit bind or the port number for explicit bind!"); diff --git a/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h b/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h index ee4c0a8659..20ade42a6e 100644 --- a/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h +++ b/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h @@ -39,9 +39,9 @@ namespace GridMate {} int m_familyType; ///< Socket driver specific, by default 0. - string m_serverAddress; ///< Address of the server, we empty we create a broadcast address. + AZStd::string m_serverAddress; ///< Address of the server, we empty we create a broadcast address. int m_serverPort; ///< Server port (must be provided). - string m_listenAddress; ///< Address to bind for listening. By default is empty, which means we are listening to any address. + AZStd::string m_listenAddress; ///< Address to bind for listening. By default is empty, which means we are listening to any address. int m_listenPort; ///< Search listen port, if not set we will use ephimeral port. unsigned int m_broadcastFrequencyMs; ///< Time in MS between search broadcasts. }; @@ -52,7 +52,7 @@ namespace GridMate struct LANSearchInfo : public SearchInfo { - string m_serverIP; ///< server ID as we see it + AZStd::string m_serverIP; ///< server ID as we see it AZ::u16 m_serverPort; ///< server port for the session }; } diff --git a/Code/Framework/GridMate/GridMate/Session/Session.cpp b/Code/Framework/GridMate/GridMate/Session/Session.cpp index 5746a91c19..8a9bdea273 100644 --- a/Code/Framework/GridMate/GridMate/Session/Session.cpp +++ b/Code/Framework/GridMate/GridMate/Session/Session.cpp @@ -92,7 +92,7 @@ namespace GridMate */ virtual bool OnConfirmAck(ConnectionID id, ReadBuffer& rb) { (void)id; (void)rb; return true; } // we don't do any further filtering /// Return true if you want to reject early reject a connection. - virtual bool OnNewConnection(const string& address); + virtual bool OnNewConnection(const AZStd::string& address); /// Called when we close a connection. virtual void OnDisconnect(ConnectionID id); /// Return timeout in milliseconds of the handshake procedure. @@ -684,7 +684,7 @@ GridSession::SetParam(const GridSessionParam& param) // RemoveParam //========================================================================= bool -GridSession::RemoveParam(const string& paramId) +GridSession::RemoveParam(const AZStd::string& paramId) { AZ_Assert(m_state, "Invalid session state replica. Session is not initialized."); @@ -970,7 +970,7 @@ GridSession::AddMember(GridMember* member) // IsAddressInMemberList //========================================================================= bool -GridSession::IsAddressInMemberList(const string& address) +GridSession::IsAddressInMemberList(const AZStd::string& address) { for (AZStd::size_t i = 0; i < m_members.size(); ++i) { @@ -2783,7 +2783,7 @@ bool GridSessionHandshake::OnConfirmRequest(ConnectionID id, ReadBuffer& rb) //========================================================================= // OnNewConnection //========================================================================= -bool GridSessionHandshake::OnNewConnection(const string& address) +bool GridSessionHandshake::OnNewConnection(const AZStd::string& address) { AZStd::lock_guard l(m_dataLock); diff --git a/Code/Framework/GridMate/GridMate/Session/Session.h b/Code/Framework/GridMate/GridMate/Session/Session.h index 63aa504a49..03556756ba 100644 --- a/Code/Framework/GridMate/GridMate/Session/Session.h +++ b/Code/Framework/GridMate/GridMate/Session/Session.h @@ -249,7 +249,7 @@ namespace GridMate /// Callback that notifies the title when a session will be left. session pointer is NOT valid after the callback returns. virtual void OnSessionDelete(GridSession* session) { (void)session; } /// Called when a session error occurs. - virtual void OnSessionError(GridSession* session, const string& errorMsg) { (void)session; (void)errorMsg; } + virtual void OnSessionError(GridSession* session, const AZStd::string& errorMsg) { (void)session; (void)errorMsg; } /// Called when the actual game(match) starts virtual void OnSessionStart(GridSession* session) { (void)session; } /// Called when the actual game(match) ends @@ -484,7 +484,7 @@ namespace GridMate // Adds/updates a parameter. Returns false if parameter can not be added. bool SetParam(const GridSessionParam& param); // Removes a parameter by id. Returns false if parameter can not be removed. - bool RemoveParam(const string& paramId); + bool RemoveParam(const AZStd::string& paramId); // Removes a parameter by index. Returns false if parameter can not be removed. bool RemoveParam(unsigned int index); @@ -543,9 +543,9 @@ namespace GridMate /// Frees a slot based on a slot type. void FreeSlot(int slotType); /// Creates remote player, when he wants to join. - virtual GridMember* CreateRemoteMember(const string& address, ReadBuffer& data, RemotePeerMode peerMode, ConnectionID connId = InvalidConnectionID) = 0; + virtual GridMember* CreateRemoteMember(const AZStd::string& address, ReadBuffer& data, RemotePeerMode peerMode, ConnectionID connId = InvalidConnectionID) = 0; /// Returns true if this address belongs to a member in the list, otherwise false. - virtual bool IsAddressInMemberList(const string& address); + virtual bool IsAddressInMemberList(const AZStd::string& address); virtual bool IsConnectionIdInMemberList(const ConnectionID& connId); /// Adds a created member to the session. Return false if no free slow was found! virtual bool AddMember(GridMember* member); @@ -558,7 +558,7 @@ namespace GridMate /// Called when a session parameter is added/changed. virtual void OnSessionParamChanged(const GridSessionParam& param) = 0; /// Called when a session parameter is deleted. - virtual void OnSessionParamRemoved(const string& paramId) = 0; + virtual void OnSessionParamRemoved(const AZStd::string& paramId) = 0; ////////////////////////////////////////////////////////////////////////// SessionID m_sessionId; ///< Session id. Content of the string will vary based on session types and platforms. @@ -975,7 +975,7 @@ namespace GridMate /// Callback that notifies the title when a session will be left. session pointer is NOT valid after the callback returns. virtual void OnSessionDelete(GridSession* session) { (void)session; } /// Called when a session error occurs. - virtual void OnSessionError(GridSession* session, const string& errorMsg) { (void)session; (void)errorMsg; } + virtual void OnSessionError(GridSession* session, const AZStd::string& errorMsg) { (void)session; (void)errorMsg; } /// Called when the actual game(match) starts virtual void OnSessionStart(GridSession* session) { (void)session; } /// Called when the actual game(match) ends diff --git a/Code/Framework/GridMate/Tests/Session.cpp b/Code/Framework/GridMate/Tests/Session.cpp index 9e10e84e98..0c5baef483 100644 --- a/Code/Framework/GridMate/Tests/Session.cpp +++ b/Code/Framework/GridMate/Tests/Session.cpp @@ -241,7 +241,7 @@ namespace UnitTest (void)reason; } - void OnSessionError(GridSession* session, const string& /*errorMsg*/) override + void OnSessionError(GridSession* session, const AZStd::string& /*errorMsg*/) override { (void)session; #ifndef AZ_LAN_TEST_MAIN_THREAD_BLOCKED // we will receive an error is we block for a long time @@ -599,7 +599,7 @@ namespace UnitTest (void)member; (void)reason; } - void OnSessionError(GridSession* session, const string& /*errorMsg*/) override + void OnSessionError(GridSession* session, const AZStd::string& /*errorMsg*/) override { (void)session; AZ_TEST_ASSERT(false); @@ -834,7 +834,7 @@ namespace UnitTest (void)member; (void)reason; } - void OnSessionError(GridSession* session, const string& /*errorMsg*/) override + void OnSessionError(GridSession* session, const AZStd::string& /*errorMsg*/) override { (void)session; #ifndef AZ_LAN_TEST_MAIN_THREAD_BLOCKED // we will receive an error is we block for a long time @@ -1207,7 +1207,7 @@ namespace UnitTest (void)member; (void)reason; } - void OnSessionError(GridSession* session, const string& /*errorMsg*/) override + void OnSessionError(GridSession* session, const AZStd::string& /*errorMsg*/) override { (void)session; AZ_TEST_ASSERT(false); @@ -1521,7 +1521,7 @@ namespace UnitTest (void)member; (void)reason; } - void OnSessionError(GridSession* session, const string& /*errorMsg*/) override + void OnSessionError(GridSession* session, const AZStd::string& /*errorMsg*/) override { (void)session; // On this test we will get a open port error because we have multiple hosts. This is ok, since we test migration here! @@ -1861,7 +1861,7 @@ namespace UnitTest (void)member; (void)reason; } - void OnSessionError(GridSession* session, const string& /*errorMsg*/) override + void OnSessionError(GridSession* session, const AZStd::string& /*errorMsg*/) override { (void)session; // On this test we will get a open port error because we have multiple hosts. This is ok, since we test migration here! diff --git a/Code/Framework/GridMate/Tests/TestProfiler.cpp b/Code/Framework/GridMate/Tests/TestProfiler.cpp index 428c1249ee..9f79d5a9fe 100644 --- a/Code/Framework/GridMate/Tests/TestProfiler.cpp +++ b/Code/Framework/GridMate/Tests/TestProfiler.cpp @@ -34,7 +34,7 @@ static bool CollectPerformanceCounters(const AZ::Debug::ProfilerRegister& reg, c return true; } -static string FormatString(const string& pre, const string& name, const string& post, AZ::u64 time, AZ::u64 calls) +static string FormatString(const AZStd::string& pre, const AZStd::string& name, const AZStd::string& post, AZ::u64 time, AZ::u64 calls) { string units = "us"; if (AZ::u64 divtime = time / 1000) diff --git a/Code/Legacy/CryCommon/LocalizationManagerBus.h b/Code/Legacy/CryCommon/LocalizationManagerBus.h index 69ab32cebf..1d818de111 100644 --- a/Code/Legacy/CryCommon/LocalizationManagerBus.h +++ b/Code/Legacy/CryCommon/LocalizationManagerBus.h @@ -102,7 +102,7 @@ public: virtual bool LocalizeString_ch(const char* sString, AZStd::string& outLocalizedString, bool bEnglish = false) = 0; // Summary: - // Same as LocalizeString( const char* sString, string& outLocalizedString, bool bEnglish=false ) + // Same as LocalizeString( const char* sString, AZStd::string& outLocalizedString, bool bEnglish=false ) // but at the moment this is faster. virtual bool LocalizeString_s(const AZStd::string& sString, AZStd::string& outLocalizedString, bool bEnglish = false) = 0; diff --git a/Code/Legacy/CryCommon/LyShine/Animation/IUiAnimation.h b/Code/Legacy/CryCommon/LyShine/Animation/IUiAnimation.h index 3515dab68e..e04fb6ada7 100644 --- a/Code/Legacy/CryCommon/LyShine/Animation/IUiAnimation.h +++ b/Code/Legacy/CryCommon/LyShine/Animation/IUiAnimation.h @@ -120,7 +120,7 @@ public: CUiAnimParamType() : m_type(eUiAnimParamType_Invalid) {} - CUiAnimParamType(const string& name) + CUiAnimParamType(const AZStd::string& name) { *this = name; } @@ -136,17 +136,12 @@ public: m_type = (EUiAnimParamType)type; } - void operator =(const string& name) - { - m_type = eUiAnimParamType_ByString; - m_name = name; - } - void operator =(const AZStd::string& name) { m_type = eUiAnimParamType_ByString; m_name = name.c_str(); } + // Convert to enum. This needs to be explicit, // otherwise operator== will be ambiguous EUiAnimParamType GetType() const { return m_type; } @@ -1301,7 +1296,7 @@ inline void SUiAnimContext::Serialize(IUiAnimationSystem* animationSystem, XmlNo { if (pSequence) { - string fullname = pSequence->GetName(); + AZStd::string fullname = pSequence->GetName(); xmlNode->setAttr("sequence", fullname.c_str()); } xmlNode->setAttr("dt", dt); diff --git a/Code/Legacy/CryCommon/LyShine/ISprite.h b/Code/Legacy/CryCommon/LyShine/ISprite.h index cd2b70ef25..373024d2db 100644 --- a/Code/Legacy/CryCommon/LyShine/ISprite.h +++ b/Code/Legacy/CryCommon/LyShine/ISprite.h @@ -59,10 +59,10 @@ public: // member functions virtual ~ISprite() {} //! Get the pathname of this sprite - virtual const string& GetPathname() const = 0; + virtual const AZStd::string& GetPathname() const = 0; //! Get the pathname of the texture of this sprite - virtual const string& GetTexturePathname() const = 0; + virtual const AZStd::string& GetTexturePathname() const = 0; //! Get the borders of this sprite virtual Borders GetBorders() const = 0; @@ -77,7 +77,7 @@ public: // member functions virtual void Serialize(TSerialize ser) = 0; //! Save this sprite data to disk - virtual bool SaveToXml(const string& pathname) = 0; + virtual bool SaveToXml(const AZStd::string& pathname) = 0; //! Test if this sprite has any borders virtual bool AreBordersZeroWidth() const = 0; @@ -136,4 +136,3 @@ public: // member functions //! Returns true if this sprite is configured as a sprite-sheet, false otherwise virtual bool IsSpriteSheet() const = 0; }; -