(* $Id: oOChannel.mli,v 1.4 2004/04/14 18:11:07 yori Exp $ *)
(* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)

(** Generic input/output channel *)
class type ['a] obj_input_channel = 
  object 
    method close : unit 

	(** If the channel is already terminated, raise End_of_file *)
    method get : 'a 
  end

class type ['a] obj_output_channel = 
  object
    method close : unit
    method flush : unit
    method put : 'a -> unit
  end

class ['a] channel_of_stream : 'a Stream.t -> ['a] obj_input_channel

val stream_of_channel : 'a #obj_input_channel -> 'a Stream.t

class ['a, 'b] filter_in : 
    ('b obj_output_channel -> 'a obj_output_channel) ->
      'a obj_input_channel -> 
	['b] obj_input_channel

class ['a] unget : 'a #obj_input_channel ->
    object
      inherit ['a] obj_input_channel
      method unget : 'a -> unit
    end

class type char_input_channel =
  object
    inherit [char] obj_input_channel
    method input : string -> int -> int -> int
    method really_input : string -> int -> int -> unit
  end

class type char_output_channel =
  object
    inherit [char] obj_output_channel
    method output : string -> int -> int -> unit
  end

class char_input_channel_of : char obj_input_channel -> char_input_channel
class char_output_channel_of : char obj_output_channel -> char_output_channel

class of_in_channel : Pervasives.in_channel -> char_input_channel
class of_out_channel : Pervasives.out_channel -> char_output_channel
