Go to the source code of this file.
Macros | |
#define | XsString_copy(thisPtr, copy) XsArray_copy(copy, thisPtr) |
#define | XsString_INITIALIZER XSARRAY_INITIALIZER(&g_xsStringDescriptor) |
#define | XSSTRING_INITIALIZER XsString_INITIALIZER |
#define | XsString_swap(a, b) XsArray_swap(a, b) |
Typedefs | |
typedef struct XsString | XsString |
Functions | |
XSARRAY_STRUCT (XsString, char) | |
XSTYPES_DLL_API void | XsString_append (XsString *thisPtr, XsString const *other) |
This function concatenates the other to this. More... | |
XSTYPES_DLL_API void | XsString_assign (XsString *thisPtr, XsSize count, const char *src) |
Reinitializes the XsArray with space for count items and copies them from src. More... | |
XSTYPES_DLL_API void | XsString_assignCharArray (XsString *thisPtr, const char *src) |
This function determines the size of src and copies the contents to the object. More... | |
XSTYPES_DLL_API 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... | |
XSTYPES_DLL_API void | XsString_construct (XsString *thisPtr) |
Initializes the XsString object as an empty string. More... | |
XSTYPES_DLL_API int | XsString_contains (XsString const *thisPtr, XsString const *other, int caseSensitive, XsSize *offset) |
Returns whether this string contains other. More... | |
XSTYPES_DLL_API 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... | |
XSTYPES_DLL_API void | XsString_destruct (XsString *thisPtr) |
Clears and frees memory allocated by the XsArray. More... | |
XSTYPES_DLL_API int | XsString_empty (XsString const *thisPtr) |
Returns true when the supplied string is empty. More... | |
XSTYPES_DLL_API int | XsString_endsWith (XsString const *thisPtr, XsString const *other, int caseSensitive) |
Returns whether this string ends with other. More... | |
XSTYPES_DLL_API void | XsString_erase (XsString *thisPtr, XsSize index, XsSize count) |
Removes a count items from the list starting at index. More... | |
XSTYPES_DLL_API ptrdiff_t | XsString_findSubStr (XsString const *thisPtr, XsString const *needle) |
Find the first occurrence of needle in the string. More... | |
XSTYPES_DLL_API void | XsString_mid (XsString *thisPtr, XsString const *source, XsSize start, XsSize count) |
Copy a substring of the source string. More... | |
XSTYPES_DLL_API void | XsString_push_back (XsString *thisPtr, char c) |
Append character c to the string. More... | |
XSTYPES_DLL_API void | XsString_push_backWChar (XsString *thisPtr, wchar_t c) |
Append unicode character c to the string. More... | |
XSTYPES_DLL_API void | XsString_replaceAll (XsString *thisPtr, XsString const *src, XsString const *dst) |
Replace all occurrences of src with dst, modifying thisPtr. More... | |
XSTYPES_DLL_API void | XsString_resize (XsString *thisPtr, XsSize count) |
This function resizes the contained string to the desired size, while retaining its contents. More... | |
XSTYPES_DLL_API void | XsString_reverse (XsString *thisPtr) |
Reverses the contents of the string. More... | |
XSTYPES_DLL_API void | XsString_sort (XsString *thisPtr) |
Sorts the string. More... | |
XSTYPES_DLL_API int | XsString_startsWith (XsString const *thisPtr, XsString const *other, int caseSensitive) |
Returns whether this string starts with other. More... | |
XSTYPES_DLL_API void | XsString_trimmed (XsString *thisPtr, XsString const *source) |
Fills thisPtr with a copy of source with all its leading and trailing whitespace removed. More... | |
XSTYPES_DLL_API wchar_t | XsString_utf8At (const XsString *thisPtr, XsSize index) |
The decoded UTF-8 character at index index in the UTF-8 encoded string. More... | |
XSTYPES_DLL_API XsSize | XsString_utf8Len (XsString const *thisPtr) |
Returns the number of characters in a UTF-8 encoded string. More... | |
Variables | |
const XsArrayDescriptor XSTYPES_DLL_API | g_xsStringDescriptor |
Descriptor for XsInt64Array. More... | |
#define XsString_copy | ( | thisPtr, | |
copy | |||
) | XsArray_copy(copy, thisPtr) |
Definition at line 123 of file xsstring.h.
#define XsString_INITIALIZER XSARRAY_INITIALIZER(&g_xsStringDescriptor) |
Definition at line 85 of file xsstring.h.
#define XSSTRING_INITIALIZER XsString_INITIALIZER |
Definition at line 89 of file xsstring.h.
#define XsString_swap | ( | a, | |
b | |||
) | XsArray_swap(a, b) |
Definition at line 124 of file xsstring.h.
Definition at line 87 of file xsstring.h.
XSARRAY_STRUCT | ( | XsString | , |
char | |||
) |
XSTYPES_DLL_API void XsString_append | ( | XsString * | thisPtr, |
XsString const * | other | ||
) |
This function concatenates the other to this.
Definition at line 257 of file xsstring.c.
XSTYPES_DLL_API void XsString_assign | ( | XsString * | thisPtr, |
XsSize | count, | ||
const char * | src | ||
) |
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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API 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.
Definition at line 215 of file xsstring.c.
XSTYPES_DLL_API void XsString_destruct | ( | XsString * | thisPtr | ) |
Clears and frees memory allocated by the XsArray.
Definition at line 134 of file xsstring.c.
XSTYPES_DLL_API int XsString_empty | ( | XsString const * | thisPtr | ) |
Returns true when the supplied string is empty.
Definition at line 493 of file xsstring.c.
XSTYPES_DLL_API int XsString_endsWith | ( | XsString const * | thisPtr, |
XsString const * | other, | ||
int | caseSensitive | ||
) |
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.
XSTYPES_DLL_API void XsString_erase | ( | XsString * | thisPtr, |
XsSize | index, | ||
XsSize | count | ||
) |
Removes a count items from the list starting at index.
Definition at line 276 of file xsstring.c.
XSTYPES_DLL_API ptrdiff_t XsString_findSubStr | ( | XsString const * | thisPtr, |
XsString const * | needle | ||
) |
Find the first occurrence of needle in the string.
needle | The string to find |
Definition at line 537 of file xsstring.c.
XSTYPES_DLL_API void XsString_mid | ( | XsString * | thisPtr, |
XsString const * | source, | ||
XsSize | start, | ||
XsSize | count | ||
) |
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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API void XsString_replaceAll | ( | XsString * | thisPtr, |
XsString const * | src, | ||
XsString const * | dst | ||
) |
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.
XSTYPES_DLL_API void XsString_resize | ( | XsString * | thisPtr, |
XsSize | count | ||
) |
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.
XSTYPES_DLL_API 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.
XSTYPES_DLL_API void XsString_sort | ( | XsString * | thisPtr | ) |
XSTYPES_DLL_API int XsString_startsWith | ( | XsString const * | thisPtr, |
XsString const * | other, | ||
int | caseSensitive | ||
) |
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.
XSTYPES_DLL_API void XsString_trimmed | ( | XsString * | thisPtr, |
XsString const * | source | ||
) |
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.
XSTYPES_DLL_API wchar_t XsString_utf8At | ( | XsString const * | thisPtr, |
XsSize | index | ||
) |
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.
XSTYPES_DLL_API XsSize XsString_utf8Len | ( | XsString const * | thisPtr | ) |
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 XSTYPES_DLL_API g_xsStringDescriptor |
Descriptor for XsInt64Array.
Definition at line 111 of file xsstring.c.