Sese Framework
2.3.0
A cross-platform framework
|
String. More...
#include <SString.h>
Public Member Functions | |
SString () noexcept | |
SString (const char *str, size_t size) | |
SString (const SString &s_string) noexcept | |
SString (SString &&s_string) noexcept | |
~SString () noexcept override | |
size_t | cap () const |
size_t | size () const override |
void | toLower () |
Convert the string to lowercase. | |
void | toUpper () |
Convert the string to uppercase. | |
char * | data () |
Get data pointer. | |
void | operator+= (const SStringView &str) |
void | operator+= (const char *u8str) |
Public Member Functions inherited from sstr::SStringView | |
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 |
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 |
Extract substring [begin, begin + len - 1]. | |
bool | endsWith (const SStringView &suffix) const |
Check if the string ends with a given substring. | |
bool | endsWith (const std::string_view &suffix) const |
Check if the string ends with a given substring. | |
bool | startsWith (const SStringView &prefix) const |
Check if the string starts with a given substring. | |
bool | startsWith (const std::string_view &prefix) const |
Check if the string starts with a given substring. | |
bool | isLower () const |
Check if the letter is entirely lowercase. | |
bool | isUpper () const |
Check if the letter is entirely uppercase. | |
SString | toLower () const |
Create a copy with all letters converted to lowercase. | |
SString | toUpper () const |
Create a copy with all letters converted to uppercase. | |
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 |
Static Public Member Functions | |
static SString | fromSChars (SChar ch[], size_t size) |
static SString | fromSChars (std::vector< SChar > &chars) |
static SString | fromUTF8 (const char *str) |
static SString | fromUCS2LE (const wchar_t *str) |
Protected Attributes | |
size_t | _capacity = 0 |
Protected Attributes inherited from sstr::SStringView | |
char * | _data = nullptr |
size_t | _size = 0 |
Friends | |
class | SStringView |
String.
|
explicitnoexcept |
SString::SString | ( | const char * | str, |
size_t | size ) |
References _capacity, sstr::SStringView::_data, sstr::SStringView::_size, BLOCK_SIZE, and size().
|
noexcept |
References sstr::SStringView::_size.
|
noexcept |
References sstr::SStringView::_data.
|
overridenoexcept |
References free().
|
nodiscard |
char * sstr::SString::data | ( | ) |
Get data pointer.
|
static |
|
static |
References _capacity, sstr::SStringView::_data, sstr::SStringView::_size, BLOCK_SIZE, and sstr::getByteLengthFromUTF8String().
Referenced by sstr::SStringView::split().
void SString::operator+= | ( | const char * | u8str | ) |
References _capacity, sstr::SStringView::_data, sstr::SStringView::_size, BLOCK_SIZE, free(), and sstr::SStringView::len().
void SString::operator+= | ( | const SStringView & | str | ) |
|
nodiscardoverridevirtual |
Get used buffer size
Reimplemented from sstr::SStringView.
References sstr::SStringView::_size.
Referenced by fromSChars(), and SString().
void SString::toLower | ( | ) |
Convert the string to lowercase.
References sstr::SStringView::_data, and toLower().
Referenced by toLower().
void SString::toUpper | ( | ) |
Convert the string to uppercase.
References sstr::SStringView::_data, and toUpper().
Referenced by toUpper().
|
friend |
|
protected |