A Unicode (UTF-8) text string.
|
VuoText | VuoText_makeFromJson (json_object *js) |
| Decodes the JSON object js , expected to contain a UTF-8 string, to create a new value. More...
|
|
json_object * | VuoText_getJson (const VuoText value) |
| Encodes value as a JSON object. More...
|
|
char * | VuoText_getSummary (const VuoText value) |
| Creates a new UTF-8 C string from value , or, if it's more than 50 Unicode characters long, creates an aposiopesis. More...
|
|
VuoText | VuoText_makeWithoutCopying (const char *string) |
| Creates a VuoText value from a UTF-8 C string. More...
|
|
VuoText | VuoText_make (const char *string) |
| Creates a VuoText value from a UTF-8 C string. More...
|
|
size_t | VuoText_length (const VuoText text) |
| Returns the number of Unicode characters in the text. More...
|
|
bool | VuoText_isLessThan (const VuoText text1, const VuoText text2) |
| Returns true if text1 is ordered before text2 in a case-sensitive lexicographic ordering (which treats different UTF-8 encodings and Unicode character decompositions as equivalent). More...
|
|
bool | VuoText_isLessThanCaseInsensitive (const VuoText text1, const VuoText text2) |
| Returns true if text1 is ordered before text2 in a case-insensitive lexicographic ordering (which treats different UTF-8 encodings and Unicode character decompositions as equivalent). More...
|
|
bool | VuoText_isLessThanNumeric (const VuoText text1, const VuoText text2) |
| Returns true if the number in text1 is less than the number in text2. More...
|
|
bool | VuoText_compare (VuoText text1, VuoTextComparison comparison, VuoText text2) |
| Returns true if text1 matches text2 based on comparison. More...
|
|
size_t | VuoText_findFirstOccurrence (const VuoText string, const VuoText substring, const size_t startIndex) |
| Returns the index (starting at 1) of the first instance of substring in string at index >= startIndex. More...
|
|
size_t | VuoText_findLastOccurrence (const VuoText string, const VuoText substring) |
| Returns the index (starting at 1) of the last instance of substring in string. More...
|
|
VuoText | VuoText_substring (const VuoText string, int startIndex, int length) |
| Returns the substring of string starting at index startIndex and spanning length Unicode characters. More...
|
|
VuoText | VuoText_append (VuoText *texts, size_t textsCount) |
| Returns a string consisting of the elements in the texts array concatenated together. More...
|
|
VuoText | VuoText_appendWithSeparator (VuoList_VuoText texts, VuoText separator, bool includeEmptyParts) |
| Returns a string consisting of the elements in texts array concatenated together, with separator between them. More...
|
|
VuoText * | VuoText_split (VuoText text, VuoText separator, bool includeEmptyParts, size_t *partsCount) |
| Splits text into parts (basically the inverse of VuoText_append()). More...
|
|
VuoText | VuoText_makeWithMaxLength (const void *data, const size_t maxLength) |
| Creates a VuoText value by copying from an untrusted source (one that might not contain a NULL terminator within its memory page). More...
|
|
VuoText | VuoText_makeFromCFString (const void *cfString) |
| Creates a VuoText value by copying from a CFStringRef . More...
|
|
VuoText | VuoText_makeFromData (const unsigned char *data, const unsigned long size) |
| Attempts to interpret data as UTF-8 text, copying it to a VuoText value if it is valid UTF-8. More...
|
|
VuoText | VuoText_makeFromUtf32 (const uint32_t *data, size_t length) |
| Create a VuoText value by copying from an array of UTF-32 values. More...
|
|
VuoText | VuoText_makeFromMacRoman (const char *string) |
| Creates a VuoText value by copying from a MacRoman-encoded string. More...
|
|
size_t | VuoText_byteCount (const VuoText text) |
| Returns the number of bytes in the text, not including the null terminator. More...
|
|
bool | VuoText_isEmpty (const VuoText text) |
| Returns true if text is empty (is NULL or is non-NULL with zero length). More...
|
|
bool | VuoText_isPopulated (const VuoText text) |
| Returns true if text is not empty. More...
|
|
bool | VuoText_areEqual (const VuoText text1, const VuoText text2) |
| Returns true if the two texts represent the same Unicode string (even if they use different UTF-8 encodings or Unicode character decompositions). More...
|
|
VuoList_VuoInteger | VuoText_findOccurrences (const VuoText string, const VuoText substring) |
| Returns a list containing all occurrences of substring in string . More...
|
|
VuoText | VuoText_insert (const VuoText string, int startIndex, const VuoText newText) |
| Returns a new string with newText inserted at the startIndex . More...
|
|
VuoText | VuoText_removeAt (const VuoText string, int startIndex, int length) |
| Returns a new string where characters from startIndex to startIndex + length are removed. More...
|
|
VuoText | VuoText_replace (VuoText subject, VuoText stringToFind, VuoText replacement) |
| Returns a new string in which each occurrence of stringToFind in subject has been replaced with replacement . More...
|
|
VuoText | VuoText_truncateWithEllipsis (const VuoText subject, int maxLength, VuoTextTruncation where) |
| If subject is less than or equal to maxLength Unicode characters long, returns subject . More...
|
|
VuoText | VuoText_trim (const VuoText text) |
| Returns a new string consisting of text without the whitespace at the beginning and end. More...
|
|
VuoText | VuoText_changeCase (const VuoText text, VuoTextCase textCase) |
| Returns a new string with the text characters cased in the textCase style. More...
|
|
uint32_t * | VuoText_getUtf32Values (const VuoText text, size_t *length) |
| Returns an array of unicode 32 bit decimal values for each character in a string. More...
|
|
char * | VuoText_format (const char *format,...) VUOTEXT_FORMAT_ATTRIBUTE |
| Returns a new string formatted using the printf-style format string. More...
|
|
char * | VuoText_getString (const VuoText value) |
| Automatically generated function. More...
|
|
void | VuoText_retain (VuoText value) |
| Automatically generated function. More...
|
|
void | VuoText_release (VuoText value) |
| Automatically generated function. More...
|
|
VuoText VuoText_makeWithMaxLength |
( |
const void * |
data, |
|
|
const size_t |
maxLength |
|
) |
| |
Creates a VuoText value by copying from an untrusted source (one that might not contain a NULL terminator within its memory page).
Use this, for example, to safely handle a string that's part of a network packet.
If data
ends with a NULL terminator, this function simply copies it into a new VuoText instance.
If data
does not end with a NULL terminator, this function scans up to maxLength
bytes in data
. If it finds a NULL terminator, it returns text up to and including the NULL terminator. If it doesn't find a NULL terminator, it returns maxLength
characters followed by a NULL terminator.
If data
is in a multi-byte UTF8 character sequence when maxLength
is reached, the sequence will be terminated partway, probably resulting in an invalid UTF8 sequence.
Definition at line 170 of file VuoText.c.