Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 63 lines (46 sloc) 1.55 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (**
19 Printer of Json structure
20
21 @author Rudy Sicard
22 @author Raja Boujbel
23 @author Mathieu Barbin
24 *)
25
26 (**
27 Escape some special character.
28 *)
29 val escape_non_utf8_special : string -> string
30
31 module type Printer =
32 sig
33 type t
34 val json : t -> JsonTypes.json -> unit
35 end
36
37 (** {6 Efficient printing} *)
38
39 (**
40 Factory
41 *)
42 val print : ('output -> string -> unit) -> 'output -> JsonTypes.json -> unit
43
44 (**
45 This printer is used whenever you do not care about the look of the printed code.
46 It's main quality reside in the fact that it prints directly in an [output_channel],
47 without neither with parsing some format.
48 *)
49
50 module Output : Printer with type t = out_channel
51
52 (** {6 Unformated printing, with Buffer interface} *)
53
54 module Buffer : Printer with type t = Buffer.t
55
56
57 (** {6 Unefficient printing} *)
58
59 (**
60 Do not use for big structure
61 *)
62 val to_string : JsonTypes.json -> string
Something went wrong with that request. Please try again.