Sese Framework
x.y.z
A cross-platform framework
|
字符串视图 更多...
#include <SString.h>
类 | |
class | Iterator |
Unicode 字符迭代器 更多... | |
Public 成员函数 | |
SStringView () noexcept=default | |
SStringView (const char *u8str) noexcept | |
virtual | ~SStringView ()=default |
Iterator | begin () |
Iterator | end () |
bool | null () const |
bool | empty () const |
size_t | len () const |
virtual size_t | size () const |
const char * | data () const |
int32_t | find (const SStringView &str) const |
int32_t | find (const char *u8str) const |
int32_t | findByBytes (const char *bytes) const |
SString | trim () const |
SString | reverse () const |
SString | append (const SStringView &str) const |
SString | append (const char *u8str) const |
std::vector< SString > | split (const SStringView &str) const |
std::vector< SString > | split (const char *str) const |
SString | substring (size_t begin) const |
SString | substring (size_t begin, size_t len) const |
截取子串 [begin, begin + len - 1] | |
bool | endsWith (const SStringView &suffix) const |
字符串是否以某个子串结尾 | |
bool | endsWith (const std::string_view &suffix) const |
字符串是否以某个子串结尾 | |
bool | startsWith (const SStringView &prefix) const |
字符串是否以某个子串开头 | |
bool | startsWith (const std::string_view &prefix) const |
字符串是否以某个子串开头 | |
bool | isLower () const |
字母是否为全小写 | |
bool | isUpper () const |
字母是否为全大写 | |
SString | toLower () const |
创建字母转为全小写的副本 | |
SString | toUpper () const |
创建字母转为全大写的副本 | |
SChar | at (size_t index) const |
std::vector< SChar > | toChars () const |
std::string | toString () const |
std::wstring | toWString () const |
std::unique_ptr< wchar_t[]> | toCWString () const |
SChar | operator[] (size_t index) const |
bool | operator!= (const SStringView &str) const |
bool | operator!= (const char *u8str) const |
bool | operator== (const SStringView &str) const |
bool | operator== (const char *u8str) const |
SString | operator+ (const SStringView &str) const |
SString | operator+ (const char *u8str) const |
Protected 属性 | |
char * | _data = nullptr |
size_t | _size = 0 |
字符串视图
|
defaultnoexcept |
|
explicitnoexcept |
|
virtualdefault |
SString SStringView::append | ( | const char * | u8str | ) | const |
尾加字符串
u8str | 待尾加字符串 |
引用了 sstr::SString::_capacity, _data, _size, BLOCK_SIZE , 以及 len().
|
nodiscard |
尾加字符串
str | 待尾加字符串 |
引用了 sstr::SString::_capacity, _data, _size , 以及 BLOCK_SIZE.
被这些函数引用 operator+() , 以及 operator+().
|
nodiscard |
引用了 _data, _size, c, sstr::getSizeFromUTF8Char(), sstr::getUnicodeCharFromUTF8Char() , 以及 null_char.
被这些函数引用 operator[](), substring() , 以及 substring().
SStringView::IteratorType SStringView::begin | ( | ) |
被这些函数引用 substring() , 以及 substring().
|
nodiscard |
获取缓冲区指针
引用了 _data.
被这些函数引用 find(), sese::text::AbstractStringBuffer::insertAt(), sstr::SString::operator+=() , 以及 sese::io::OutputStream::write().
|
nodiscard |
|
nodiscard |
|
nodiscard |
int32_t SStringView::find | ( | const char * | u8str | ) | const |
|
nodiscard |
int32_t SStringView::findByBytes | ( | const char * | bytes | ) | const |
|
nodiscard |
获取字符串中字符个数
引用了 _data, _size, sstr::getSizeFromUTF8Char() , 以及 len().
被这些函数引用 sese::text::AbstractStringBuffer::append(), append(), sese::text::AbstractStringBuffer::insertAt(), sese::text::AbstractStringBuffer::insertAt(), len(), sstr::SString::operator+=(), substring(), toChars() , 以及 toCWString().
|
nodiscard |
bool SStringView::operator!= | ( | const char * | u8str | ) | const |
引用了 _data.
bool SStringView::operator!= | ( | const SStringView & | str | ) | const |
引用了 _data.
SString SStringView::operator+ | ( | const SStringView & | str | ) | const |
引用了 append().
bool SStringView::operator== | ( | const char * | u8str | ) | const |
引用了 _data.
bool SStringView::operator== | ( | const SStringView & | str | ) | const |
引用了 _data.
|
nodiscard |
|
nodiscardvirtual |
获取字符串字节数
被 sstr::SString 重载.
引用了 _data , 以及 sstr::getByteLengthFromUTF8String().
被这些函数引用 sstr::SString::operator+=(), split(), startsWith(), toCWString() , 以及 sese::io::OutputStream::write().
std::vector< SString > SStringView::split | ( | const char * | str | ) | const |
切割字符串
str | 切割标识符 |
引用了 _data, sstr::BM(), sstr::SString::fromUTF8(), sstr::getByteLengthFromUTF8String() , 以及 size().
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
截取子串[begin, len - 1]
begin | 起始字符串索引 |
引用了 sstr::SString::_capacity, _data, _size, at(), begin() , 以及 BLOCK_SIZE.
|
nodiscard |
截取子串 [begin, begin + len - 1]
begin | 起始字符索引 |
len | 截取长度 |
引用了 sstr::SString::_capacity, _data, _size, at(), begin(), BLOCK_SIZE, count(), sstr::getSizeFromUTF8Char() , 以及 len().
|
nodiscard |
|
nodiscard |
引用了 _data, _size, count(), sstr::getSizeFromUTF8Char(), sstr::getUnicodeCharFromUTF8Char(), len() , 以及 size().
被这些函数引用 toWString().
|
nodiscard |
|
nodiscard |
引用了 _data.
|
nodiscard |
|
nodiscard |
引用了 toCWString().
|
nodiscard |
|
protected |
被这些函数引用 append(), append(), at(), begin(), data(), empty(), end(), endsWith(), endsWith(), find(), findByBytes(), sstr::SString::fromSChars(), sstr::SString::fromSChars(), sstr::SString::fromUCS2LE(), sstr::SString::fromUTF8(), isLower(), isUpper(), len(), null(), operator!=(), operator!=(), sstr::SString::operator+=(), sstr::SString::operator+=(), operator==(), operator==(), reverse(), size(), split(), split(), sstr::SString::SString(), sstr::SString::SString(), startsWith(), startsWith(), substring(), substring(), toChars(), toCWString(), sstr::SString::toLower(), toLower(), toString(), sstr::SString::toUpper(), toUpper() , 以及 trim().
|
protected |
被这些函数引用 append(), append(), at(), begin(), end(), endsWith(), endsWith(), sstr::SString::fromSChars(), sstr::SString::fromSChars(), sstr::SString::fromUCS2LE(), sstr::SString::fromUTF8(), isLower(), isUpper(), len(), sstr::SString::operator+=(), sstr::SString::operator+=(), reverse(), sstr::SString::size(), sstr::SString::SString(), sstr::SString::SString(), startsWith(), startsWith(), substring(), substring(), toChars(), toCWString(), toLower(), toUpper() , 以及 trim().