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
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