XSString class
Checks whether a string contains a C string
XS_EXPORT bool XSStringContainsCString(
XSStringRef str,
const char *search );
True if the string contains the C string, otherwise false
Checks whether a string contains another string
XS_EXPORT bool XSStringContainsString(
XSStringRef str,
XSStringRef search );
True if the string contains the search string, otherwise false
Creates a string with bytes
XS_EXPORT XSStringRef XSStringCreateWithBytes(
const uint8_t *bytes,
size_t length );
A string object
Creates a string with a C string
XS_EXPORT XSStringRef XSStringCreateWithCString(
const char *cstr );
A string object
Creates a string with a format string
XS_EXPORT XSStringRef XSStringCreateWithFormat(
const char *fmt,
... ) XS_FORMAT_ATTRIBUTE(
printf,
1,
2 );
A string object
Creates a string with a format string
XS_EXPORT XSStringRef XSStringCreateWithFormatAndArguments(
const char *fmt,
va_list ap ) XS_FORMAT_ATTRIBUTE(
printf,
1, 0 );
A string object
Gets the character at a specific index
XS_EXPORT char XSStringGetCharacterAtIndex(
XSStringRef str,
size_t index );
Returns 0 is the string is NULL or if the index is out of bounds.
The character at the specified index
Gets the class ID for XSString
XS_EXPORT XSClassID XSStringGetClassID(
void );
The class ID for XSString
Gets the internal C string of a string object
XS_EXPORT const char * XSStringGetCString(
XSStringRef str );
Any modification to the returned C string results in undefined behavior.
The C string
Gets the length of a string object
XS_EXPORT size_t XSStringGetLength(
XSStringRef str );
The string's length
Checks whether a string has a prefix
XS_EXPORT bool XSStringHasCStringPrefix(
XSStringRef str,
const char *prefix );
True if the string has the prefix, otherwise false
Checks whether a string has a suffix
XS_EXPORT bool XSStringHasCStringSuffix(
XSStringRef str,
const char *suffix );
True if the string has the suffix, otherwise false
Checks whether a string has a prefix
XS_EXPORT bool XSStringHasPrefix(
XSStringRef str,
XSStringRef prefix );
True if the string has the prefix, otherwise false
Checks whether a string has a suffix
XS_EXPORT bool XSStringHasSuffix(
XSStringRef str,
XSStringRef suffix );
True if the string has the suffix, otherwise false
Creates a string with bytes
XS_EXPORT XS_AUTORELEASED XSStringRef XSStringWithBytes(
const uint8_t *bytes,
size_t length );
The returned object is autoreleased.
A string object
Creates a string with a C string
XS_EXPORT XS_AUTORELEASED XSStringRef XSStringWithCString(
const char *cstr );
The returned object is autoreleased.
A string object
Creates a string with a format string
XS_EXPORT XS_AUTORELEASED XSStringRef XSStringWithFormat(
const char *fmt,
... ) XS_FORMAT_ATTRIBUTE(
printf,
1,
2 );
The returned object is autoreleased.
A string object
Creates a string with a format string
XS_EXPORT XS_AUTORELEASED XSStringRef XSStringWithFormatAndArguments(
const char *fmt,
va_list ap ) XS_FORMAT_ATTRIBUTE(
printf,
1, 0 );
The returned object is autoreleased.
A string object