Go to the documentation of this file.
110 if (separators->m_size <= 1)
117 char const* sep = (
char const*) separators->m_data;
118 char const* idx = (
char const*) src->m_data;
119 char const* newIdx = strpbrk(idx, sep);
120 while (newIdx && *idx)
128 newIdx = strpbrk(idx, sep);
149 XsSize chars = (thisPtr->m_size ? (thisPtr->m_size - 1) : 0) * (separator->m_size ? separator->m_size - 1 : 0);
150 for (i = 0; i < thisPtr->m_size; ++i)
153 chars += (sz ? sz - 1 : 0);
160 for (i = 0; i < thisPtr->m_size; ++i)
165 if (result->m_size > 1)
This object describes how to treat the data in an array.
void XsArray_construct(void *thisPtr, XsArrayDescriptor const *const descriptor, XsSize count, void const *src)
Initializes the XsArray with space for count items and copies them from src.
void XsString_destruct(XsString *thisPtr)
Clears and frees memory allocated by the XsArray.
int XsArray_compare(void const *a, void const *b)
Returns non-zero if the lists are different, 0 if they're equal.
void XsStringArray_construct(XsStringArray *thisPtr, XsSize count, XsString const *src)
void XsArray_destruct(void *thisPtr)
Clears and frees memory allocated by the XsArray.
void XsArray_copy(void *thisPtr, void const *src)
Copy the contents of src to thisArray.
A list of XsString values.
void XsString_append(XsString *thisPtr, XsString const *other)
This function concatenates the other to this.
void XsStringArray_fromSplicedString(struct XsStringArray *thisPtr, struct XsString const *src, struct XsString const *separators)
Splice the supplied string and put the resulting substrings in the string array.
void XsArray_copyConstruct(void *thisPtr, void const *src)
Initializes the XsArray with a copy of src.
void XsString_construct(XsString *thisPtr)
Initializes the XsString object as an empty string.
void XsArray_swap(void *a, void *b)
Swap the contents of a with those of b.
size_t XsSize
XsSize must be unsigned number!
void XsArray_insert(void *thisPtr, XsSize index, XsSize count, void const *src)
Insert count items from src at index in the array.
void XsArray_reserve(void *thisPtr, XsSize count)
Reserves space for count items.
const XsArrayDescriptor g_xsStringArrayDescriptor
Descriptor for XsStringArray.
void XsString_assignCharArray(XsString *thisPtr, const char *src)
This function determines the size of src and copies the contents to the object.
void const * XsArray_at(void const *thisPtr, XsSize index)
Returns a pointer to the item at the supplied index or a null pointer if it is out of bounds.
void XsStringArray_join(struct XsStringArray const *thisPtr, struct XsString *result, struct XsString const *separator)
Join the string array into a single string, inserting separator between substrings.
void XsString_assign(XsString *thisPtr, XsSize count, const char *src)
Reinitializes the XsArray with space for count items and copies them from src.
A 0-terminated managed string of characters.