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