NAME
src/string/charset/ascii.c
DESCRIPTION
This file implements the charset functions for ascii data and common charset functionality for similar charsets like iso-8859-1.
STRING *ascii_get_graphemes
Retrieves the graphemes for the STRING static void set_graphemes
Sets the graphemes for STRING *ascii_get_graphemes_inplace
Retrieves the graphemes in place for ascii STRING static STRING *to_ascii
Attempts to convert STRING static STRING *to_unicode
Converts the ASCII STRING static STRING *to_charset
Converts STRING static STRING *compose
Can't compose ASCII strings,
so performs a string copy on it and returns the new string.
static STRING *decompose
Can't decompose ASCII,
so we perform a string copy instead and return a pointer to the new string.
static void upcase
Converts the STRING static void downcase
Converts the STRING static void titlecase
Converts the STRING given by static void upcase_first
Sets the first character in the STRING static void downcase_first
Sets the first character of the STRING static void titlecase_first
Converts the first letter of STRING INTVAL ascii_compare
Compares two strings as ASCII strings.
If STRING INTVAL mixed_cs_index
Searches for the first instance of STRING INTVAL ascii_cs_index
Searches for the first instance of STRING INTVAL ascii_cs_rindex
Searches for the last instance of STRING static UINTVAL validate
Verifies that the given string is valid ASCII.
Returns 1 if it is ASCII,
returns 0 otherwise.
static STRING *string_from_codepoint
Creates a new STRING object from a single codepoint 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!!!
size_t ascii_compute_hash
Computes the hash of STRING const CHARSET *Parrot_charset_ascii_init
Initialize the ASCII charset but registering all the necessary function pointers and settings.
STRING *charset_cvt_ascii_to_binary
Converts an ASCII STRING STRING *charset_cvt_ascii_to_iso_8859_1
Converts ASCII STRING
source_string
,
starting at offset
and ending at offset + count
.
source_string
,
starting at offset
.
Replace replace_count
graphemes with those from STRING insert_string
.
source_string
,
starting at offset
.
Retrieves count
graphemes and puts them into dest_string
.
src
to ASCII in STRING dest
.
Throws an exception if unconvertable UNICODE characters are involved.
src
to UNICODE STRING dest
.
src
to ASCII charset STRING dest
.
source_string
to all uppercase.
source_string
to all lower-case.
source_string
to title case,
where the first character is upper case and all the rest of the characters are lower-case.
source_string
to upper case,
but doesn't modify the rest of the string.
source_string
to lowercase,
but doesn't modify the rest of the characters.
source_string
to upper case,
but doesn't modify the rest of the string.
lhs
> rhs
,
returns 1.
If lhs
== rhs
returns 0.
If STRING lhs
< rhs
,
returns -1.
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.
search
in STRING src
.
returns the position where the substring is found if it is indeed found.
Returns -1 otherwise.
search_string
in STRING source_string
.
Starts searching at offset
.
codepoint
.
Returns the new STRING.
source_string
starting with seed value seed
.
src
to a binary STRING dest
.
src
to ISO8859-1 STRING dest
.