57typedef struct StringInterface StringInterface;
103struct StringInterface {
108 ObjectInterface objectInterface;
119 void (*appendBytes)(
String *self,
const uint8_t *bytes,
size_t length,
StringEncoding encoding);
128 void (*appendCharacters)(
String *self,
const char *chars);
137 void (*appendFormat)(
String *self,
const char *fmt, ...);
146 void (*appendString)(
String *self,
const String *string);
156 void (*appendVaList)(
String *self,
const char *fmt, va_list args);
177 Array *(*componentsSeparatedByCharacters)(
const String *self,
const char *chars);
196 void (*deleteCharactersInRange)(
String *self,
const Range range);
216 bool (*hasPrefix)(
const String *self,
const String *prefix);
226 bool (*hasSuffix)(
const String *self,
const String *suffix);
257 String *(*initWithCapacity)(
String *self,
size_t capacity);
267 String *(*initWithCharacters)(
String *self,
const char *chars);
299 String *(*initWithFormat)(
String *self,
const char *fmt, ...);
333 String *(*initWithVaList)(
String *self,
const char *fmt, va_list args);
343 void (*insertCharactersAtIndex)(
String *self,
const char *chars,
size_t index);
353 void (*insertStringAtIndex)(
String *self,
const String *string,
size_t index);
372 Range (*rangeOfCharacters)(
const String *self,
const char *chars,
const Range range);
393 void (*replaceCharactersInRange)(
String *self,
const Range range,
const char *chars);
403 void (*replaceOccurrencesOfCharacters)(
String *self,
const char *chars,
const char *replacement);
414 void (*replaceOccurrencesOfCharactersInRange)(
String *self,
const char *chars,
const Range range,
const char *replacement);
424 void (*replaceOccurrencesOfString)(
String *self,
const String *string,
const String *replacement);
435 void (*replaceOccurrencesOfStringInRange)(
String *self,
const String *string,
const Range range,
const String *replacement);
445 void (*replaceStringInRange)(
String *self,
const Range range,
const String *string);
454 void (*setCharacters)(
String *self,
const char *chars);
463 void (*setFormat)(
String *self,
const char *fmt, ...);
472 void (*setLength)(
String *self,
size_t length);
512 String *(*stringWithCapacity)(
size_t capacity);
522 String *(*stringWithCharacters)(
const char *chars);
554 String *(*stringWithFormat)(
const char *fmt, ...);
566 String *(*stringWithMemory)(
const ident mem,
size_t length);
584 void (*trim)(
String *self);
const char * NameForStringEncoding(StringEncoding encoding)
String * str(const char *fmt,...)
StringEncoding StringEncodingForName(const char *name)
Order StringCompare(const ident a, const ident b)
StringEncoding
Character encodings for Strings.
@ STRING_ENCODING_MACROMAN
OBJECTIVELY_EXPORT Class * _String(void)
OBJECTIVELY_EXPORT char * strtrim(const char *s)
Copies the given null-terminated C string, trimming leading and trailing whitespace.
wchar_t Unicode
The Unicode type.
void * ident
The identity type, similar to Objective-C id.
#define OBJECTIVELY_EXPORT
Order
Comparison constants.
The runtime representation of a Class.
Object is the root Class of The Objectively Class hierarchy.
A location and length into contiguous collections.
char * chars
The backing null-terminated UTF-8 encoded character array.
StringInterface * interface
The interface.
size_t length
The length of the String in bytes.
Object object
The superclass.