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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
include String
@BEGIN_BEFORE_4_07_0@
let of_seq g = Buffer.contents (Stdcompat__buffer.of_seq g)
let to_seq s = Stdcompat__tools.vec_to_seq length unsafe_get s
let to_seqi s = Stdcompat__tools.vec_to_seqi length unsafe_get s
@END_BEFORE_4_07_0@
@BEGIN_BEFORE_4_05_0@
let index_opt s c =
Stdcompat__tools.option_find (index s) c
let rindex_opt s c =
Stdcompat__tools.option_find (rindex s) c
let index_from_opt s i c =
Stdcompat__tools.option_find (index_from s i) c
let rindex_from_opt s i c =
Stdcompat__tools.option_find (rindex_from s i) c
@END_BEFORE_4_05_0@
@BEGIN_BEFORE_4_04_0@
let split_on_char c s =
List.map Stdcompat__bytes.unsafe_to_string
(Stdcompat__bytes.split_on_char c (Stdcompat__bytes.unsafe_of_string s))
@END_BEFORE_4_04_0@
@BEGIN_BEFORE_4_03_0@
let lowercase_ascii = lowercase
let uppercase_ascii = uppercase
let capitalize_ascii = capitalize
let uncapitalize_ascii = uncapitalize
let equal : t -> t -> bool = ( = )
@END_BEFORE_4_03_0@
@BEGIN_BEFORE_4_02_0@
let init = Stdcompat__bytes.init
let mapi = Stdcompat__bytes.mapi
@END_BEFORE_4_02_0@
@BEGIN_BEFORE_4_00_0@
let iteri = Stdcompat__bytes.iteri
let map = Stdcompat__bytes.map
let trim = Stdcompat__bytes.trim
@END_BEFORE_4_00_0@
@BEGIN_BEFORE_4_13_0@
let empty = ""
let of_bytes = Stdcompat__bytes.to_string
let to_bytes = Stdcompat__bytes.of_string
let cat = ( ^ )
let starts_with ~prefix s =
Stdcompat__bytes.starts_with
~prefix:(Stdcompat__bytes.unsafe_of_string prefix)
(Stdcompat__bytes.unsafe_of_string s)
let ends_with ~suffix s =
Stdcompat__bytes.ends_with ~suffix:(Stdcompat__bytes.unsafe_of_string suffix)
(Stdcompat__bytes.unsafe_of_string s)
let fold_left f init s =
Stdcompat__bytes.fold_left f init (Stdcompat__bytes.unsafe_of_string s)
let fold_right f s init =
Stdcompat__bytes.fold_right f (Stdcompat__bytes.unsafe_of_string s) init
let for_all f s =
Stdcompat__bytes.for_all f (Stdcompat__bytes.unsafe_of_string s)
let exists f s =
Stdcompat__bytes.exists f (Stdcompat__bytes.unsafe_of_string s)
let get_uint8 s i =
Stdcompat__bytes.get_uint8 (Stdcompat__bytes.unsafe_of_string s) i
let get_int8 s i =
Stdcompat__bytes.get_int8 (Stdcompat__bytes.unsafe_of_string s) i
let get_uint16_ne s i =
Stdcompat__bytes.get_uint16_ne (Stdcompat__bytes.unsafe_of_string s) i
let get_uint16_be s i =
Stdcompat__bytes.get_uint16_be (Stdcompat__bytes.unsafe_of_string s) i
let get_uint16_le s i =
Stdcompat__bytes.get_uint16_le (Stdcompat__bytes.unsafe_of_string s) i
let get_int16_ne s i =
Stdcompat__bytes.get_int16_ne (Stdcompat__bytes.unsafe_of_string s) i
let get_int16_be s i =
Stdcompat__bytes.get_int16_be (Stdcompat__bytes.unsafe_of_string s) i
let get_int16_le s i =
Stdcompat__bytes.get_int16_le (Stdcompat__bytes.unsafe_of_string s) i
let get_int32_ne s i =
Stdcompat__bytes.get_int32_ne (Stdcompat__bytes.unsafe_of_string s) i
let get_int32_be s i =
Stdcompat__bytes.get_int32_be (Stdcompat__bytes.unsafe_of_string s) i
let get_int32_le s i =
Stdcompat__bytes.get_int32_le (Stdcompat__bytes.unsafe_of_string s) i
let get_int64_ne s i =
Stdcompat__bytes.get_int64_ne (Stdcompat__bytes.unsafe_of_string s) i
let get_int64_be s i =
Stdcompat__bytes.get_int64_be (Stdcompat__bytes.unsafe_of_string s) i
let get_int64_le s i =
Stdcompat__bytes.get_int64_le (Stdcompat__bytes.unsafe_of_string s) i
@END_BEFORE_4_13_0@
@BEGIN_BEFORE_4_14_0@
let get_utf_8_uchar s i =
Stdcompat__bytes.get_utf_8_uchar (Stdcompat__bytes.unsafe_of_string s) i
let is_valid_utf_8 s =
Stdcompat__bytes.is_valid_utf_8 (Stdcompat__bytes.unsafe_of_string s)
let get_utf_16be_uchar s i =
Stdcompat__bytes.get_utf_16be_uchar (Stdcompat__bytes.unsafe_of_string s) i
let is_valid_utf_16be s =
Stdcompat__bytes.is_valid_utf_16be (Stdcompat__bytes.unsafe_of_string s)
let get_utf_16le_uchar s i =
Stdcompat__bytes.get_utf_16le_uchar (Stdcompat__bytes.unsafe_of_string s) i
let is_valid_utf_16le s =
Stdcompat__bytes.is_valid_utf_16le (Stdcompat__bytes.unsafe_of_string s)
@END_BEFORE_4_14_0@
@BEGIN_BEFORE_5_0_0@
let seeded_hash = Stdcompat__hashtbl.seeded_hash
let hash = Hashtbl.hash
@END_BEFORE_5_0_0@
|