3 /** @generate-class-entries */
12 case Timestamp
= 0x600;
20 case Datagram
= 0xf00;
26 enum Annotation
: string {
35 case CUSTOM_OBJ
= "C";
36 case SERIALIZABLE
= "S";
43 class ImportLocation
{
44 public function __construct(
45 public readonly
string $name,
46 public readonly
int $location,
51 enum System
: string {
53 case Ivm_1_0
= '$ion_1_0';
54 case IonSymbolTable
= '$ion_symbol_table';
56 case Version
= 'version';
57 case Imports
= 'imports';
58 case Symbols
= 'symbols';
59 case MaxId
= 'max_id';
60 case SharedSymbolTable
= '$ion_shared_symbol_table';
63 namespace ion\Symbol\System
;
67 case IonSymbolTable
= 3;
73 case SharedSymbolTable
= 9;
78 public function __construct(
79 public readonly ?
string $value = null,
80 public readonly
int $sid = -1,
81 public readonly ?Symbol\ImportLocation
$importLocation = null,
84 public function equals(Symbol
$symbol): bool {}
85 public function __toString() : string {}
86 /** @alias ion\Symbol::__toString */
87 public function toString() : string {}
106 public function __construct(
107 public readonly
string $value,
108 public readonly Type
$type = Type
::CLob
,
113 namespace ion\Decimal\Context
;
114 enum Rounding
: int {
125 namespace ion\Decimal
;
127 public function __construct(
128 public readonly
int $digits,
129 public readonly
int $eMax,
130 public readonly
int $eMin,
131 public readonly Context\Rounding|
int $round,
132 public readonly
bool $clamp,
135 public static function Dec32() : Context
{}
136 public static function Dec64() : Context
{}
137 public static function Dec128() : Context
{}
138 public static function DecMax(Context\Rounding|
int $round = Context\Rounding
::HalfEven
) : Context
{}
143 public function __construct(
144 public readonly
string|
int $number,
145 public readonly ?Decimal\Context
$context = null,
148 public function equals(Decimal
$decimal) : bool {}
149 public function isInt() : bool {}
151 public function __toString() : string {}
152 /** @alias ion\Decimal::__toString */
153 public function toString() : string {}
154 public function toInt() : int {}
157 namespace ion\Timestamp
;
158 enum Precision
: int {
160 case Month
= 0x1|
0x2;
161 case Day
= 0x1|
0x2|
0x4;
162 case Min
= 0x1|
0x2|
0x4|
0x10;
163 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
164 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
165 case MinTZ
= 0x1|
0x2|
0x4|
0x10|
0x80;
166 case SecTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x80;
167 case FracTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40|
0x80;
170 class Timestamp
extends \DateTime
{
171 public readonly
int $precision;
172 public readonly
string $format;
174 public function __construct(
175 Timestamp\Precision|
int $precision,
176 ?
string $format = null,
177 ?
string $datetime = null,
178 ?\DateTimeZone
$timezone = null,
181 public function __toString() : string {}
186 interface Reader
extends \RecursiveIterator
{
187 public function getType() : Type
;
188 public function hasAnnotations() : bool;
189 public function hasAnnotation(string $annotation) : bool;
190 public function isNull() : bool;
191 public function isInStruct() : bool;
192 public function getFieldName() : string;
193 public function getFieldNameSymbol() : Symbol
;
194 public function getAnnotations() : array;
195 public function getAnnotationSymbols() : array;
196 public function countAnnotations() : int;
197 public function getAnnotation(int $index) : string;
198 public function getAnnotationSymbol(int $index) : Symbol
;
200 public function readNull() : Type
;
201 public function readBool() : bool;
202 public function readInt() : int|
string;
203 public function readFloat() : float;
204 public function readDecimal() : Decimal
;
205 public function readTimestamp() : Timestamp
;
206 public function readSymbol() : Symbol
;
207 public function readString() : string;
208 /** @param ref $string */
209 public function readStringPart(&$string, int $length = 0x1000) : bool;
210 public function readLob() : string;
211 /** @param ref $string */
212 public function readLobPart(&$string, int $length = 0x1000) : bool;
214 public function getPosition() : int;
215 public function getDepth() : int;
217 public function seek(int $offset, int $length = -1) : void
;
219 public function getSymbolTable() : SymbolTable;
220 public function setSymbolTable(SymbolTable $table) : void;
222 public function getValueOffset() : int;
223 public function getValueLength() : int;
225 namespace ion\Reader
;
227 public function __construct(
228 public readonly ?\ion\Catalog
$catalog = null,
229 public readonly ?\ion\Decimal\Context
$decimalContext = null,
230 public readonly ?\Closure
$onContextChange = null,
231 public readonly
bool $returnSystemValues = false,
232 public readonly
int $newLine = 0xa,
233 public readonly
int $maxContainerDepth = 10,
234 public readonly
int $maxAnnotations = 10,
235 public readonly
int $maxAnnotationBuffered = 512,
236 public readonly
int $symbolThreshold = 4096,
237 public readonly
int $userValueThreshold = 4096,
238 public readonly
int $chunkThreshold = 4096,
239 public readonly
int $allocationPageSize = 4096,
240 public readonly
bool $skipCharacterValidation = false,
244 namespace ion\Reader
;
245 abstract class Reader
implements \ion\Reader
{
246 public readonly ?Options
$options;
248 public function hasChildren() : bool {}
249 public function getChildren() : \ion\Reader
{}
251 public function rewind() : void
{}
252 public function next() : void
{}
253 public function valid() : bool {}
254 public function key() : mixed {}
255 public function current() : mixed {}
257 public function getType() : \ion\Type
{}
258 public function hasAnnotations() : bool {}
259 public function hasAnnotation(string $annotation) : bool {}
260 public function isNull() : bool {}
261 public function isInStruct() : bool {}
262 public function getFieldName() : string {}
263 public function getFieldNameSymbol() : \ion\Symbol
{}
264 public function getAnnotations() : array {}
265 public function getAnnotationSymbols() : array {}
266 public function countAnnotations() : int {}
267 public function getAnnotation(int $index) : string {}
268 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
270 public function readNull() : \ion\Type
{}
271 public function readBool() : bool {}
272 public function readInt() : int|
string {}
273 public function readFloat() : float {}
274 public function readDecimal() : \ion\Decimal
{}
275 public function readTimestamp() : \ion\Timestamp
{}
276 public function readSymbol() : \ion\Symbol
{}
277 public function readString() : string {}
278 /** @param ref $string */
279 public function readStringPart(&$string, int $length = 0x1000) : bool {}
280 public function readLob() : string {}
281 /** @param ref $string */
282 public function readLobPart(&$string, int $length = 0x1000) : bool {}
284 public function getPosition() : int {}
285 public function getDepth() : int{}
287 public function seek(int $offset, int $length = -1) : void
{}
289 public function getSymbolTable() : SymbolTable {}
290 public function setSymbolTable(SymbolTable $table) : void {}
292 public function getValueOffset() : int {}
293 public function getValueLength() : int {}
295 namespace ion\Reader
;
296 interface Buffer
extends \ion\Reader
{
297 public function getBuffer() : string;
300 namespace ion\Reader\Buffer
;
301 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
302 public function __construct(
304 ?\ion\Reader\Options
$options = null,
307 public function getBuffer() : string {}
310 namespace ion\Reader
;
311 interface Stream
extends \ion\Reader
{
312 /** @return resource */
313 public function getStream();
314 /** @param resource $stream */
315 public function resetStream($stream) : void
;
316 /** @param resource $stream */
317 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
320 namespace ion\Reader\Stream
;
321 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
322 /** @param resource $stream */
323 public function __construct(
325 ?\ion\Reader\Options
$options = null,
328 /** @return resource */
329 public function getStream() {}
330 /** @param resource $stream */
331 public function resetStream($stream) : void
{}
332 /** @param resource $stream */
333 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
336 namespace ion\Writer
;
338 public function __construct(
339 public readonly ?\ion\Catalog
$catalog = null,
340 public readonly ?\ion\Decimal\Context
$decimalContext = null,
341 ?\ion\Collection
$encodingSymbolTable = null,
342 public readonly
bool $outputBinary = false,
343 public readonly
bool $compactFloats = false,
344 public readonly
bool $escapeNonAscii = false,
345 public readonly
bool $prettyPrint = false,
346 public readonly
bool $indentTabs = true,
347 public readonly
int $indentSize = 2,
348 public readonly
bool $smallContainersInline = true,
349 public readonly
bool $suppressSystemValues = false,
350 public readonly
bool $flushEveryValue = false,
351 public readonly
int $maxContainerDepth = 10,
352 public readonly
int $maxAnnotations = 10,
353 public readonly
int $tempBufferSize = 0x400,
354 public readonly
int $allocationPageSize = 0x1000,
357 // public function addSharedImports(\ion\Collection|\ion\Symbol\Table ...$imports) : void;
362 public function writeNull() : void
;
363 public function writeTypedNull(Type
$type) : void
;
364 public function writeBool(bool $value) : void
;
365 public function writeInt(int|
string $value) : void
;
366 public function writeFloat(float $value) : void
;
367 public function writeDecimal(Decimal|
string $value) : void
;
368 public function writeTimestamp(Timestamp|
string $value) : void
;
369 public function writeSymbol(Symbol|
string $value) : void
;
370 public function writeString(string $value) : void
;
371 public function writeCLob(string $value) : void
;
372 public function writeBLob(string $value) : void
;
374 public function startLob(Type
$type) : void
;
375 public function appendLob(string $data) : void
;
376 public function finishLob() : void
;
378 public function startContainer(Type
$type) : void
;
379 public function finishContainer() : void
;
381 public function writeFieldName(string $name) : void
;
383 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
385 public function getDepth() : int;
386 public function flush() : int;
387 public function finish() : int;
389 public function writeOne(Reader
$reader) : void
;
390 public function writeAll(Reader
$reader) : void
;
392 // public function getCatalog() : Catalog;
393 // public function setCatalog(Catalog $catalog) : void;
395 // public function getSymbolTable() : Symbol\Table;
396 // puvlic function setSymbolTable(Symbol\Table $table) : void;
399 namespace ion\Writer
;
400 abstract class Writer
implements \ion\Writer
{
401 public function writeNull() : void
{}
402 public function writeTypedNull(\ion\Type
$type) : void
{}
403 public function writeBool(bool $value) : void
{}
404 public function writeInt(int|
string $value) : void
{}
405 public function writeFloat(float $value) : void
{}
406 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
407 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
408 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
409 public function writeString(string $value) : void
{}
410 public function writeCLob(string $value) : void
{}
411 public function writeBLob(string $value) : void
{}
413 public function startLob(\ion\Type
$type) : void
{}
414 public function appendLob(string $data) : void
{}
415 public function finishLob() : void
{}
417 public function startContainer(\ion\Type
$type) : void
{}
418 public function finishContainer() : void
{}
420 public function writeFieldName(string $name) : void
{}
422 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
424 public function getDepth() : int {}
425 public function flush() : int {}
426 public function finish() : int {}
428 public function writeOne(\ion\Reader
$reader) : void
{}
429 public function writeAll(\ion\Reader
$reader) : void
{}
432 namespace ion\Writer
;
433 interface Buffer
extends \ion\Writer
{
434 public function getBuffer() : string;
437 namespace ion\Writer\Buffer
;
438 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
439 /** @param ref $buffer */
440 public function __construct(
442 ?\ion\Writer\Options
$options = null,
446 * @return string a _copy_ of $buffer passed to the constructor
448 public function getBuffer() : string {}
451 namespace ion\Writer
;
452 interface Stream
extends \ion\Writer
{
453 /** @return resource */
454 public function getStream();
457 namespace ion\Writer\Stream
;
458 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
459 /** @param resource $stream */
460 public function __construct(
462 ?\ion\Writer\Options
$options = null,
464 /** @return resource */
465 public function getStream() {}
469 interface Serializer
{
470 public function __invoke(mixed $data) : string;
471 // protected function serialize(mixed $data) : string;
474 interface Unserializer
{
475 /** @param string|resource $data */
476 public function __invoke($data) : mixed;
477 // /** @param string|resource $data */
478 // protected function unserialize($data) : mixed;
481 namespace ion\Serializer
;
482 class PHP
implements \ion\Serializer
{
483 public function __construct(
484 public readonly ?\ion\Writer\Options
$writerOptions = null,
485 public readonly
bool $multiSequence = false,
486 public readonly
bool $callMagicSerialize = true,
487 public readonly ?
string $callCustomSerialize = null,
489 public function __invoke(mixed $data) : string {}
490 protected function serialize(mixed $data) : string {}
493 namespace ion\Unserializer
;
494 class PHP
implements \ion\Unserializer
{
495 public function __construct(
496 public readonly ?\ion\Reader\Options
$readerOptions = null,
497 public readonly
bool $multiSequence = true,
498 public readonly
bool $callMagicUnserialize = true,
499 public readonly ?
string $callCustomUnserialize = null,
501 /** @param string|resource $data */
502 public function __invoke($data) : mixed {}
503 /** @param string|resource $data */
504 protected function unserialize($data) : mixed {}
508 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
509 /** @param string|resource $data */
510 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}