~ubuntu-branches/ubuntu/lucid/camomile/lucid

« back to all changes in this revision

Viewing changes to public/uLine.mli

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Le Gall
  • Date: 2005-12-03 01:18:55 UTC
  • Revision ID: james.westby@ubuntu.com-20051203011855-qzvwlld1xyqnl62t
Tags: upstream-0.6.3
ImportĀ upstreamĀ versionĀ 0.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* $Id: uLine.mli,v 1.4 2004/04/14 18:11:07 yori Exp $ *)
 
2
(* Copyright 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
3
 
 
4
(** Line I/O, conversion of line separators. *)
 
5
open OOChannel
 
6
 
 
7
(** Line separators.  
 
8
   - [`CR] specifies carriage return.
 
9
   - [`LF] specifies linefeed.
 
10
   - [`CRLF] specifies the sequence of carriage return and linefeed.
 
11
   - [`NEL] specifies next line (\u0085).
 
12
   - [`LS] specifies Unicode line separator (\u2028).
 
13
   - [`PS] specifies Unicode paragraph separator (\u2029). *)
 
14
type separator =
 
15
  [ `CR
 
16
  | `LF
 
17
  | `CRLF
 
18
  | `NEL
 
19
  | `LS
 
20
  | `PS ]
 
21
 
 
22
(** [new input separator input_obj] creates the new input channel object
 
23
   {!OOChannel.obj_input_channel} which reads from [input_obj] and
 
24
   converts line separators (all of CR, LF, CRLF, NEL, LS, PS) to
 
25
   [separator]. *)
 
26
class input : separator -> 
 
27
  UChar.t #obj_input_channel -> [UChar.t] obj_input_channel
 
28
 
 
29
(** [new output separator output_obj] creates the new output channel
 
30
   object {!OOChannel.obj_output_channel} which receives Unicode characters 
 
31
   and converts line separators (all of CR, LF, CRLF, NEL, LS, PS) to
 
32
   [separator]. *)
 
33
class output : separator ->
 
34
  UChar.t #obj_output_channel -> [UChar.t] obj_output_channel
 
35
 
 
36
module type Type = sig
 
37
 
 
38
  type text
 
39
 
 
40
(** [new input_line input_obj] creates the new input channel object
 
41
   {!OOChannel.obj_input_channel} which reads Unicode characters 
 
42
   from [input_obj] and output lines.  All of CR, LF, CRLF, NEL, LS, PS, 
 
43
   as well as FF (formfeed) are recognised as a line separator. *)
 
44
  class input_line : UChar.t #obj_input_channel -> [text] obj_input_channel
 
45
 
 
46
(** [new output_line ~sp output_obj] create the new output channel object
 
47
   {!OOChannel.obj_output_channel} which output each line to [output_obj]
 
48
   using [sp] as a line separator.  
 
49
   If [sp] is omitted, linefeed (LF) is used. *)
 
50
  class output_line : ?sp:separator ->
 
51
      UChar.t #obj_output_channel -> [text] obj_output_channel
 
52
 
 
53
end
 
54
 
 
55
module Make : functor (Text : UnicodeString.Type) ->
 
56
  (Type with type text = Text.t)