Vuo  0.4.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Functions

Description

A Unicode (UTF-8) text string.

Typedefs

typedef const char * VuoText
 A Unicode (UTF-8) text string.
 

Functions

char * VuoText_stpncpy (char *dest, const char *src, size_t n)
 The stpncpy function is not provided by Mac OS X implementation of <string.h>.
 
VuoText VuoText_valueFromString (const char *initializer)
 Creates a new VuoText from the UTF-8 C string initializer.
 
char * VuoText_stringFromValue (const VuoText value)
 Creates a new UTF-8 C string from value.
 
char * VuoText_summaryFromValue (const VuoText value)
 Creates a new double-quoted UTF-8 C string from value, or, if it's more than 32 characters long, creates an aposiopesis.
 
size_t VuoText_convertUTF8IndexToByteIndex (UText *text, int logicalCharIndex)
 Returns the byte offset of logicalCharIndex into text's UTF-8 representation.
 
size_t VuoText_length (const VuoText string)
 Returns the number of UTF-8 characters in the string.
 
VuoText VuoText_substring (const VuoText string, size_t startIndex, size_t length)
 Returns the substring of string starting at index startIndex and spanning length UTF-8 characters.
 

Function Documentation

char* VuoText_stpncpy ( char *  dest,
const char *  src,
size_t  n 
)

The stpncpy function is not provided by Mac OS X implementation of <string.h>.

Rather than adding a dependency, just define it here. This is getting replaced anyway with Unicode-aware code. http://pubs.opengroup.org/onlinepubs/9699919799/functions/strncpy.html

VuoText VuoText_substring ( const VuoText  string,
size_t  startIndex,
size_t  length 
)

Returns the substring of string starting at index startIndex and spanning length UTF-8 characters.

If startIndex is past the end of the string, returns the empty string.

If string has fewer than length characters from startIndex to the end of string, returns all characters from startIndex to the end of string.

char * VuoText_summaryFromValue ( const VuoText  value)

Creates a new double-quoted UTF-8 C string from value, or, if it's more than 32 characters long, creates an aposiopesis.

Example:
"Hello World!"
Example:
"I would like to convey my greeti..."