## char.api
#
# See also:
#
src/lib/std/src/int-chartype.api#
src/lib/std/src/string-chartype.api# Compiled by:
#
src/lib/std/src/standard-core.sublibstipulate
package ns = number_string; # number_string is from
src/lib/std/src/number-string.pkg package str = string; # string is from
src/lib/std/types-only/basis-structs.pkgherein
# This api is implemented in:
#
#
src/lib/std/src/char.pkg #
api Char {
#
eqtype Char;
eqtype String;
from_int: Int -> Char;
to_int: Char -> Int;
min_char: Char;
max_char: Char;
max_ord: Int;
prior: Char -> Char;
next: Char -> Char;
< : (Char, Char) -> Bool;
<= : (Char, Char) -> Bool;
> : (Char, Char) -> Bool;
>= : (Char, Char) -> Bool;
compare: (Char, Char) -> Order;
scan: ns::Reader (Char, X)
->
ns::Reader (Char, X);
from_string: str::String -> Null_Or( Char );
to_string: Char -> str::String; # NB: This converts '"' and '\\' to "\\\"" and "\\\\" respectively -- two-byte strings starting with backslash. Depending on the application, this might or might not be what you want.
from_cstring: str::String -> Null_Or( Char );
to_cstring: Char -> str::String;
contains: String -> Char -> Bool;
not_contains: String -> Char -> Bool;
is_lower: Char -> Bool; # Contains "abcdefghijklmnopqrstuvwxyz" # Note that Int -> Bool versions of these may be found in
src/lib/std/src/int-chartype.api is_upper: Char -> Bool; # Contains "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
is_digit: Char -> Bool; # Contains "0123456789"
is_alpha: Char -> Bool; # is_upper or is_lower
is_hex_digit: Char -> Bool; # is_digit or contains "abcdefABCDEF"
is_alphanumeric: Char -> Bool; # is_alpha or is_digit
is_print: Char -> Bool; # Any printable character (incl. ' ')
is_space: Char -> Bool; # Contains " \t\r\n\v\f"
is_punct: Char -> Bool;
is_graph: Char -> Bool; # (not is_space) and is_print
is_cntrl: Char -> Bool;
is_ascii: Char -> Bool; # ord c < 128
to_upper: Char -> Char;
to_lower: Char -> Char;
nul: Char;
ctrl_a: Char;
ctrl_b: Char;
ctrl_c: Char;
ctrl_d: Char;
ctrl_e: Char;
ctrl_f: Char;
ctrl_g: Char;
ctrl_h: Char;
ctrl_i: Char;
ctrl_j: Char; newline: Char;
ctrl_k: Char;
ctrl_l: Char;
ctrl_m: Char; return: Char;
ctrl_n: Char;
ctrl_o: Char;
ctrl_p: Char;
ctrl_q: Char;
ctrl_r: Char;
ctrl_s: Char;
ctrl_t: Char;
ctrl_u: Char;
ctrl_v: Char;
ctrl_w: Char;
ctrl_x: Char;
ctrl_y: Char;
ctrl_z: Char;
del: Char;
};
end;
## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.