1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed false signature change with multiple extensions

This commit is contained in:
Brian Fiete 2020-12-31 09:56:51 -08:00
parent f81a1cf896
commit fa65029dfa
7 changed files with 155 additions and 8 deletions

View file

@ -16,6 +16,17 @@ struct StringSplitEnumerator;
class StringView
{
public:
enum CompareKind
{
CompareKind_CurrentCulture = 0,
CompareKind_CurrentCultureIgnoreCase = 1,
CompareKind_InvariantCulture = 2,
CompareKind_InvariantCultureIgnoreCase = 3,
CompareKind_Ordinal = 4,
CompareKind_OrdinalIgnoreCase = 5,
};
public:
const char* mPtr;
intptr mLength;
@ -253,6 +264,23 @@ public:
return mLength;
}
bool StartsWith(const StringView& b, CompareKind comparisonType = CompareKind_Ordinal) const;
bool EndsWith(const StringView& b, CompareKind comparisonType = CompareKind_Ordinal) const;
bool StartsWith(char c) const
{
if (this->mLength == 0)
return false;
return this->mPtr[0] == c;
}
bool EndsWith(char c) const
{
if (this->mLength == 0)
return false;
return this->mPtr[this->mLength - 1] == c;
}
intptr IndexOf(const StringView& subStr, bool ignoreCase = false) const;
intptr IndexOf(const StringView& subStr, int32 startIdx) const;
intptr IndexOf(const StringView& subStr, int64 startIdx) const;
@ -488,6 +516,8 @@ public:
CompareKind_OrdinalIgnoreCase = 5,
};
friend class StringView;
public:
typedef int int_strsize;