Go to the source code of this file.
Functions | |
uint8_t const * | advanceUtf8 (const uint8_t *p) |
int | compareChar (void const *a, void const *b) |
The function to use for comparing two items. More... | |
void | copyChar (char *to, char const *from) |
The function to use for copying the data of from to to. More... | |
int32_t | shiftUtf8 (int32_t t, uint8_t const *p, int bytes) |
void | swapChar (char *a, char *b) |
The function to use for swapping the data of two array items. More... | |
void | XsString_append (XsString *thisPtr, XsString const *other) |
This function concatenates the other to this. More... | |
void | XsString_assign (XsString *thisPtr, XsSize count, const char *src) |
Reinitializes the XsArray with space for count items and copies them from src. More... | |
void | XsString_assignCharArray (XsString *thisPtr, const char *src) |
This function determines the size of src and copies the contents to the object. More... | |
void | XsString_assignWCharArray (XsString *thisPtr, const wchar_t *src) |
This function determines the size of src and copies the contents to the object after converting it from a unicode string to a multibyte character string. More... | |
void | XsString_construct (XsString *thisPtr) |
Initializes the XsString object as an empty string. More... | |
int | XsString_contains (XsString const *thisPtr, XsString const *other, int caseSensitive, XsSize *offset) |
Returns whether this string contains other. More... | |
XsSize | XsString_copyToWCharArray (const XsString *thisPtr, wchar_t *dest, XsSize size) |
This function copies the contents of the object to a unicode wchar_t array. More... | |
void | XsString_destruct (XsString *thisPtr) |
Clears and frees memory allocated by the XsArray. More... | |
int | XsString_empty (XsString const *thisPtr) |
Returns true when the supplied string is empty. More... | |
int | XsString_endsWith (XsString const *thisPtr, XsString const *other, int caseSensitive) |
Returns whether this string ends with other. More... | |
void | XsString_erase (XsString *thisPtr, XsSize index, XsSize count) |
Removes a count items from the list starting at index. More... | |
ptrdiff_t | XsString_findSubStr (XsString const *thisPtr, XsString const *needle) |
Find the first occurrence of needle in the string. More... | |
void | XsString_mid (XsString *thisPtr, XsString const *source, XsSize start, XsSize count) |
Copy a substring of the source string. More... | |
void | XsString_push_back (XsString *thisPtr, char c) |
Append character c to the string. More... | |
void | XsString_push_backWChar (XsString *thisPtr, wchar_t c) |
Append unicode character c to the string. More... | |
void | XsString_replaceAll (XsString *thisPtr, XsString const *src, XsString const *dst) |
Replace all occurrences of src with dst, modifying thisPtr. More... | |
void | XsString_resize (XsString *thisPtr, XsSize count) |
This function resizes the contained string to the desired size, while retaining its contents. More... | |
void | XsString_reverse (XsString *thisPtr) |
Reverses the contents of the string. More... | |
void | XsString_sort (XsString *thisPtr) |
Sorts the string. More... | |
int | XsString_startsWith (XsString const *thisPtr, XsString const *other, int caseSensitive) |
Returns whether this string starts with other. More... | |
void | XsString_trimmed (XsString *thisPtr, XsString const *source) |
Fills thisPtr with a copy of source with all its leading and trailing whitespace removed. More... | |
wchar_t | XsString_utf8At (XsString const *thisPtr, XsSize index) |
The decoded UTF-8 character at index index in the UTF-8 encoded string. More... | |
XsSize | XsString_utf8Len (XsString const *thisPtr) |
Returns the number of characters in a UTF-8 encoded string. More... | |
Variables | |
const XsArrayDescriptor | g_xsStringDescriptor |
Descriptor for XsInt64Array. More... | |
uint8_t const* advanceUtf8 | ( | const uint8_t * | p | ) |
Definition at line 301 of file xsstring.c.
int compareChar | ( | void const * | a, |
void const * | b | ||
) |
The function to use for comparing two items.
a | Left hand side of comparison. |
b | Right hand side of comparison. |
Definition at line 101 of file xsstring.c.
void copyChar | ( | char * | to, |
char const * | from | ||
) |
The function to use for copying the data of from to to.
to | Pointer to item to copy to. |
from | Pointer to item to copy from. |
Definition at line 94 of file xsstring.c.
Definition at line 342 of file xsstring.c.
void swapChar | ( | char * | a, |
char * | b | ||
) |
The function to use for swapping the data of two array items.
a | Pointer to first item to swap. |
b | Pointer to second item to swap. |
Definition at line 85 of file xsstring.c.
This function concatenates the other to this.
Definition at line 257 of file xsstring.c.
Reinitializes the XsArray with space for count items and copies them from src.
This function reinitializes the object reserving space for at least count items in the buffer. count may be 0. If src is not 0, count items will be copied from src. Previous data will be cleared automatically, but the reserved space will not be reduced.
count | the number of items in src |
src | a pointer to an array of items |
Definition at line 142 of file xsstring.c.
void XsString_assignCharArray | ( | XsString * | thisPtr, |
const char * | src | ||
) |
This function determines the size of src and copies the contents to the object.
Definition at line 172 of file xsstring.c.
void XsString_assignWCharArray | ( | XsString * | thisPtr, |
const wchar_t * | src | ||
) |
This function determines the size of src and copies the contents to the object after converting it from a unicode string to a multibyte character string.
Definition at line 181 of file xsstring.c.
void XsString_construct | ( | XsString * | thisPtr | ) |
Initializes the XsString object as an empty string.
This function initializes the object as an empty string.
Definition at line 126 of file xsstring.c.
int XsString_contains | ( | XsString const * | thisPtr, |
XsString const * | other, | ||
int | caseSensitive, | ||
XsSize * | offset | ||
) |
Returns whether this string contains other.
other | The string to match with this string |
caseSensitive | Whether to compare case sensitive or not (case insensitive is the default) |
offset | when not null, this will be filled with the offset at which other was found |
Definition at line 460 of file xsstring.c.
This function copies the contents of the object to a unicode wchar_t array.
Definition at line 215 of file xsstring.c.
void XsString_destruct | ( | XsString * | thisPtr | ) |
Clears and frees memory allocated by the XsArray.
Definition at line 134 of file xsstring.c.
int XsString_empty | ( | XsString const * | thisPtr | ) |
Returns true when the supplied string is empty.
Definition at line 493 of file xsstring.c.
Returns whether this string ends with other.
other | The string to match with the end of this string |
caseSensitive | Whether to compare case sensitive or not |
Definition at line 398 of file xsstring.c.
Removes a count items from the list starting at index.
Definition at line 276 of file xsstring.c.
Find the first occurrence of needle in the string.
needle | The string to find |
Definition at line 537 of file xsstring.c.
Copy a substring of the source string.
The function copies up to count characters from source to the string, starting at offset start
source | The source to copy from |
start | The offset of the first character to copy |
count | The maximum number of characters to copy |
Definition at line 568 of file xsstring.c.
void XsString_push_back | ( | XsString * | thisPtr, |
char | c | ||
) |
Append character c to the string.
c | The character to append |
Definition at line 292 of file xsstring.c.
void XsString_push_backWChar | ( | XsString * | thisPtr, |
wchar_t | c | ||
) |
Append unicode character c to the string.
c | The character to append |
Definition at line 227 of file xsstring.c.
Replace all occurrences of src with dst, modifying thisPtr.
src | Substring to search for |
dst | Substring to use as replacement |
Definition at line 586 of file xsstring.c.
This function resizes the contained string to the desired size, while retaining its contents.
count | The desired size of the string. This excludes the terminating 0 character. |
Definition at line 243 of file xsstring.c.
void XsString_reverse | ( | XsString * | thisPtr | ) |
Reverses the contents of the string.
This reverses the contents in-place
Definition at line 515 of file xsstring.c.
void XsString_sort | ( | XsString * | thisPtr | ) |
Returns whether this string starts with other.
other | The string to match with the start of this string |
caseSensitive | Whether to compare case sensitive or not |
Definition at line 430 of file xsstring.c.
Fills thisPtr with a copy of source with all its leading and trailing whitespace removed.
source | The original string to use as source. |
Definition at line 633 of file xsstring.c.
The decoded UTF-8 character at index index in the UTF-8 encoded string.
http://en.wikipedia.org/wiki/Utf-8#Description
index | The index of the character to return. |
Definition at line 355 of file xsstring.c.
Returns the number of characters in a UTF-8 encoded string.
http://en.wikipedia.org/wiki/Utf-8#Description
Definition at line 325 of file xsstring.c.
const XsArrayDescriptor g_xsStringDescriptor |
Descriptor for XsInt64Array.
Definition at line 111 of file xsstring.c.