Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
SString.cpp File Reference
#include <sese/text/SString.h>
#include <sese/text/Algorithm.h>
#include <cstring>

Macros

#define BLOCK_SIZE   16
 

Typedefs

using Iterator = sstr::SStringView::Iterator
 

Functions

char getUTF8SizeFromWChat (wchar_t ch)
 
static bool insertUnicodeChar2UTF8String (char *destination, uint32_t code, size_t n)
 
static const char * at (const char *str, size_t begin)
 Get the starting pointer of the specified character.
 
static void toLower (char *str)
 
static void toUpper (char *str)
 

Variables

static SChar null_char (0)
 

Macro Definition Documentation

◆ BLOCK_SIZE

Typedef Documentation

◆ Iterator

Function Documentation

◆ at()

static const char * at ( const char * str,
size_t begin )
static

Get the starting pointer of the specified character.

Parameters
strString
beginStarting position (in UTF-8 characters)
Returns
Pointer to the specified character, returns nullptr if out of range

References sstr::getSizeFromUTF8Char().

Referenced by sese::findFirstAt(), and sstr::SESE_DEPRECATED_WITH().

◆ getUTF8SizeFromWChat()

char getUTF8SizeFromWChat ( wchar_t ch)
inline

Get the number of bytes that the character occupies in UTF-8 from wchar_t

Warning
This function is only available on *nix
Parameters
chWide character
Returns
Number of bytes occupied

Referenced by sstr::SString::fromUCS2LE().

◆ insertUnicodeChar2UTF8String()

static bool insertUnicodeChar2UTF8String ( char * destination,
uint32_t code,
size_t n )
static

Write UTF-8 encoded Unicode character to a byte stream

Parameters
destinationWrite position
codeUnicode character
nNumber of bytes this character occupies in UTF-8
Returns
Success status

Referenced by sstr::SString::fromSChars(), sstr::SString::fromSChars(), and sstr::SString::fromUCS2LE().

◆ toLower()

static void toLower ( char * str)
static

◆ toUpper()

static void toUpper ( char * str)
static

Variable Documentation

◆ null_char