1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
2001-12-07 05:41:02 -08:00
|
|
|
(* under the terms of the GNU Library General Public License, with *)
|
|
|
|
(* the special exception on linking described in 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.
|
|
|
|
Raise [Invalid_argument "Char.chr"] if the argument is
|
|
|
|
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
|
|
|
|
{!Pervasives.compare}. Along with the type [t], this function [compare]
|
|
|
|
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"
|