package daypack-lib

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file time_slot_j.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
(* Auto-generated from "time_slot.atd" *)
[@@@ocaml.warning "-27-32-33-35-39"]

type int64 = Int64_t.int64

type time_slot = Time_slot_t.time_slot

let write_int64 = (
  Int64_j.write_int64
)
let string_of_int64 ?(len = 1024) x =
  let ob = Buffer.create len in
  write_int64 ob x;
  Buffer.contents ob
let read_int64 = (
  Int64_j.read_int64
)
let int64_of_string s =
  read_int64 (Yojson.Safe.init_lexer ()) (Lexing.from_string s)
let write_time_slot = (
  fun ob x ->
    Buffer.add_char ob '[';
    (let x, _ = x in
    (
      write_int64
    ) ob x
    );
    Buffer.add_char ob ',';
    (let _, x = x in
    (
      write_int64
    ) ob x
    );
    Buffer.add_char ob ']';
)
let string_of_time_slot ?(len = 1024) x =
  let ob = Buffer.create len in
  write_time_slot ob x;
  Buffer.contents ob
let read_time_slot = (
  fun p lb ->
    Yojson.Safe.read_space p lb;
    Atdgen_runtime.Yojson_extra.start_any_tuple p lb;
    let len = ref 0 in
    let end_of_tuple = ref false in
    (try
      let x0 =
        let x =
          (
            read_int64
          ) p lb
        in
        incr len;
        Yojson.Safe.read_space p lb;
        Atdgen_runtime.Yojson_extra.read_tuple_sep2 p lb;
        x
      in
      let x1 =
        let x =
          (
            read_int64
          ) p lb
        in
        incr len;
        (try
          Yojson.Safe.read_space p lb;
          Atdgen_runtime.Yojson_extra.read_tuple_sep2 p lb;
        with Atdgen_runtime.Yojson_extra.End_of_tuple -> end_of_tuple := true);
        x
      in
      if not !end_of_tuple then (
        try
          while true do
            Yojson.Safe.skip_json p lb;
            Yojson.Safe.read_space p lb;
            Atdgen_runtime.Yojson_extra.read_tuple_sep2 p lb;
          done
        with Atdgen_runtime.Yojson_extra.End_of_tuple -> ()
      );
      (x0, x1)
    with Atdgen_runtime.Yojson_extra.End_of_tuple ->
      Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]);
)
let time_slot_of_string s =
  read_time_slot (Yojson.Safe.init_lexer ()) (Lexing.from_string s)