5 return (plInt32)uiCharacter1 - (plInt32)uiCharacter2;
26 return (pString ==
nullptr) || (pString[0] ==
'\0');
32 return (pString ==
nullptr) || (pString[0] ==
'\0') || pString == pStringEnd;
49 if (pString ==
nullptr)
53 while (*pString !=
'\0')
69 return (plUInt32)(pStringEnd - pString);
72 while ((*pString !=
'\0') && (pString < pStringEnd))
86 plUInt32 uiCharacters = 0;
88 while ((*szUtf8 !=
'\0') && (szUtf8 < pStringEnd))
102 ref_uiCharacterCount = 0;
103 ref_uiElementCount = 0;
108 while (szUtf8 < pStringEnd)
110 char uiByte = *szUtf8;
118 ++ref_uiCharacterCount;
121 ++ref_uiElementCount;
125PL_ALWAYS_INLINE
bool plStringUtils::IsEqual(
const char* pString1,
const char* pString2,
const char* pString1End,
const char* pString2End)
131 const char* pString1,
const char* pString2, plUInt32 uiCharsToCompare,
const char* pString1End,
const char* pString2End)
142 const char* pString1,
const char* pString2, plUInt32 uiCharsToCompare,
const char* pString1End,
const char* pString2End)
149 return (uiChar >=
'0' && uiChar <=
'9');
154 return IsDecimalDigit(uiChar) || (uiChar >=
'A' && uiChar <=
'F') || (uiChar >=
'a' && uiChar <=
'f');
static bool IsEqual(const char *pString1, const char *pString2, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true, if the two given strings are identical (bitwise).
Definition StringUtils_inl.h:125
static plInt32 Compare_NoCase(const char *pString1, const char *pString2, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Compares two strings for equality, case-insensitive.
Definition StringUtils.cpp:286
static plInt32 CompareChars_NoCase(plUInt32 uiCharacter1, plUInt32 uiCharacter2)
Compares the two code points for equality, case-insensitive.
Definition StringUtils_inl.h:8
static plInt32 CompareN(const char *pString1, const char *pString2, plUInt32 uiCharsToCompare, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Compares the first uiCharsToCompare characters of the two strings for equality.
Definition StringUtils.cpp:247
static plInt32 CompareN_NoCase(const char *pString1, const char *pString2, plUInt32 uiCharsToCompare, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Compares the first uiCharsToCompare characters of the two strings for equality, case-insensitive.
Definition StringUtils.cpp:320
static bool IsEqual_NoCase(const char *pString1, const char *pString2, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true, if the two given strings are identical (case-insensitive).
Definition StringUtils_inl.h:136
static void UpdateStringEnd(const T *pStringStart, const T *&ref_pStringEnd)
Recomputes the end pointer of a string (szStringEnd), if that is currently set to plMaxStringEnd....
static plInt32 CompareChars(plUInt32 uiCharacter1, plUInt32 uiCharacter2)
Compares the two code points for equality.
Definition StringUtils_inl.h:3
static bool IsDecimalDigit(plUInt32 uiChar)
A decimal digit from 0..9.
Definition StringUtils_inl.h:147
static plInt32 Compare(const char *pString1, const char *pString2, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Compares two strings for equality.
Definition StringUtils.cpp:218
static bool IsHexDigit(plUInt32 uiChar)
A hexadecimal digit from 0..F.
Definition StringUtils_inl.h:152
static bool IsEqualN_NoCase(const char *pString1, const char *pString2, plUInt32 uiCharsToCompare, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true, if the two given strings are identical (case-insensitive) up to the n-th character.
Definition StringUtils_inl.h:141
static constexpr plUInt32 GetStringElementCount(const T *pString)
Returns the number of elements of type T that the string contains, until it hits an element that is z...
Definition StringUtils_inl.h:45
static bool IsEqualN(const char *pString1, const char *pString2, plUInt32 uiCharsToCompare, const char *pString1End=plUnicodeUtils::GetMaxStringEnd< char >(), const char *pString2End=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true, if the two given strings are identical (bitwise) up to the n-th character.
Definition StringUtils_inl.h:130
static plUInt32 GetCharacterCount(const char *szUtf8, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Returns the number of characters (not Bytes!) in a Utf8 string (excluding the zero terminator),...
Definition StringUtils_inl.h:81
static plUInt32 ToUpperChar(plUInt32 uiChar)
Returns the upper case code point for uiChar.
Definition StringUtils.cpp:10
static void GetCharacterAndElementCount(const char *szUtf8, plUInt32 &ref_uiCharacterCount, plUInt32 &ref_uiElementCount, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Returns both the number of characters and the number of bytes in a Utf8 string, until it hits zero or...
Definition StringUtils_inl.h:100
static constexpr bool IsNullOrEmpty(const T *pString)
Returns true, if the given string is a nullptr pointer or a string that immediately terminates with a...
static constexpr T * GetMaxStringEnd()
[internal] Returns the max string end pointer for the given type
Definition UnicodeUtils_inl.h:261
static plUInt32 ConvertUtf8ToUtf32(const char *pFirstChar)
Converts the UTF-8 character that starts at pFirstChar into a UTF-32 character.
Definition UnicodeUtils_inl.h:124
static bool IsUtf8ContinuationByte(char iByte)
Checks whether the given byte is a byte in a UTF-8 multi-byte sequence.
Definition UnicodeUtils_inl.h:17