auto-search/replace

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-02 16:07:23 -07:00
parent d5c491a694
commit 061cb98f74
33 changed files with 179 additions and 184 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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 += ".";
+11 -11
View File
@@ -48,20 +48,20 @@ public:
const AZStd::function<void()>& 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<string>& 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);
};
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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;
+55 -55
View File
@@ -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<void()>& 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<RT()>& 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<void(LIST(1, P))>& 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<RT(LIST(1, P))>& 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<void(LIST(2, P))>& 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<RT(LIST(2, P))>& 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<void(LIST(3, P))>& 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<RT(LIST(3, P))>& 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<void(LIST(4, P))>& 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<RT(LIST(4, P))>& 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<void(LIST(5, P))>& 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<void(LIST(6, P))>& functor);
QString Execute(const CArgs& args);
@@ -353,8 +353,8 @@ protected:
//////////////////////////////////////////////////////////////////////////
template <typename RT>
CCommand0wRet<RT>::CCommand0wRet(const string& module, const string& name,
const string& description, const string& example,
CCommand0wRet<RT>::CCommand0wRet(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<RT()>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -373,8 +373,8 @@ QString CCommand0wRet<RT>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(1, typename P)>
CCommand1<LIST(1, P)>::CCommand1(const string& module, const string& name,
const string& description, const string& example,
CCommand1<LIST(1, P)>::CCommand1(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<void(LIST(1, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -410,8 +410,8 @@ QString CCommand1<LIST(1, P)>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(1, typename P), typename RT>
CCommand1wRet<LIST(1, P), RT>::CCommand1wRet(const string& module, const string& name,
const string& description, const string& example,
CCommand1wRet<LIST(1, P), RT>::CCommand1wRet(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<RT(LIST(1, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -448,8 +448,8 @@ QString CCommand1wRet<LIST(1, P), RT>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(2, typename P)>
CCommand2<LIST(2, P)>::CCommand2(const string& module, const string& name,
const string& description, const string& example,
CCommand2<LIST(2, P)>::CCommand2(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<void(LIST(2, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -487,8 +487,8 @@ QString CCommand2<LIST(2, P)>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(2, typename P), typename RT>
CCommand2wRet<LIST(2, P), RT>::CCommand2wRet(const string& module, const string& name,
const string& description, const string& example,
CCommand2wRet<LIST(2, P), RT>::CCommand2wRet(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<RT(LIST(2, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -527,8 +527,8 @@ QString CCommand2wRet<LIST(2, P), RT>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(3, typename P)>
CCommand3<LIST(3, P)>::CCommand3(const string& module, const string& name,
const string& description, const string& example,
CCommand3<LIST(3, P)>::CCommand3(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<void(LIST(3, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -568,8 +568,8 @@ QString CCommand3<LIST(3, P)>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(3, typename P), typename RT>
CCommand3wRet<LIST(3, P), RT>::CCommand3wRet(const string& module, const string& name,
const string& description, const string& example,
CCommand3wRet<LIST(3, P), RT>::CCommand3wRet(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<RT(LIST(3, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -610,8 +610,8 @@ QString CCommand3wRet<LIST(3, P), RT>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(4, typename P)>
CCommand4<LIST(4, P)>::CCommand4(const string& module, const string& name,
const string& description, const string& example,
CCommand4<LIST(4, P)>::CCommand4(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<void(LIST(4, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -654,8 +654,8 @@ QString CCommand4<LIST(4, P)>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(4, typename P), typename RT>
CCommand4wRet<LIST(4, P), RT>::CCommand4wRet(const string& module, const string& name,
const string& description, const string& example,
CCommand4wRet<LIST(4, P), RT>::CCommand4wRet(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<RT(LIST(4, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -699,8 +699,8 @@ QString CCommand4wRet<LIST(4, P), RT>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(5, typename P)>
CCommand5<LIST(5, P)>::CCommand5(const string& module, const string& name,
const string& description, const string& example,
CCommand5<LIST(5, P)>::CCommand5(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<void(LIST(5, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -745,8 +745,8 @@ QString CCommand5<LIST(5, P)>::Execute(const CCommand::CArgs& args)
//////////////////////////////////////////////////////////////////////////
template <LIST(6, typename P)>
CCommand6<LIST(6, P)>::CCommand6(const string& module, const string& name,
const string& description, const string& example,
CCommand6<LIST(6, P)>::CCommand6(const AZStd::string& module, const AZStd::string& name,
const AZStd::string& description, const AZStd::string& example,
const AZStd::function<void(LIST(6, P))>& functor)
: CCommand(module, name, description, example)
, m_functor(functor)
@@ -41,7 +41,7 @@ public:
return m_editor;
}
const string& GetToolName() const
const AZStd::string& GetToolName() const
{
return m_toolName;
}
+1
View File
@@ -18,6 +18,7 @@
#include <IXml.h>
#include "Util/FileUtil.h"
#include <Cry_Color.h>
#include <CryCommon/ISystem.h>
//! Typedef for quaternion.
//typedef CryQuat Quat;
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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
+21 -21
View File
@@ -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<string>& outParts)
void StringHelpers::Split(const AZStd::string& str, const AZStd::string& separator, bool bReturnEmptyPartsToo, std::vector<string>& 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<string>& outParts)
void StringHelpers::SplitByAnyOf(const AZStd::string& str, const AZStd::string& separators, bool bReturnEmptyPartsToo, std::vector<string>& outParts)
{
SplitByAnyOf_Tpl(str, separators, bReturnEmptyPartsToo, outParts);
}
+21 -21
View File
@@ -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<string>& outParts);
void Split(const AZStd::string& str, const AZStd::string& separator, bool bReturnEmptyPartsToo, std::vector<string>& outParts);
void Split(const wstring& str, const wstring& separator, bool bReturnEmptyPartsToo, std::vector<wstring>& outParts);
void SplitByAnyOf(const string& str, const string& separators, bool bReturnEmptyPartsToo, std::vector<string>& outParts);
void SplitByAnyOf(const AZStd::string& str, const AZStd::string& separators, bool bReturnEmptyPartsToo, std::vector<string>& outParts);
void SplitByAnyOf(const wstring& str, const wstring& separators, bool bReturnEmptyPartsToo, std::vector<wstring>& outParts);
string FormatVA(const char* const format, va_list parg);
+1 -1
View File
@@ -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())
+1 -1
View File
@@ -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
@@ -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)
@@ -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;
@@ -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
@@ -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.
@@ -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<DriverAddress> CreateDriverAddress(const string& address) = 0;
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address) = 0;
/**
* Returns true if the driver can accept new data (ex, has buffer space).
@@ -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.
@@ -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<DriverAddress>
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];
@@ -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<DriverAddress> CreateDriverAddress(const string& address) = 0;
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address) = 0;
/// Additional CreateDriverAddress function should be implemented.
virtual AZStd::intrusive_ptr<DriverAddress> 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<DriverAddress> CreateDriverAddress(const string& address);
virtual AZStd::intrusive_ptr<DriverAddress> CreateDriverAddress(const AZStd::string& address);
virtual AZStd::intrusive_ptr<DriverAddress> 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);
}
/**
@@ -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));
@@ -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
@@ -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!");
@@ -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
};
}
@@ -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<AZStd::mutex> l(m_dataLock);
@@ -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
+6 -6
View File
@@ -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!
@@ -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)
@@ -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;
@@ -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);
+3 -4
View File
@@ -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;
};