Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sstr Namespace Reference

Classes

struct  SChar
 Unicode character. More...
 
class  SString
 String. More...
 
class  SStringView
 String view. More...
 

Typedefs

typedef int(* FindFunction) (const char *, const char *)
 

Functions

int KMP (const char *str, const char *sub)
 
int BM (const char *str, const char *sub)
 
int BM (const uint32_t *str, size_t size, std::vector< SChar > &sub)
 
int NORMAL (const char *str, const char *sub)
 
template<typename T >
void LeftShiftElement (T *header, size_t len, size_t begin, size_t count)
 
template<typename T >
void RightShiftElement (T *header, size_t len, size_t begin, size_t count)
 
SChar getUnicodeFromUTF8Char (const char *u8char)
 
size_t getStringLengthFromUTF8String (const char *str)
 
size_t getByteLengthFromUTF8String (const char *str)
 
char getSizeFromUTF8Char (char ch)
 
char getUTF8SizeFromUnicodeChar (SChar ch)
 
SChar getUnicodeCharFromUTF8Char (char size, const char *ch)
 
class SESE_DEPRECATED_WITH ("please use sese::text::StringBuilder") SStringBuilder final
 SStringBuilder.
 

Typedef Documentation

◆ FindFunction

typedef int(* sstr::FindFunction) (const char *, const char *)

Function Documentation

◆ BM() [1/2]

int sstr::BM ( const char * str,
const char * sub )
extern

◆ BM() [2/2]

int sstr::BM ( const uint32_t * str,
size_t size,
std::vector< SChar > & sub )
extern

References dist().

◆ getByteLengthFromUTF8String()

size_t sstr::getByteLengthFromUTF8String ( const char * str)

Get UTF-8 string byte length

Parameters
strTarget string
Returns
Byte length of the string

Referenced by sstr::SString::fromUTF8(), sstr::SStringView::size(), sstr::SStringView::split(), sstr::SStringView::SStringView(), and sstr::SStringView::toChars().

◆ getSizeFromUTF8Char()

char sstr::getSizeFromUTF8Char ( char ch)

◆ getStringLengthFromUTF8String()

size_t sstr::getStringLengthFromUTF8String ( const char * str)

Get UTF-8 string length

Parameters
strString
Returns
String length

References getSizeFromUTF8Char().

◆ getUnicodeCharFromUTF8Char()

SChar sstr::getUnicodeCharFromUTF8Char ( char size,
const char * ch )

Get Unicode character from UTF-8 string

Parameters
sizeNumber of bytes this UTF-8 character occupies
chStarting position of the UTF-8 character
Returns
Unicode character

References null_char.

Referenced by sstr::SStringView::at(), getUnicodeFromUTF8Char(), sstr::SStringView::toChars(), and sstr::SStringView::toCWString().

◆ getUnicodeFromUTF8Char()

SChar sstr::getUnicodeFromUTF8Char ( const char * u8char)

Get UTF-8 character code

Parameters
u8charUTF-8 character
Returns
Character code

References getSizeFromUTF8Char(), and getUnicodeCharFromUTF8Char().

Referenced by sstr::SStringView::Iterator::Iterator(), and sstr::SStringView::Iterator::operator++().

◆ getUTF8SizeFromUnicodeChar()

char sstr::getUTF8SizeFromUnicodeChar ( SChar ch)

Get the number of bytes a character occupies in UTF-8 from SChar

Parameters
chUnicode character
Returns
Number of bytes occupied

Referenced by sstr::SString::fromSChars(), sstr::SString::fromSChars(), sstr::SString::fromUCS2LE(), and sstr::SStringView::Iterator::operator++().

◆ KMP()

int sstr::KMP ( const char * str,
const char * sub )
extern

References getNext().

◆ LeftShiftElement()

template<typename T >
void sstr::LeftShiftElement ( T * header,
size_t len,
size_t begin,
size_t count )
inline

Shift elements of the target buffer to the left

Warning
Ensure to check for possible array bounds overflow when using
Template Parameters
TElement type
Parameters
headerTarget buffer
lenOriginal size of the target buffer (already used)
beginStarting position of the operation
countShift distance

References count().

◆ NORMAL()

int sstr::NORMAL ( const char * str,
const char * sub )
extern

◆ RightShiftElement()

template<typename T >
void sstr::RightShiftElement ( T * header,
size_t len,
size_t begin,
size_t count )
inline

Shift elements of the target buffer to the left

Warning
Ensure to check for possible array bounds overflow when using
Template Parameters
TElement type
Parameters
headerTarget buffer
lenOriginal size of the target buffer (already used)
beginStarting position of the operation
countShift distance

References count().

◆ SESE_DEPRECATED_WITH()

class sstr::SESE_DEPRECATED_WITH ( "please use sese::text::StringBuilder" )
final

SStringBuilder.

Data pointer

Number of characters

Capacity (unit is uint32_t, i.e., 4 bytes)

References at(), and SESE_DEPRECATED_WITH.