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

Description

A Unicode (UTF-8) text string.

Typedefs

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

Functions

VuoText VuoText_valueFromJson (json_object *js)
 Decodes the JSON object js, expected to contain a UTF-8 string, to create a new value.
 
json_object * VuoText_jsonFromValue (const VuoText value)
 Encodes value as a JSON object.
 
char * VuoText_summaryFromValue (const VuoText value)
 Creates a new UTF-8 C string from value, or, if it's more than 30 Unicode characters long, creates an aposiopesis.
 
VuoText VuoText_make (const char *unquotedString)
 Creates a VuoText value from an unquoted string (unlike VuoText_valueFromString(), which expects a quoted string).
 
size_t VuoText_length (const VuoText text)
 Returns the number of Unicode characters in the text.
 
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).
 
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).
 
size_t VuoText_findLastOccurrence (const VuoText string, const VuoText substring)
 Returns the index (starting at 1) of the last instance of substring in string.
 
VuoText VuoText_substring (const VuoText string, int startIndex, int length)
 Returns the substring of string starting at index startIndex and spanning length Unicode characters.
 
VuoText VuoText_append (VuoText *texts, size_t textsCount)
 Returns a string consisting of the elements in the texts array concatenated together.
 
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.
 
char * VuoText_format (const char *format,...) VUOTEXT_FORMAT_ATTRIBUTE
 Returns a new string formatted using the printf-style format string.
 
VuoText VuoText_valueFromString (const char *str)
 Automatically generated function.
 
char * VuoText_stringFromValue (const VuoText value)
 Automatically generated function.
 
void VuoText_retain (VuoText value)
 Automatically generated function.
 
void VuoText_release (VuoText value)
 Automatically generated function.
 

Typedef Documentation

typedef const char* VuoText

A Unicode (UTF-8) text string.

Function Documentation

VuoText VuoText_append ( VuoText texts,
size_t  textsCount 
)

Returns a string consisting of the elements in the texts array concatenated together.

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).

size_t VuoText_findLastOccurrence ( const VuoText  string,
const VuoText  substring 
)

Returns the index (starting at 1) of the last instance of substring in string.

Returns 0 if substring is not found.

This function will find occurrences that consist of the same Unicode characters as substring, but won't find occurrences that consist of the same Unicode string decomposed into a different number of Unicode characters.

char* VuoText_format ( const char *  format,
  ... 
)

Returns a new string formatted using the printf-style format string.

The caller is responsible for freeing the returned string.

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).

struct json_object * VuoText_jsonFromValue ( const VuoText  value)
read

Encodes value as a JSON object.

size_t VuoText_length ( const VuoText  text)

Returns the number of Unicode characters in the text.

VuoText VuoText_make ( const char *  unquotedString)

Creates a VuoText value from an unquoted string (unlike VuoText_valueFromString(), which expects a quoted string).

void VuoText_release ( VuoText  value)

Automatically generated function.

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.

stringToFind matches even if a different UTF-8 encoding or Unicode character decomposition is used.

void VuoText_retain ( VuoText  value)

Automatically generated function.

char* VuoText_stringFromValue ( const VuoText  value)

Automatically generated function.

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

Returns the substring of string starting at index startIndex and spanning length Unicode characters.

startIndex is indexed from 1, not 0.

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

If startIndex is before the beginning of string, deducts the number of characters before the beginning from length, and returns characters starting at the beginning of 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 UTF-8 C string from value, or, if it's more than 30 Unicode characters long, creates an aposiopesis.

Example:
Hello World!
Example:
I would like to convey my gree...
VuoText VuoText_valueFromJson ( json_object *  js)

Decodes the JSON object js, expected to contain a UTF-8 string, to create a new value.

VuoText VuoText_valueFromString ( const char *  str)

Automatically generated function.