(* $Id: uPervasives.mli,v 1.2 2004/04/06 22:12:40 yori Exp $ *)
(* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)

type uchar = UChar.t
open OOChannel

val io_normalization_mode : [ `Off | `NFC ] ref
val newline_mode : [ `CR | `CRLF | `LF | `ULS ] ref
val validate_utf8 : string -> unit

(** Aliases for UChar.uint_code, UChar.chr_of_uint *)

val int_of_uchar : uchar -> int
val uchar_of_int : int -> uchar

val escaped_uchar : uchar -> string
val escaped_utf8 : string -> string

val printer_utf8 : Format.formatter -> string -> unit
val printer_uchar : Format.formatter -> uchar -> unit

class utf8_in_channel : uchar obj_input_channel ->
  object
    method get : uchar
    method peek : uchar
    method close : unit
    method input : string -> int -> int -> int
    method really_input : string -> int -> int -> unit
    method input_char : char
  end

class utf8_in_channel_of_in_channel : 
    ?normalization:[ `Off | `NFC ] ->
      ?encoding:string ->
	Pervasives.in_channel -> 
	  utf8_in_channel

class utf8_out_channel : uchar obj_output_channel ->
  object
    method put : uchar -> unit
    method flush : unit
    method close : unit
    method output : string -> int -> int -> unit
    method output_char : char -> unit
  end

class utf8_out_channel_of_out_channel : 
    ?normalization:[ `Off | `NFC ] ->
      ?encoding:string ->
	Pervasives.out_channel -> 
	  utf8_out_channel
