Plasma Engine  2.0
Loading...
Searching...
No Matches
StringBase_inl.h
1#pragma once
2
3template <typename Derived>
4PL_ALWAYS_INLINE const char* plStringBase<Derived>::InternalGetData() const
5{
6 const Derived* pDerived = static_cast<const Derived*>(this);
7 return pDerived->GetData();
8}
9
10template <typename Derived>
11PL_ALWAYS_INLINE const char* plStringBase<Derived>::InternalGetDataEnd() const
12{
13 const Derived* pDerived = static_cast<const Derived*>(this);
14 return pDerived->GetData() + pDerived->GetElementCount();
15}
16
17template <typename Derived>
18PL_ALWAYS_INLINE plUInt32 plStringBase<Derived>::InternalGetElementCount() const
19{
20 const Derived* pDerived = static_cast<const Derived*>(this);
21 return pDerived->GetElementCount();
23
24template <typename Derived>
25PL_ALWAYS_INLINE bool plStringBase<Derived>::IsEmpty() const
26{
27 return plStringUtils::IsNullOrEmpty(InternalGetData()) || (InternalGetData() == InternalGetDataEnd());
29
30template <typename Derived>
32{
33 return plStringUtils::StartsWith(InternalGetData(), sStartsWith.GetStartPointer(), InternalGetDataEnd(), sStartsWith.GetEndPointer());
35
36template <typename Derived>
39 return plStringUtils::StartsWith_NoCase(InternalGetData(), sStartsWith.GetStartPointer(), InternalGetDataEnd(), sStartsWith.GetEndPointer());
40}
41
42template <typename Derived>
44{
45 return plStringUtils::EndsWith(InternalGetData(), sEndsWith.GetStartPointer(), InternalGetDataEnd(), sEndsWith.GetEndPointer());
47
48template <typename Derived>
51 return plStringUtils::EndsWith_NoCase(InternalGetData(), sEndsWith.GetStartPointer(), InternalGetDataEnd(), sEndsWith.GetEndPointer());
52}
53
54template <typename Derived>
55const char* plStringBase<Derived>::FindSubString(plStringView sStringToFind, const char* szStartSearchAt /* = nullptr */) const
56{
57 if (szStartSearchAt == nullptr)
58 szStartSearchAt = InternalGetData();
59
60 PL_ASSERT_DEV((szStartSearchAt >= InternalGetData()) && (szStartSearchAt <= InternalGetDataEnd()), "The given pointer to start searching at is not inside this strings valid range.");
62 return plStringUtils::FindSubString(szStartSearchAt, sStringToFind.GetStartPointer(), InternalGetDataEnd(), sStringToFind.GetEndPointer());
63}
64
65template <typename Derived>
66const char* plStringBase<Derived>::FindSubString_NoCase(plStringView sStringToFind, const char* szStartSearchAt /* = nullptr */) const
67{
68 if (szStartSearchAt == nullptr)
69 szStartSearchAt = InternalGetData();
70
71 PL_ASSERT_DEV((szStartSearchAt >= InternalGetData()) && (szStartSearchAt <= InternalGetDataEnd()), "The given pointer to start searching at is not inside this strings valid range.");
73 return plStringUtils::FindSubString_NoCase(szStartSearchAt, sStringToFind.GetStartPointer(), InternalGetDataEnd(), sStringToFind.GetEndPointer());
74}
76template <typename Derived>
77inline const char* plStringBase<Derived>::FindLastSubString(plStringView sStringToFind, const char* szStartSearchAt /* = nullptr */) const
79 if (szStartSearchAt == nullptr)
80 szStartSearchAt = InternalGetDataEnd();
82 PL_ASSERT_DEV((szStartSearchAt >= InternalGetData()) && (szStartSearchAt <= InternalGetDataEnd()),
83 "The given pointer to start searching at is not inside this strings valid range.");
85 return plStringUtils::FindLastSubString(InternalGetData(), sStringToFind.GetStartPointer(), szStartSearchAt, InternalGetDataEnd(), sStringToFind.GetEndPointer());
86}
88template <typename Derived>
89inline const char* plStringBase<Derived>::FindLastSubString_NoCase(plStringView sStringToFind, const char* szStartSearchAt /* = nullptr */) const
90{
91 if (szStartSearchAt == nullptr)
92 szStartSearchAt = InternalGetDataEnd();
94 PL_ASSERT_DEV((szStartSearchAt >= InternalGetData()) && (szStartSearchAt <= InternalGetDataEnd()),
95 "The given pointer to start searching at is not inside this strings valid range.");
96
97 return plStringUtils::FindLastSubString_NoCase(InternalGetData(), sStringToFind.GetStartPointer(), szStartSearchAt, InternalGetDataEnd(), sStringToFind.GetEndPointer());
98}
100template <typename Derived>
101inline const char* plStringBase<Derived>::FindWholeWord(const char* szSearchFor, plStringUtils::PL_CHARACTER_FILTER isDelimiterCB, const char* szStartSearchAt /* = nullptr */) const
103 if (szStartSearchAt == nullptr)
104 szStartSearchAt = InternalGetData();
106 PL_ASSERT_DEV((szStartSearchAt >= InternalGetData()) && (szStartSearchAt <= InternalGetDataEnd()), "The given pointer to start searching at is not inside this strings valid range.");
107
108 return plStringUtils::FindWholeWord(szStartSearchAt, szSearchFor, isDelimiterCB, InternalGetDataEnd());
109}
110
111template <typename Derived>
112inline const char* plStringBase<Derived>::FindWholeWord_NoCase(const char* szSearchFor, plStringUtils::PL_CHARACTER_FILTER isDelimiterCB, const char* szStartSearchAt /* = nullptr */) const
113{
114 if (szStartSearchAt == nullptr)
115 szStartSearchAt = InternalGetData();
117 PL_ASSERT_DEV((szStartSearchAt >= InternalGetData()) && (szStartSearchAt <= InternalGetDataEnd()), "The given pointer to start searching at is not inside this strings valid range.");
118
119 return plStringUtils::FindWholeWord_NoCase(szStartSearchAt, szSearchFor, isDelimiterCB, InternalGetDataEnd());
120}
121
122template <typename Derived>
124{
125 return plStringUtils::Compare(InternalGetData(), sOther.GetStartPointer(), InternalGetDataEnd(), sOther.GetEndPointer());
127
128template <typename Derived>
129plInt32 plStringBase<Derived>::CompareN(plStringView sOther, plUInt32 uiCharsToCompare) const
130{
131 return plStringUtils::CompareN(InternalGetData(), sOther.GetStartPointer(), uiCharsToCompare, InternalGetDataEnd(), sOther.GetEndPointer());
132}
133
134template <typename Derived>
137 return plStringUtils::Compare_NoCase(InternalGetData(), sOther.GetStartPointer(), InternalGetDataEnd(), sOther.GetEndPointer());
138}
139
140template <typename Derived>
141plInt32 plStringBase<Derived>::CompareN_NoCase(plStringView sOther, plUInt32 uiCharsToCompare) const
142{
143 return plStringUtils::CompareN_NoCase(InternalGetData(), sOther.GetStartPointer(), uiCharsToCompare, InternalGetDataEnd(), sOther.GetEndPointer());
144}
146template <typename Derived>
149 return plStringUtils::IsEqual(InternalGetData(), sOther.GetStartPointer(), InternalGetDataEnd(), sOther.GetEndPointer());
150}
152template <typename Derived>
153bool plStringBase<Derived>::IsEqualN(plStringView sOther, plUInt32 uiCharsToCompare) const
155 return plStringUtils::IsEqualN(InternalGetData(), sOther.GetStartPointer(), uiCharsToCompare, InternalGetDataEnd(), sOther.GetEndPointer());
156}
157
158template <typename Derived>
160{
161 return plStringUtils::IsEqual_NoCase(InternalGetData(), sOther.GetStartPointer(), InternalGetDataEnd(), sOther.GetEndPointer());
162}
164template <typename Derived>
165bool plStringBase<Derived>::IsEqualN_NoCase(plStringView sOther, plUInt32 uiCharsToCompare) const
166{
167 return plStringUtils::IsEqualN_NoCase(InternalGetData(), sOther.GetStartPointer(), uiCharsToCompare, InternalGetDataEnd(), sOther.GetEndPointer());
168}
169
170template <typename Derived>
171const char* plStringBase<Derived>::ComputeCharacterPosition(plUInt32 uiCharacterIndex) const
172{
173 const char* pos = InternalGetData();
174 if (plUnicodeUtils::MoveToNextUtf8(pos, InternalGetDataEnd(), uiCharacterIndex).Failed())
175 return nullptr;
176
177 return pos;
178}
179
180template <typename Derived>
182{
183 return begin(*this);
184}
185
186template <typename Derived>
188{
189 return rbegin(*this);
190}
191
192template <typename DerivedLhs, typename DerivedRhs>
193PL_ALWAYS_INLINE bool operator==(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
194{
195 return lhs.IsEqual(rhs.GetView());
196}
197
198template <typename DerivedRhs>
199PL_ALWAYS_INLINE bool operator==(const char* lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
200{
201 return rhs.IsEqual(lhs);
202}
203
204template <typename DerivedLhs>
205PL_ALWAYS_INLINE bool operator==(const plStringBase<DerivedLhs>& lhs, const char* rhs) // [tested]
206{
207 return lhs.IsEqual(rhs);
208}
209
210#if PL_DISABLED(PL_USE_CPP20_OPERATORS)
211
212template <typename DerivedLhs, typename DerivedRhs>
213PL_ALWAYS_INLINE bool operator!=(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
214{
215 return !lhs.IsEqual(rhs);
216}
217
218template <typename DerivedRhs>
219PL_ALWAYS_INLINE bool operator!=(const char* lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
220{
221 return !rhs.IsEqual(lhs);
222}
223
224template <typename DerivedLhs>
225PL_ALWAYS_INLINE bool operator!=(const plStringBase<DerivedLhs>& lhs, const char* rhs) // [tested]
226{
227 return !lhs.IsEqual(rhs);
228}
229
230#endif
231
232#if PL_ENABLED(PL_USE_CPP20_OPERATORS)
233
234template <typename DerivedLhs, typename DerivedRhs>
235PL_ALWAYS_INLINE std::strong_ordering operator<=>(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs)
236{
237 return lhs.Compare(rhs) <=> 0;
238}
239
240template <typename DerivedLhs, typename DerivedRhs>
241PL_ALWAYS_INLINE std::strong_ordering operator<=>(const plStringBase<DerivedLhs>& lhs, const char* rhs)
242{
243 return lhs.Compare(rhs) <=> 0;
244}
245
246#else
247
248template <typename DerivedLhs, typename DerivedRhs>
249PL_ALWAYS_INLINE bool operator<(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
250{
251 return lhs.Compare(rhs) < 0;
252}
253
254template <typename DerivedRhs>
255PL_ALWAYS_INLINE bool operator<(const char* lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
256{
257 return rhs.Compare(lhs) > 0;
258}
259
260template <typename DerivedLhs>
261PL_ALWAYS_INLINE bool operator<(const plStringBase<DerivedLhs>& lhs, const char* rhs) // [tested]
262{
263 return lhs.Compare(rhs) < 0;
264}
265
266template <typename DerivedLhs, typename DerivedRhs>
267PL_ALWAYS_INLINE bool operator>(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
268{
269 return lhs.Compare(rhs) > 0;
270}
271
272template <typename DerivedRhs>
273PL_ALWAYS_INLINE bool operator>(const char* lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
274{
275 return rhs.Compare(lhs) < 0;
276}
277
278template <typename DerivedLhs>
279PL_ALWAYS_INLINE bool operator>(const plStringBase<DerivedLhs>& lhs, const char* rhs) // [tested]
280{
281 return lhs.Compare(rhs) > 0;
282}
283
284template <typename DerivedLhs, typename DerivedRhs>
285PL_ALWAYS_INLINE bool operator<=(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
286{
287 return plStringUtils::Compare(lhs.InternalGetData(), rhs.InternalGetData(), lhs.InternalGetDataEnd(), rhs.InternalGetDataEnd()) <= 0;
288}
289
290template <typename DerivedRhs>
291PL_ALWAYS_INLINE bool operator<=(const char* lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
292{
293 return rhs.Compare(lhs) >= 0;
294}
295
296template <typename DerivedLhs>
297PL_ALWAYS_INLINE bool operator<=(const plStringBase<DerivedLhs>& lhs, const char* rhs) // [tested]
298{
299 return lhs.Compare(rhs) <= 0;
300}
301
302template <typename DerivedLhs, typename DerivedRhs>
303PL_ALWAYS_INLINE bool operator>=(const plStringBase<DerivedLhs>& lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
304{
305 return plStringUtils::Compare(lhs.InternalGetData(), rhs.InternalGetData(), lhs.InternalGetDataEnd(), rhs.InternalGetDataEnd()) >= 0;
306}
307
308template <typename DerivedRhs>
309PL_ALWAYS_INLINE bool operator>=(const char* lhs, const plStringBase<DerivedRhs>& rhs) // [tested]
310{
311 return rhs.Compare(lhs) <= 0;
312}
313
314template <typename DerivedLhs>
315PL_ALWAYS_INLINE bool operator>=(const plStringBase<DerivedLhs>& lhs, const char* rhs) // [tested]
316{
317 return lhs.Compare(rhs) >= 0;
318}
319
320#endif
321
322template <typename DerivedLhs>
324{
325 return plStringView(InternalGetData(), InternalGetElementCount());
326}
327
328template <typename Derived>
330{
331 return plStringView(InternalGetData(), InternalGetElementCount());
332}
333
334template <typename Derived>
335template <typename Container>
336void plStringBase<Derived>::Split(bool bReturnEmptyStrings, Container& ref_output, const char* szSeparator1, const char* szSeparator2 /*= nullptr*/, const char* szSeparator3 /*= nullptr*/, const char* szSeparator4 /*= nullptr*/, const char* szSeparator5 /*= nullptr*/, const char* szSeparator6 /*= nullptr*/) const
337{
338 GetView().Split(bReturnEmptyStrings, ref_output, szSeparator1, szSeparator2, szSeparator3, szSeparator4, szSeparator5, szSeparator6);
339}
340
341template <typename Derived>
346
347template <typename Derived>
349{
350 return GetView().IsRootedPath();
351}
352
353template <typename Derived>
355{
356 return GetView().IsRelativePath();
357}
358
359template <typename Derived>
361{
362 return GetView().IsAbsolutePath();
363}
364
365template <typename Derived>
370
371template <typename Derived>
376
377template <typename Derived>
379{
380 return GetView().GetFileName();
381}
382
383template <typename Derived>
388
389template <typename Derived>
391{
392 return GetView().HasExtension(sExtension);
393}
394
395template <typename Derived>
397{
398 return GetView().HasAnyExtension();
399}
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 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 const char * FindSubString_NoCase(const char *szSource, const char *szStringToFind, const char *pSourceEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szStringToFindEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Searches for the first occurrence of szStringToFind in szSource. Ignores case.
Definition StringUtils.cpp:569
static bool EndsWith_NoCase(const char *szString, const char *szEndsWith, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szEndsWithEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true if szString ends with the string given in szEndsWith. Ignores case.
Definition StringUtils.cpp:517
static const char * FindSubString(const char *szSource, const char *szStringToFind, const char *pSourceEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szStringToFindEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Searches for the first occurrence of szStringToFind in szSource.
Definition StringUtils.cpp:550
static const char * FindWholeWord_NoCase(const char *szString, const char *szSearchFor, PL_CHARACTER_FILTER isDelimiterCB, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Searches szString for the word szSearchFor. If IsDelimiterCB returns true for both characters in fron...
Definition StringUtils.cpp:662
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 EndsWith(const char *szString, const char *szEndsWith, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szEndsWithEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true if szString ends with the string given in szEndsWith.
Definition StringUtils.cpp:501
bool(*)(plUInt32 uiChar) PL_CHARACTER_FILTER
Function Definition for a function that determines whether a (Utf32) character belongs to a certain c...
Definition StringUtils.h:209
static bool StartsWith(const char *szString, const char *szStartsWith, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szStartsWithEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true if szString starts with the string given in szStartsWith.
Definition StringUtils.cpp:453
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 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 const char * FindLastSubString_NoCase(const char *szSource, const char *szStringToFind, const char *szStartSearchAt=nullptr, const char *pSourceEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szStringToFindEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Searches for the last occurrence of szStringToFind in szSource before szStartSearchAt....
Definition StringUtils.cpp:611
static const char * FindLastSubString(const char *szSource, const char *szStringToFind, const char *szStartSearchAt=nullptr, const char *pSourceEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szStringToFindEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Searches for the last occurrence of szStringToFind in szSource before szStartSearchAt.
Definition StringUtils.cpp:589
static const char * FindWholeWord(const char *szString, const char *szSearchFor, PL_CHARACTER_FILTER isDelimiterCB, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Searches szString for the word szSearchFor. If IsDelimiterCB returns true for both characters in fron...
Definition StringUtils.cpp:632
static bool StartsWith_NoCase(const char *szString, const char *szStartsWith, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >(), const char *szStartsWithEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Returns true if szString starts with the string given in szStartsWith. Ignores case.
Definition StringUtils.cpp:477
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...
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
bool IsRootedPath() const
Returns true, if the given path represents a 'rooted' path. See plFileSystem for details.
Definition StringView.cpp:286
plStringView GetFileNameAndExtension() const
Returns the substring that represents the file name including the file extension.
Definition StringView.cpp:266
plStringView GetFileDirectory() const
Returns the directory of the given file, which is the substring up to the last path separator.
Definition StringView.cpp:271
const char * GetEndPointer() const
Returns the end of the view range. This will point to the byte AFTER the last character.
Definition StringView.h:108
plStringView GetFileExtension(bool bFullExtension=false) const
Returns the file extension of the given path. Will be empty, if the path does not end with a proper e...
Definition StringView.cpp:256
const char * GetStartPointer() const
Returns the start of the view range.
Definition StringView.h:102
plStringView GetRootedPathRootName() const
Extracts the root name from a rooted path.
Definition StringView.cpp:291
plStringView GetFileName() const
Returns the file name of a path, excluding the path and extension.
Definition StringView.cpp:261
bool HasExtension(plStringView sExtension) const
Checks whether the given path ends with the given extension. szExtension may start with a '....
Definition StringView.cpp:251
static plResult MoveToNextUtf8(const char *&ref_szUtf8, plUInt32 uiNumCharacters=1)
Moves the given string pointer ahead to the next Utf8 character sequence.
Definition UnicodeUtils_inl.h:201
Base class for strings, which implements all read-only string functions.
Definition StringBase.h:14
bool IsEqualN(plStringView sOther, plUInt32 uiCharsToCompare) const
Compares up to a given number of characters of this string with the other string for equality....
Definition StringBase_inl.h:153
bool IsAbsolutePath() const
Returns true, if the given path represents an absolute path on the current OS.
Definition StringBase_inl.h:360
const char * FindLastSubString(plStringView sStringToFind, const char *szStartSearchAt=nullptr) const
Definition StringBase_inl.h:77
bool IsRelativePath() const
Returns true, if the given path represents a relative path on the current OS.
Definition StringBase_inl.h:354
plInt32 CompareN_NoCase(plStringView sOther, plUInt32 uiCharsToCompare) const
Definition StringBase_inl.h:141
bool StartsWith_NoCase(plStringView sStartsWith) const
Returns true, if this string starts with the given string. Case insensitive.
Definition StringBase_inl.h:37
const char * FindLastSubString_NoCase(plStringView sStringToFind, const char *szStartSearchAt=nullptr) const
Definition StringBase_inl.h:89
plStringView GetFileNameAndExtension() const
Returns the substring that represents the file name including the file extension.
Definition StringBase_inl.h:372
bool IsEqualN_NoCase(plStringView sOther, plUInt32 uiCharsToCompare) const
Compares up to a given number of characters of this string with the other string for equality....
Definition StringBase_inl.h:165
bool StartsWith(plStringView sStartsWith) const
Returns true, if this string starts with the given string.
Definition StringBase_inl.h:31
plInt32 Compare(plStringView sOther) const
Compares this string with the other one. Returns 0 for equality, -1 if this string is 'smaller',...
Definition StringBase_inl.h:123
bool IsEmpty() const
Returns whether the string is an empty string.
Definition StringBase_inl.h:25
const char * FindSubString_NoCase(plStringView sStringToFind, const char *szStartSearchAt=nullptr) const
Definition StringBase_inl.h:66
bool EndsWith_NoCase(plStringView sEndsWith) const
Returns true, if this string ends with the given string. Case insensitive.
Definition StringBase_inl.h:49
plStringView GetFileName() const
Returns the file name of a path, excluding the path and extension.
Definition StringBase_inl.h:378
const char * FindWholeWord_NoCase(const char *szSearchFor, plStringUtils::PL_CHARACTER_FILTER isDelimiterCB, const char *szStartSearchAt=nullptr) const
Definition StringBase_inl.h:112
plInt32 Compare_NoCase(plStringView sOther) const
Compares this string with the other one. Returns 0 for equality, -1 if this string is 'smaller',...
Definition StringBase_inl.h:135
bool IsEqual(plStringView sOther) const
Compares this string with the other string for equality.
Definition StringBase_inl.h:147
plInt32 CompareN(plStringView sOther, plUInt32 uiCharsToCompare) const
Definition StringBase_inl.h:129
plStringView GetRootedPathRootName() const
Extracts the root name from a rooted path.
Definition StringBase_inl.h:342
reverse_iterator GetIteratorBack() const
Returns an iterator to this string, which points to the very last character (NOT the end).
Definition StringBase_inl.h:187
bool HasAnyExtension() const
Checks whether the given path has any file extension.
Definition StringBase_inl.h:396
void Split(bool bReturnEmptyStrings, Container &ref_output, const char *szSeparator1, const char *szSeparator2=nullptr, const char *szSeparator3=nullptr, const char *szSeparator4=nullptr, const char *szSeparator5=nullptr, const char *szSeparator6=nullptr) const
Fills the given container with plStringView's which represent each found substring....
Definition StringBase_inl.h:336
const char * ComputeCharacterPosition(plUInt32 uiCharacterIndex) const
Computes the pointer to the n-th character in the string. This is a linear search from the start.
Definition StringBase_inl.h:171
bool EndsWith(plStringView sEndsWith) const
Returns true, if this string ends with the given string.
Definition StringBase_inl.h:43
bool HasExtension(plStringView sExtension) const
Checks whether the given path ends with the given extension. szExtension should start with a '....
Definition StringBase_inl.h:390
iterator GetIteratorFront() const
Returns an iterator to this string, which points to the very first character.
Definition StringBase_inl.h:181
plStringView GetFileExtension() const
Returns the file extension of the given path. Will be empty, if the path does not end with a proper e...
Definition StringBase_inl.h:384
bool IsEqual_NoCase(plStringView sOther) const
Compares this string with the other string for equality.
Definition StringBase_inl.h:159
plStringView GetFileDirectory() const
Returns the directory of the given file, which is the substring up to the last path separator.
Definition StringBase_inl.h:366
plStringView GetView() const
Returns a string view to this string's data.
Definition StringBase_inl.h:329
bool IsRootedPath() const
Returns true, if the given path represents a 'rooted' path. See plFileSystem for details.
Definition StringBase_inl.h:348
const char * FindWholeWord(const char *szSearchFor, plStringUtils::PL_CHARACTER_FILTER isDelimiterCB, const char *szStartSearchAt=nullptr) const
Definition StringBase_inl.h:101
const char * FindSubString(plStringView sStringToFind, const char *szStartSearchAt=nullptr) const
Definition StringBase_inl.h:55
STL forward iterator used by all string classes. Iterates over unicode characters....
Definition StringIterator.h:10
STL reverse iterator used by all string classes. Iterates over unicode characters....
Definition StringIterator.h:163