2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
1995-08-09 08:06:35 -07:00
|
|
|
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Character operations. *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1998-12-02 02:40:33 -08:00
|
|
|
external code : char -> int = "%identity"
|
2001-12-03 14:01:28 -08:00
|
|
|
(** Return the ASCII code of the argument. *)
|
2005-10-25 11:34:07 -07:00
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val chr : int -> char
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Return the character with the given ASCII code.
|
2020-06-30 06:06:45 -07:00
|
|
|
@raise Invalid_argument if the argument is
|
2001-10-26 15:37:14 -07:00
|
|
|
outside the range 0--255. *)
|
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val escaped : char -> string
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Return a string representing the given character,
|
2015-03-11 11:41:15 -07:00
|
|
|
with special characters escaped following the lexical conventions
|
|
|
|
of OCaml.
|
|
|
|
All characters outside the ASCII printable range (32..126) are
|
|
|
|
escaped, as well as backslash, double-quote, and single-quote. *)
|
2001-10-26 15:37:14 -07:00
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val lowercase : char -> char
|
2014-12-21 03:46:18 -08:00
|
|
|
[@@ocaml.deprecated "Use Char.lowercase_ascii instead."]
|
|
|
|
(** Convert the given character to its equivalent lowercase character,
|
|
|
|
using the ISO Latin-1 (8859-1) character set.
|
|
|
|
@deprecated Functions operating on Latin-1 character set are deprecated. *)
|
2001-10-26 15:37:14 -07:00
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val uppercase : char -> char
|
2014-12-21 03:46:18 -08:00
|
|
|
[@@ocaml.deprecated "Use Char.uppercase_ascii instead."]
|
|
|
|
(** Convert the given character to its equivalent uppercase character,
|
|
|
|
using the ISO Latin-1 (8859-1) character set.
|
|
|
|
@deprecated Functions operating on Latin-1 character set are deprecated. *)
|
|
|
|
|
|
|
|
val lowercase_ascii : char -> char
|
|
|
|
(** Convert the given character to its equivalent lowercase character,
|
2014-12-21 03:46:23 -08:00
|
|
|
using the US-ASCII character set.
|
|
|
|
@since 4.03.0 *)
|
2014-12-21 03:46:18 -08:00
|
|
|
|
|
|
|
val uppercase_ascii : char -> char
|
|
|
|
(** Convert the given character to its equivalent uppercase character,
|
2014-12-21 03:46:23 -08:00
|
|
|
using the US-ASCII character set.
|
|
|
|
@since 4.03.0 *)
|
2001-10-26 15:37:14 -07:00
|
|
|
|
2002-06-26 02:13:59 -07:00
|
|
|
type t = char
|
|
|
|
(** An alias for the type of characters. *)
|
|
|
|
|
|
|
|
val compare: t -> t -> int
|
|
|
|
(** The comparison function for characters, with the same specification as
|
2018-08-27 04:42:14 -07:00
|
|
|
{!Stdlib.compare}. Along with the type [t], this function [compare]
|
2002-06-26 02:13:59 -07:00
|
|
|
allows the module [Char] to be passed as argument to the functors
|
|
|
|
{!Set.Make} and {!Map.Make}. *)
|
|
|
|
|
2014-12-21 03:46:08 -08:00
|
|
|
val equal: t -> t -> bool
|
|
|
|
(** The equal function for chars.
|
|
|
|
@since 4.03.0 *)
|
|
|
|
|
2001-10-30 08:52:04 -08:00
|
|
|
(**/**)
|
1995-08-09 06:15:01 -07:00
|
|
|
|
2012-03-14 09:03:15 -07:00
|
|
|
(* The following is for system use only. Do not call directly. *)
|
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
external unsafe_chr : int -> char = "%identity"
|