1 | <?php |
||
24 | class TypeFactory implements TypeFactoryInterface |
||
25 | { |
||
26 | /** |
||
27 | * Add a Uint8 serializer to the template |
||
28 | * |
||
29 | * @return Uint8 |
||
30 | */ |
||
31 | 6 | public function uint8(): Uint8 |
|
35 | |||
36 | /** |
||
37 | * Add a little-endian Uint8 serializer to the template |
||
38 | * |
||
39 | * @return Uint8 |
||
40 | */ |
||
41 | 6 | public function uint8le(): Uint8 |
|
45 | |||
46 | /** |
||
47 | * Add a Uint16 serializer to the template |
||
48 | * |
||
49 | * @return Uint16 |
||
50 | */ |
||
51 | 6 | public function uint16(): Uint16 |
|
55 | |||
56 | /** |
||
57 | * Add a little-endian Uint16 serializer to the template |
||
58 | * |
||
59 | * @return Uint16 |
||
60 | */ |
||
61 | 6 | public function uint16le(): Uint16 |
|
65 | |||
66 | /** |
||
67 | * Add a Uint32 serializer to the template |
||
68 | * |
||
69 | * @return Uint32 |
||
70 | */ |
||
71 | 6 | public function uint32(): Uint32 |
|
75 | |||
76 | /** |
||
77 | * Add a little-endian Uint32 serializer to the template |
||
78 | * |
||
79 | * @return Uint32 |
||
80 | */ |
||
81 | 6 | public function uint32le(): Uint32 |
|
85 | |||
86 | /** |
||
87 | * Add a Uint64 serializer to the template |
||
88 | * |
||
89 | * @return Uint64 |
||
90 | */ |
||
91 | 6 | public function uint64(): Uint64 |
|
95 | |||
96 | /** |
||
97 | * Add a little-endian Uint64 serializer to the template |
||
98 | * |
||
99 | * @return Uint64 |
||
100 | */ |
||
101 | 6 | public function uint64le(): Uint64 |
|
105 | |||
106 | /** |
||
107 | * Add a Uint128 serializer to the template |
||
108 | * |
||
109 | * @return Uint128 |
||
110 | */ |
||
111 | 6 | public function uint128(): Uint128 |
|
115 | |||
116 | /** |
||
117 | * Add a little-endian Uint128 serializer to the template |
||
118 | * |
||
119 | * @return Uint128 |
||
120 | */ |
||
121 | 6 | public function uint128le(): Uint128 |
|
125 | |||
126 | /** |
||
127 | * Add a Uint256 serializer to the template |
||
128 | * |
||
129 | * @return Uint256 |
||
130 | */ |
||
131 | 6 | public function uint256(): Uint256 |
|
135 | |||
136 | /** |
||
137 | * Add a little-endian Uint256 serializer to the template |
||
138 | * |
||
139 | * @return Uint256 |
||
140 | */ |
||
141 | 6 | public function uint256le(): Uint256 |
|
145 | |||
146 | /** |
||
147 | * Add a int8 serializer to the template |
||
148 | * |
||
149 | * @return Int8 |
||
150 | */ |
||
151 | 6 | public function int8(): Int8 |
|
155 | |||
156 | /** |
||
157 | * Add a little-endian Int8 serializer to the template |
||
158 | * |
||
159 | * @return Int8 |
||
160 | */ |
||
161 | 6 | public function int8le(): Int8 |
|
165 | |||
166 | /** |
||
167 | * Add a int16 serializer to the template |
||
168 | * |
||
169 | * @return Int16 |
||
170 | */ |
||
171 | 6 | public function int16(): Int16 |
|
175 | |||
176 | /** |
||
177 | * Add a little-endian Int16 serializer to the template |
||
178 | * |
||
179 | * @return Int16 |
||
180 | */ |
||
181 | 6 | public function int16le(): Int16 |
|
185 | |||
186 | /** |
||
187 | * Add a int32 serializer to the template |
||
188 | * |
||
189 | * @return Int32 |
||
190 | */ |
||
191 | 6 | public function int32(): Int32 |
|
195 | |||
196 | /** |
||
197 | * Add a little-endian Int serializer to the template |
||
198 | * |
||
199 | * @return Int32 |
||
200 | */ |
||
201 | 6 | public function int32le(): Int32 |
|
205 | |||
206 | /** |
||
207 | * Add a int64 serializer to the template |
||
208 | * |
||
209 | * @return Int64 |
||
210 | */ |
||
211 | 6 | public function int64(): Int64 |
|
215 | |||
216 | /** |
||
217 | * Add a little-endian Int64 serializer to the template |
||
218 | * |
||
219 | * @return Int64 |
||
220 | */ |
||
221 | 6 | public function int64le(): Int64 |
|
225 | |||
226 | /** |
||
227 | * Add a int128 serializer to the template |
||
228 | * |
||
229 | * @return Int128 |
||
230 | */ |
||
231 | 6 | public function int128(): Int128 |
|
235 | |||
236 | /** |
||
237 | * Add a little-endian Int128 serializer to the template |
||
238 | * |
||
239 | * @return Int128 |
||
240 | */ |
||
241 | 6 | public function int128le(): Int128 |
|
245 | |||
246 | /** |
||
247 | * Add a int256 serializer to the template |
||
248 | * |
||
249 | * @return Int256 |
||
250 | */ |
||
251 | 6 | public function int256(): Int256 |
|
255 | |||
256 | /** |
||
257 | * Add a little-endian Int256 serializer to the template |
||
258 | * |
||
259 | * @return Int256 |
||
260 | */ |
||
261 | 6 | public function int256le(): Int256 |
|
265 | |||
266 | /** |
||
267 | * Add a VarInt serializer to the template |
||
268 | * |
||
269 | * @return VarInt |
||
270 | */ |
||
271 | 4 | public function varint(): VarInt |
|
275 | |||
276 | /** |
||
277 | * Add a VarString serializer to the template |
||
278 | * |
||
279 | * @return VarString |
||
280 | */ |
||
281 | 2 | public function varstring(): VarString |
|
285 | |||
286 | /** |
||
287 | * Add a byte string serializer to the template. This serializer requires a length to |
||
288 | * pad/truncate to. |
||
289 | * |
||
290 | * @param int $length |
||
291 | * @return ByteString |
||
292 | */ |
||
293 | public function bytestring(int $length): ByteString |
||
297 | |||
298 | /** |
||
299 | * Add a little-endian byte string serializer to the template. This serializer requires |
||
300 | * a length to pad/truncate to. |
||
301 | * |
||
302 | * @param int $length |
||
303 | * @return ByteString |
||
304 | */ |
||
305 | public function bytestringle(int $length): ByteString |
||
309 | |||
310 | /** |
||
311 | * Add a vector serializer to the template. A $readHandler must be provided if the |
||
312 | * template will be used to deserialize a vector, since it's contents are not known. |
||
313 | * |
||
314 | * The $readHandler should operate on the parser reference, reading the bytes for each |
||
315 | * item in the collection. |
||
316 | * |
||
317 | * @param callable $readHandler |
||
318 | * @return Vector |
||
319 | */ |
||
320 | 2 | public function vector(callable $readHandler): Vector |
|
324 | } |
||
325 |