NAME ^

src/charset/unicode.c

DESCRIPTION ^

This file implements the charset functions for unicode data

static void set_graphemes

Sets replace_count graphemes in STRING source_string starting at offset offset. Gets the graphemes to be replaced from STRING insert_string.

static STRING *get_graphemes

Gets the graphemes from STRING source_string starting at offset. Gets count graphemes total.

static STRING *get_graphemes_inplace

Gets count graphemes in place from STRING source_string starting at offset offset. Puts them into STRING dest_string.

static STRING *to_charset

Converts input STRING src to unicode STRING dest.

static STRING *compose

If Parrot is built with ICU, composes the STRING src. Attempts to denormalize the STRING into the ICU default, NFC.

If Parrot does not have ICU included, throws an exception.

static STRING *decompose

Decompose function for unicode charset. This function is not yet implemented.

static void upcase

Converts the STRING src to all upper-case graphemes, for those characters which support upper-case versions.

Throws an exception if ICU is not installed.

static void downcase

Converts all graphemes to lower-case, for those graphemes which have cases.

Throws an exception if ICU is not installed.

static void titlecase

Converts the string to title case, for those characters which support cases.

Throws an exception if ICU is not installed.

static void upcase_first

Converts the first grapheme in the STRING source_string to uppercase, if the grapheme supports it. Not implemented.

static void downcase_first

Converts the first grapheme in the STRING source_string to lower-case, if the grapheme supports it. Not implemented

static void titlecase_first

Converts the first grapheme in STRING source_string to title case, if the string supports it. Not implemented.

static INTVAL compare

Compares two STRINGs, lhs and rhs. Returns -1 if lhs < rhs. Returns 0 if lhs = rhs. Returns 1 if lhs > rhs.

static INTVAL cs_rindex

Finds the last index of substring search_string in STRING source_string, starting from offset. Not implemented.

static UINTVAL validate

Returns 1 if the STRING src is a valid unicode string, returns 0 otherwise.

static int u_iscclass

RT #48260: Not yet documented!!!

static INTVAL is_cclass

RT #48260: Not yet documented!!!

static INTVAL find_cclass

RT #48260: Not yet documented!!!

static INTVAL find_not_cclass

RT #48260: Not yet documented!!!

static STRING *string_from_codepoint

Returns a one-codepoint string for the given codepoint.

static size_t compute_hash

Computes the hash of the given STRING src with starting seed value seed.

const CHARSET *Parrot_charset_unicode_init

Initializes the Unicode charset by installing all the necessary function pointers.


parrot