removing files that got added by rebase
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> (+1 squashed commits) Squashed commits: [a19269426] fixing more strings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> (+1 squashed commits) Squashed commits: [d2a049324] fixing more strings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> (+1 squashed commits) Squashed commits: [a1ff4c101] trying to build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -230,7 +230,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline bool EndsWithSlash(CryStackStringT<char, size>* path)
|
||||
inline bool EndsWithSlash(AZStd::fixed_string<size>* path)
|
||||
{
|
||||
if ((!path) || (path->empty()))
|
||||
{
|
||||
@@ -271,7 +271,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline void AddBackslash(CryStackStringT<char, size>* path)
|
||||
inline void AddBackslash(AZstd::fixed_string<size>* path)
|
||||
{
|
||||
if (path->empty())
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline void AddSlash(CryStackStringT<char, size>* path)
|
||||
inline void AddSlash(AZstd::fixed_string<size>* path)
|
||||
{
|
||||
if (path->empty())
|
||||
{
|
||||
|
||||
@@ -380,126 +380,6 @@ bool StringHelpers::ContainsIgnoreCase(const wstring& str, const wstring& patter
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcards(const string& str, const string& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseSensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcards(const wstring& str, const wstring& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseSensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCase(const string& str, const string& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseInsensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCase(const wstring& str, const wstring& wildcards)
|
||||
{
|
||||
using namespace CryStringUtils_Internal;
|
||||
return MatchesWildcards_Tpl<SCharComparatorCaseInsensitive>(str.c_str(), wildcards.c_str());
|
||||
}
|
||||
|
||||
|
||||
template <class TS>
|
||||
static inline bool MatchesWildcardsIgnoreCaseExt_Tpl(const TS& str, const TS& wildcards, std::vector<TS>& wildcardMatches)
|
||||
{
|
||||
const typename TS::value_type* savedStrBegin = 0;
|
||||
const typename TS::value_type* savedStrEnd = 0;
|
||||
const typename TS::value_type* savedWild = 0;
|
||||
size_t savedWildCount = 0;
|
||||
|
||||
const typename TS::value_type* pStr = str.c_str();
|
||||
const typename TS::value_type* pWild = wildcards.c_str();
|
||||
size_t wildCount = 0;
|
||||
|
||||
while ((*pStr) && (*pWild != '*'))
|
||||
{
|
||||
if (*pWild == '?')
|
||||
{
|
||||
wildcardMatches.push_back(TS(pStr, pStr + 1));
|
||||
++wildCount;
|
||||
}
|
||||
else if (ToLower(*pWild) != ToLower(*pStr))
|
||||
{
|
||||
wildcardMatches.resize(wildcardMatches.size() - wildCount);
|
||||
return false;
|
||||
}
|
||||
++pWild;
|
||||
++pStr;
|
||||
}
|
||||
|
||||
while (*pStr)
|
||||
{
|
||||
if (*pWild == '*')
|
||||
{
|
||||
if (!pWild[1])
|
||||
{
|
||||
wildcardMatches.push_back(TS(pStr));
|
||||
return true;
|
||||
}
|
||||
savedWild = pWild++;
|
||||
savedStrBegin = pStr;
|
||||
savedStrEnd = pStr;
|
||||
savedWildCount = wildCount;
|
||||
wildcardMatches.push_back(TS(savedStrBegin, savedStrEnd));
|
||||
++wildCount;
|
||||
}
|
||||
else if (*pWild == '?')
|
||||
{
|
||||
wildcardMatches.push_back(TS(pStr, pStr + 1));
|
||||
++wildCount;
|
||||
++pWild;
|
||||
++pStr;
|
||||
}
|
||||
else if (ToLower(*pWild) == ToLower(*pStr))
|
||||
{
|
||||
++pWild;
|
||||
++pStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
wildcardMatches.resize(wildcardMatches.size() - (wildCount - savedWildCount));
|
||||
wildCount = savedWildCount;
|
||||
++savedStrEnd;
|
||||
pWild = savedWild + 1;
|
||||
pStr = savedStrEnd;
|
||||
wildcardMatches.push_back(TS(savedStrBegin, savedStrEnd));
|
||||
++wildCount;
|
||||
}
|
||||
}
|
||||
|
||||
while (*pWild == '*')
|
||||
{
|
||||
++pWild;
|
||||
wildcardMatches.push_back(TS());
|
||||
++wildCount;
|
||||
}
|
||||
|
||||
if (*pWild)
|
||||
{
|
||||
wildcardMatches.resize(wildcardMatches.size() - wildCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCaseExt(const string& str, const string& wildcards, std::vector<string>& wildcardMatches)
|
||||
{
|
||||
return MatchesWildcardsIgnoreCaseExt_Tpl(str, wildcards, wildcardMatches);
|
||||
}
|
||||
|
||||
bool StringHelpers::MatchesWildcardsIgnoreCaseExt(const wstring& str, const wstring& wildcards, std::vector<wstring>& wildcardMatches)
|
||||
{
|
||||
return MatchesWildcardsIgnoreCaseExt_Tpl(str, wildcards, wildcardMatches);
|
||||
}
|
||||
|
||||
|
||||
string StringHelpers::TrimLeft(const string& s)
|
||||
{
|
||||
const size_t first = s.find_first_not_of(" \r\t");
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#define CRYINCLUDE_CRYCOMMONTOOLS_STRINGHELPERS_H
|
||||
#pragma once
|
||||
|
||||
#include <CryString.h>
|
||||
|
||||
namespace StringHelpers
|
||||
{
|
||||
// compares two strings to see if they are the same or different, case sensitive
|
||||
@@ -65,19 +63,6 @@ namespace StringHelpers
|
||||
bool ContainsIgnoreCase(const string& str, const string& pattern);
|
||||
bool ContainsIgnoreCase(const wstring& str, const wstring& pattern);
|
||||
|
||||
// checks to see if a string contains a wildcard string pattern, case sensitive
|
||||
// returns true if the string does match the wildcard string pattern or false if it does not
|
||||
bool MatchesWildcards(const string& str, const string& wildcards);
|
||||
bool MatchesWildcards(const wstring& str, const wstring& wildcards);
|
||||
|
||||
// checks to see if a string contains a wildcard string pattern, case is ignored
|
||||
// returns true if the string does match the wildcard string pattern or false if it does not
|
||||
bool MatchesWildcardsIgnoreCase(const string& str, const string& wildcards);
|
||||
bool MatchesWildcardsIgnoreCase(const wstring& str, const wstring& wildcards);
|
||||
|
||||
bool MatchesWildcardsIgnoreCaseExt(const string& str, const string& wildcards, std::vector<string>& wildcardMatches);
|
||||
bool MatchesWildcardsIgnoreCaseExt(const wstring& str, const wstring& wildcards, std::vector<wstring>& wildcardMatches);
|
||||
|
||||
string TrimLeft(const string& s);
|
||||
wstring TrimLeft(const wstring& s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user