Class StringViewBase
Represents static text view as a sequence of characters. Characters sequence might not be null-terminated.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Core/Types/StringView.h
Syntax
public class StringViewBase<T>
Type Parameters
T
|
Constructors
DEPRECATED("Use GetText instead") const T* GetNonTerminatedText()
Gets the pointer to the string or to the static empty text if string is null. Returned pointer is always non-null, but is not null-terminated. [Deprecated on 26.10.2022, expires on 26.10.2024] Use GetText()
Declaration
public DEPRECATED("Use GetText instead") const T* GetNonTerminatedText() const
Parameters
"Use GetText instead"
StringViewBase_DEPRECATED__Use_GetText_instead__
|
StringViewBase(const StringViewBase& other)
Fields
_data
Declaration
protected T* _data
Field Value
T
|
_length
Declaration
protected int32 _length
Field Value
int32
|
Methods
Compare(const StringViewBase& str, StringSearchCase searchCase=StringSearchCase::CaseSensitive)
Lexicographically tests how this string compares to the other given string. In case sensitive mode 'A' is less than 'a'.
Declaration
public int32 Compare(const StringViewBase& str, StringSearchCase searchCase=StringSearchCase::CaseSensitive) const
Parameters
StringViewBase
str
The another string test against. |
StringSearchCase
searchCase
The case sensitivity mode. |
Returns
int32
0 if equal, negative number if less than, positive number if greater than. |
EndsWith(const StringViewBase& suffix, StringSearchCase searchCase=StringSearchCase::IgnoreCase)
Declaration
public bool EndsWith(const StringViewBase& suffix, StringSearchCase searchCase=StringSearchCase::IgnoreCase) const
Parameters
StringViewBase
suffix
|
StringSearchCase
searchCase
|
Returns
bool
|
EndsWith(T c, StringSearchCase searchCase=StringSearchCase::IgnoreCase)
Declaration
public bool EndsWith(T c, StringSearchCase searchCase=StringSearchCase::IgnoreCase) const
Parameters
T
c
|
StringSearchCase
searchCase
|
Returns
bool
|
Find(T c)
Searches the string for the occurrence of a character.
Declaration
public int32 Find(T c) const
Parameters
T
c
The character to search for. |
Returns
int32
The index of the character position in the string or -1 if not found. |
FindLast(T c)
Searches the string for the last occurrence of a character.
Declaration
public int32 FindLast(T c) const
Parameters
T
c
The character to search for. |
Returns
int32
The index of the character position in the string or -1 if not found. |
Get()
Gets the pointer to the string. Pointer can be null, and won't be null-terminated.
Declaration
public constexpr T* Get() const
Returns
constexpr T
|
GetText()
Gets the pointer to the string or to the static empty text if string is null. Returned pointer is always valid (read-only).
Declaration
public T* GetText() const
Returns
T
The string handle. |
HasChars()
Returns true if string isn't empty.
Declaration
public bool HasChars() const
Returns
bool
|
IsEmpty()
Returns true if string is empty.
Declaration
public bool IsEmpty() const
Returns
bool
|
Length()
Gets the length of the string.
Declaration
public constexpr int32 Length() const
Returns
constexpr int32
|
operator*()
Gets the pointer to the string. Pointer can be null, and won't be null-terminated.
Declaration
public constexpr T* operator*() const
Returns
constexpr T
|
operator[](int32 index)
Gets the specific const character from this string.
Declaration
public T operator[](int32 index) const
Parameters
int32
index
The index. |
Returns
T
The character at given index. |
operator=(const StringViewBase& other)
Declaration
public StringViewBase operator=(const StringViewBase& other)
Parameters
StringViewBase
other
|
Returns
StringViewBase
|
StartsWith(const StringViewBase& prefix, StringSearchCase searchCase=StringSearchCase::IgnoreCase)
Declaration
public bool StartsWith(const StringViewBase& prefix, StringSearchCase searchCase=StringSearchCase::IgnoreCase) const
Parameters
StringViewBase
prefix
|
StringSearchCase
searchCase
|
Returns
bool
|
StartsWith(T c, StringSearchCase searchCase=StringSearchCase::IgnoreCase)
Declaration
public bool StartsWith(T c, StringSearchCase searchCase=StringSearchCase::IgnoreCase) const
Parameters
T
c
|
StringSearchCase
searchCase
|
Returns
bool
|
StringViewBase()
Declaration
protected constexpr StringViewBase()
Returns
constexpr
|
StringViewBase(const T* data, int32 length)
Declaration
protected constexpr StringViewBase(const T* data, int32 length)
Parameters
T
data
|
int32
length
|
Returns
constexpr
|