|
libcmutils 0.6.5
Multi-platform C99 utility library
|
Multifunctional string type. More...
Data Fields | |
| ssize_t(* | AddString )(CMUTIL_String *string, const char *tobeadded) |
| Add a c-style string to this string object. | |
| ssize_t(* | AddNString )(CMUTIL_String *string, const char *tobeadded, size_t size) |
| Add n bytes string to this string object. | |
| ssize_t(* | AddChar )(CMUTIL_String *string, char tobeadded) |
| Add a character to this string object. | |
| ssize_t(* | AddPrint )(CMUTIL_String *string, const char *fmt,...) |
| Add a formatted string to this string object. | |
| ssize_t(* | AddVPrint )(CMUTIL_String *string, const char *fmt, va_list args) |
| Add a formatted string to this string object. | |
| ssize_t(* | AddAnother )(CMUTIL_String *string, const CMUTIL_String *tobeadded) |
| Add another string object to this string object. | |
| ssize_t(* | InsertString )(CMUTIL_String *string, const char *tobeadded, uint32_t at) |
| Insert a c-style string to this string object. | |
| ssize_t(* | InsertNString )(CMUTIL_String *string, const char *tobeadded, uint32_t at, size_t size) |
| Insert n bytes string to this string object. | |
| ssize_t(* | InsertPrint )(CMUTIL_String *string, uint32_t idx, const char *fmt,...) |
| ssize_t(* | InsertVPrint )(CMUTIL_String *string, uint32_t idx, const char *fmt, va_list args) |
| ssize_t(* | InsertAnother )(CMUTIL_String *string, uint32_t idx, CMUTIL_String *tobeadded) |
| Insert another string object to this string object. | |
| void(* | CutTailOff )(CMUTIL_String *string, size_t length) |
| Cut off the given number of characters from the tail of this string. | |
| CMUTIL_String *(* | Substring )(const CMUTIL_String *string, uint32_t offset, size_t length) |
| Get substring from this string object. | |
| CMUTIL_String *(* | ToLower )(const CMUTIL_String *string) |
| Creates a lower-case version of this string. | |
| void(* | SelfToLower )(CMUTIL_String *string) |
| Converts this string to lower case. | |
| CMUTIL_String *(* | ToUpper )(const CMUTIL_String *string) |
| Creates an upper-case version of this string. | |
| void(* | SelfToUpper )(CMUTIL_String *string) |
| Converts this string to the upper case. | |
| CMUTIL_String *(* | Replace )(const CMUTIL_String *string, const char *needle, const char *alter) |
| Replace all occurrences of the given substring with another string. | |
| size_t(* | GetSize )(const CMUTIL_String *string) |
| Get the size of this string object. | |
| const char *(* | GetCString )(const CMUTIL_String *string) |
| Get c-style null terminated string from this string object. | |
| int(* | GetChar )(const CMUTIL_String *string, uint32_t idx) |
| Function pointer to retrieve a character from a specified position in a string. | |
| void(* | Clear )(CMUTIL_String *string) |
| Clear the content of this string object. | |
| CMUTIL_String *(* | Clone )(const CMUTIL_String *string) |
| Clone this string object. | |
| void(* | Destroy )(CMUTIL_String *string) |
| Destroy this string object. | |
| void(* | SelfTrim )(CMUTIL_String *string) |
| Trim spaces from both ends of this string object. | |
Multifunctional string type.
| ssize_t(* CMUTIL_String::AddString) (CMUTIL_String *string, const char *tobeadded) |
Add a c-style string to this string object.
Append the given string to the end of this string object.
Appending an empty string is not an error, it just does nothing.
| string | This string object. |
| tobeadded | C-style null terminated string to be appended. |
| ssize_t(* CMUTIL_String::AddNString) (CMUTIL_String *string, const char *tobeadded, size_t size) |
Add n bytes string to this string object.
Append the given string to the end of this string object. Given string is not needed to be null terminated.
Appending zero bytes is not an error, it just does nothing.
| string | This string object. |
| tobeadded | C style string to be appended. |
| size | Number of bytes to be appended from the given string. |
| ssize_t(* CMUTIL_String::AddChar) (CMUTIL_String *string, char tobeadded) |
Add a character to this string object.
Append the given character to the end of this string object.
| string | This string object. |
| tobeadded | Character to be appended. |
| ssize_t(* CMUTIL_String::AddPrint) (CMUTIL_String *string, const char *fmt,...) |
Add a formatted string to this string object.
Append a ormatted string to the end of this string object.
| string | This string object. |
| fmt | Format string like a printf function. |
| ... | Arguments for format string. |
| ssize_t(* CMUTIL_String::AddVPrint) (CMUTIL_String *string, const char *fmt, va_list args) |
Add a formatted string to this string object.
Append a formatted string to the end of this string object.
| string | This string object. |
| fmt | Format string like a vprintf function. |
| args | Arguments list for format string. |
| ssize_t(* CMUTIL_String::AddAnother) (CMUTIL_String *string, const CMUTIL_String *tobeadded) |
Add another string object to this string object.
Append the given string object to the end of this string object.
Appending an empty string object is not an error, it just does nothing.
| string | This string object. |
| tobeadded | Another string object to be appended. |
| ssize_t(* CMUTIL_String::InsertString) (CMUTIL_String *string, const char *tobeadded, uint32_t at) |
Insert a c-style string to this string object.
Insert the given string to this string object at the index.
Inserting an empty string is not an error, it just does nothing, but the index is still validated.
| string | This string object. |
| tobeadded | C style null terminated string to be inserted. |
| at | Index where the given string will be inserted. |
| ssize_t(* CMUTIL_String::InsertNString) (CMUTIL_String *string, const char *tobeadded, uint32_t at, size_t size) |
Insert n bytes string to this string object.
Insert a substring of the given string to this string object at the given index. Given string is not needed to be null terminated.
Inserting zero bytes is not an error, it just does nothing, but the index is still validated.
| string | This string object. |
| tobeadded | C style string to be inserted. |
| at | Index where the given string will be inserted. |
| size | Number of bytes to be inserted from the given string. |
| ssize_t(* CMUTIL_String::InsertPrint) (CMUTIL_String *string, uint32_t idx, const char *fmt,...) |
Insert a formatted string to this string object.
Insert a formatted string to this string object at the index.
| string | This string object. |
| idx | Index where a formatted string will be inserted. |
| fmt | Format string like a printf function. |
| ... | Arguments for format string. |
| ssize_t(* CMUTIL_String::InsertVPrint) (CMUTIL_String *string, uint32_t idx, const char *fmt, va_list args) |
Insert a formatted string to this string object.
Insert a formatted string to this string object at the index.
| string | This string object. |
| idx | Index where a formatted string will be inserted. |
| fmt | Format string like a vprintf function. |
| args | Arguments list for format string. |
| ssize_t(* CMUTIL_String::InsertAnother) (CMUTIL_String *string, uint32_t idx, CMUTIL_String *tobeadded) |
Insert another string object to this string object.
Insert the given string object to this string object at the index.
Inserting an empty string object is not an error, it just does nothing, but the index is still validated.
| string | This string object. |
| idx | Index where another string object will be inserted. |
| tobeadded | Another string object to be inserted. |
| void(* CMUTIL_String::CutTailOff) (CMUTIL_String *string, size_t length) |
Cut off the given number of characters from the tail of this string.
If the length is bigger than the size of this string, this string will be cleared.
| string | This string object. |
| length | Number of characters to be cut off from the tail. |
| CMUTIL_String *(* CMUTIL_String::Substring) (const CMUTIL_String *string, uint32_t offset, size_t length) |
Get substring from this string object.
| string | This string object. |
| offset | Starting offset of substring. |
| length | Length of substring. |
| CMUTIL_String *(* CMUTIL_String::ToLower) (const CMUTIL_String *string) |
Creates a lower-case version of this string.
| string | This string object. |
| void(* CMUTIL_String::SelfToLower) (CMUTIL_String *string) |
Converts this string to lower case.
| string | This string object. |
| CMUTIL_String *(* CMUTIL_String::ToUpper) (const CMUTIL_String *string) |
Creates an upper-case version of this string.
| string | This string object. |
| void(* CMUTIL_String::SelfToUpper) (CMUTIL_String *string) |
Converts this string to the upper case.
| string | This string object. |
| CMUTIL_String *(* CMUTIL_String::Replace) (const CMUTIL_String *string, const char *needle, const char *alter) |
Replace all occurrences of the given substring with another string.
| string | This string object. |
| needle | Substring to be replaced. |
| alter | Replacement string. An empty string is allowed and removes every occurrence of needle. |
| size_t(* CMUTIL_String::GetSize) (const CMUTIL_String *string) |
Get the size of this string object.
| string | This string object. |
| const char *(* CMUTIL_String::GetCString) (const CMUTIL_String *string) |
Get c-style null terminated string from this string object.
| string | This string object. |
| int(* CMUTIL_String::GetChar) (const CMUTIL_String *string, uint32_t idx) |
Function pointer to retrieve a character from a specified position in a string.
This function pointer allows access to a character within a string structure at the position referenced by the provided index.
| string | Pointer to a CMUTIL_String structure containing the string data. |
| idx | The position of the desired character within the string. |
| void(* CMUTIL_String::Clear) (CMUTIL_String *string) |
Clear the content of this string object.
| string | This string object. |
| CMUTIL_String *(* CMUTIL_String::Clone) (const CMUTIL_String *string) |
Clone this string object.
| string | This string object. |
| void(* CMUTIL_String::Destroy) (CMUTIL_String *string) |
Destroy this string object.
| string | This string object. |
| void(* CMUTIL_String::SelfTrim) (CMUTIL_String *string) |
Trim spaces from both ends of this string object.
| string | This string object. |