3#include <Foundation/Strings/StringView.h>
7 template <
typename T,
bool isString>
12template <
typename Derived>
108 PL_ALWAYS_INLINE
operator const char*()
const {
return InternalGetData(); }
115 template <
typename Container>
116 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;
165#if PL_ENABLED(PL_INTEROP_STL_STRINGS)
167 PL_ALWAYS_INLINE std::string_view GetAsStdView()
const
169 return std::string_view(InternalGetData(),
static_cast<size_t>(InternalGetElementCount()));
172 PL_ALWAYS_INLINE std::string GetAsStdString()
const
174 return std::string(GetAsStdView());
178 PL_ALWAYS_INLINE
operator std::string_view()
const
180 return GetAsStdView();
184 PL_ALWAYS_INLINE
operator std::string()
const
186 return std::string(GetAsStdView());
191 const char* InternalGetData()
const;
192 const char* InternalGetDataEnd()
const;
193 plUInt32 InternalGetElementCount()
const;
195 template <
typename Derived2>
198 template <
typename Derived2>
201 template <
typename Derived2>
204 template <
typename Derived2>
207 template <
typename Derived2>
210 template <
typename Derived2>
213 template <
typename Derived2>
216 template <
typename Derived2>
221template <
typename Derived>
227template <
typename Derived>
233template <
typename Derived>
239template <
typename Derived>
246template <
typename Derived>
252template <
typename Derived>
258template <
typename Derived>
264template <
typename Derived>
270#include <Foundation/Strings/Implementation/StringBase_inl.h>
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
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Definition StringBase.h:8
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
Base class which marks a class as containing string data.
Definition StringView.h:19