parrotcode: src/charset/ascii.c | |
Contents | C |
src/charset/ascii.c
This file implements the charset functions for ascii data and common charset functionality for similar charsets like iso-8859-1.
STRING *ascii_get_graphemes
source_string
,
starting at offset
and ending at offset + count
.static void set_graphemes
source_string
,
starting at offset
.
Replace replace_count
graphemes with those from STRING insert_string
.STRING *ascii_get_graphemes_inplace
source_string
,
starting at offset
.
Retrieves count
graphemes and puts them into dest_string
.static STRING *to_ascii
src
to ASCII in STRING dest
.
Throws an exception if unconvertable UNICODE characters are involved.static STRING *to_unicode
src
to UNICODE STRING dest
.static STRING *to_charset
src
to ASCII charset STRING dest
.static STRING *compose
static STRING *decompose
static void upcase
source_string
to all uppercase.static void downcase
source_string
to all lower-case.static void titlecase
source_string
to title case,
where the first character is upper case and all the rest of the characters are lower-case.static void upcase_first
source_string
to upper case,
but doesn't modify the rest of the string.static void downcase_first
source_string
to lowercase,
but doesn't modify the rest of the characters.static void titlecase_first
source_string
to upper case,
but doesn't modify the rest of the string.INTVAL ascii_compare
lhs
> rhs
,
returns 1.
If lhs
== rhs
returns 0.
If STRING lhs
< rhs
,
returns -1.INTVAL mixed_cs_index
search
in STRING src
.
returns the position where the substring is found if it is indeed found.
Returns -1 otherwise.
Operates on different types of strings,
not just ASCII.INTVAL ascii_cs_index
search
in STRING src
.
returns the position where the substring is found if it is indeed found.
Returns -1 otherwise.INTVAL ascii_cs_rindex
search_string
in STRING source_string
.
Starts searching at offset
.static UINTVAL validate
static STRING *string_from_codepoint
codepoint
.
Returns the new STRING.static INTVAL is_cclass
static INTVAL find_cclass
static INTVAL find_not_cclass
size_t ascii_compute_hash
source_string
starting with seed value seed
.const CHARSET *Parrot_charset_ascii_init
STRING *charset_cvt_ascii_to_binary
src
to a binary STRING dest
.STRING *charset_cvt_ascii_to_iso_8859_1
src
to ISO8859-1 STRING dest
.
|