4 * @generate-class-entries static
5 * @generate-function-entries static
16 case Timestamp
= 0x600;
24 case Datagram
= 0xf00;
31 class ImportLocation
{
32 public function __construct(
33 public readonly
string $name,
34 public readonly
int $location,
40 public function toSymbol() : \ion\Symbol
;
41 public function toSID() : int;
42 public function toString() : string;
45 namespace ion\Symbol\Table
;
46 enum System
: string implements \ion\Symbol\Enum
{
48 case Ivm_1_0
= '$ion_1_0';
49 case IonSymbolTable
= '$ion_symbol_table';
51 case Version
= 'version';
52 case Imports
= 'imports';
53 case Symbols
= 'symbols';
54 case MaxId
= 'max_id';
55 case SharedSymbolTable
= '$ion_shared_symbol_table';
57 /** @alias ion\Symbol\Enum::toSymbol */
58 public function toSymbol() : \ion\Symbol
{}
59 /** @alias ion\Symbol\Enum::toSID */
60 public function toSID() : int {}
61 /** @alias ion\Symbol\Enum::toString */
62 public function toString() : string {}
65 namespace ion\Symbol\Table
;
66 enum PHP
: string implements \ion\Symbol\Enum
{
72 case ClassObject
= 'c';
73 case MagicObject
= 'O';
74 case CustomObject
= 'C';
76 case Serializable
= 'S';
78 /** @alias ion\Symbol\Enum::toSymbol */
79 public function toSymbol() : \ion\Symbol
{}
80 /** @alias ion\Symbol\Enum::toSID */
81 public function toSID() : int {}
82 /** @alias ion\Symbol\Enum::toString */
83 public function toString() : string {}
88 public function __construct(
89 public readonly ?
string $value = null,
90 public readonly
int $sid = -1,
91 public readonly ?Symbol\ImportLocation
$importLocation = null,
94 public function equals(Symbol
$symbol): bool {}
95 public function __toString() : string {}
96 /** @alias ion\Symbol::__toString */
97 public function toString() : string {}
100 namespace ion\Symbol
;
102 public function getMaxId() : int;
104 public function add(\ion\Symbol|
string $symbol) : int;
105 public function find(string|
int $id) : ?\ion\Symbol
;
106 public function findLocal(string|
int $id) : ?\ion\Symbol
;
109 namespace ion\Symbol\Table
;
110 function PHP() : \ion\Symbol\Table
{}
111 function System() : \ion\Symbol\Table
{}
113 namespace ion\Symbol\Table
;
114 class Local
implements \ion\Symbol\Table
{
115 private array $imports = [];
116 private array $symbols = [];
118 public function __construct() {}
119 public function import(\ion\Symbol\Table
$table) : void
{}
121 /** @alias ion\Symbol\Table::getMaxId */
122 public function getMaxId() : int {}
124 /** @alias ion\Symbol\Table::add */
125 public function add(\ion\Symbol|
string $symbol) : int {}
126 /** @alias ion\Symbol\Table::find */
127 public function find(string|
int $id) : ?\ion\Symbol
{}
128 /** @alias ion\Symbol\Table::findLocal */
129 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
132 namespace ion\Symbol\Table
;
133 class Shared
implements \ion\Symbol\Table
{
134 public function __construct(
135 public readonly
string $name,
136 public readonly
int $version = 1,
137 ?
array $symbols = null,
140 /** Internal cache */
141 private array $symbols = [];
143 /** @alias ion\Symbol\Table::getMaxId */
144 public function getMaxId() : int {}
146 /** @alias ion\Symbol\Table::add */
147 public function add(\ion\Symbol|
string $symbol) : int {}
148 /** @alias ion\Symbol\Table::find */
149 public function find(string|
int $id) : ?\ion\Symbol
{}
150 /** @alias ion\Symbol\Table::findLocal */
151 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
155 class Catalog
implements Countable
{
156 /** Internal cache */
157 private array $symbolTables = [];
159 public function __construct() {}
161 public function count() : int {}
163 public function add(Symbol\Table
$table) : void
{}
164 public function remove(Symbol\Table|
string $table) : bool {}
166 public function find(string $name, int $version = 0) : ?Symbol\Table
{}
167 public function findBest(string $name, int $version = 0) : ?Symbol\Table
{}
172 public function __construct(
173 public readonly
string $value,
174 public readonly Type
$type = Type
::CLob
,
179 namespace ion\Decimal\Context
;
180 enum Rounding
: int {
191 namespace ion\Decimal
;
193 public function __construct(
194 public readonly
int $digits,
195 public readonly
int $eMax,
196 public readonly
int $eMin,
197 public readonly Context\Rounding|
int $round,
198 public readonly
bool $clamp,
201 public static function Dec32() : Context
{}
202 public static function Dec64() : Context
{}
203 public static function Dec128() : Context
{}
204 public static function DecMax(Context\Rounding|
int $round = Context\Rounding
::HalfEven
) : Context
{}
209 public function __construct(
210 public readonly
string|
int $number,
211 public readonly ?Decimal\Context
$context = null,
214 public function equals(Decimal
$decimal) : bool {}
215 public function isInt() : bool {}
217 public function __toString() : string {}
218 /** @alias ion\Decimal::__toString */
219 public function toString() : string {}
220 public function toInt() : int {}
223 namespace ion\Timestamp
;
224 enum Precision
: int {
226 case Month
= 0x1|
0x2;
227 case Day
= 0x1|
0x2|
0x4;
228 case Min
= 0x1|
0x2|
0x4|
0x10;
229 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
230 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
231 case MinTZ
= 0x1|
0x2|
0x4|
0x10|
0x80;
232 case SecTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x80;
233 case FracTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40|
0x80;
236 class Timestamp
extends \DateTime
{
237 public readonly
int $precision;
238 public readonly
string $format;
240 public function __construct(
241 Timestamp\Precision|
int $precision,
242 ?
string $format = null,
243 ?
string $datetime = null,
244 ?\DateTimeZone
$timezone = null,
247 public function __toString() : string {}
252 interface Reader
extends \RecursiveIterator
{
253 public function getType() : Type
;
254 public function hasAnnotations() : bool;
255 public function hasAnnotation(string $annotation) : bool;
256 public function isNull() : bool;
257 public function isInStruct() : bool;
258 public function getFieldName() : string;
259 public function getFieldNameSymbol() : Symbol
;
260 public function getAnnotations() : array;
261 public function getAnnotationSymbols() : array;
262 public function countAnnotations() : int;
263 public function getAnnotation(int $index) : string;
264 public function getAnnotationSymbol(int $index) : Symbol
;
266 public function readNull() : Type
;
267 public function readBool() : bool;
268 public function readInt() : int|
string;
269 public function readFloat() : float;
270 public function readDecimal() : Decimal
;
271 public function readTimestamp() : Timestamp
;
272 public function readSymbol() : Symbol
;
273 public function readString() : string;
274 /** @param ref $string */
275 public function readStringPart(&$string, int $length = 0x1000) : bool;
276 public function readLob() : string;
277 /** @param ref $string */
278 public function readLobPart(&$string, int $length = 0x1000) : bool;
280 public function getPosition() : int;
281 public function getDepth() : int;
283 public function seek(int $offset, int $length = -1) : void
;
285 public function getSymbolTable() : SymbolTable;
286 public function setSymbolTable(SymbolTable $table) : void;
288 public function getValueOffset() : int;
289 public function getValueLength() : int;
291 namespace ion\Reader
;
293 public function __construct(
294 public readonly ?\ion\Catalog
$catalog = null,
295 public readonly ?\ion\Decimal\Context
$decimalContext = null,
296 public readonly ?\Closure
$onContextChange = null,
297 public readonly
bool $returnSystemValues = false,
298 public readonly
int $newLine = 0xa,
299 public readonly
int $maxContainerDepth = 10,
300 public readonly
int $maxAnnotations = 10,
301 public readonly
int $maxAnnotationBuffered = 512,
302 public readonly
int $symbolThreshold = 0x4000,
303 public readonly
int $userValueThreshold = 0x4000,
304 public readonly
int $chunkThreshold = 0x4000,
305 public readonly
int $allocationPageSize = 0x10000,
306 public readonly
bool $skipCharacterValidation = false,
310 namespace ion\Reader
;
311 abstract class Reader
implements \ion\Reader
{
312 public readonly ?Options
$options;
314 public function hasChildren() : bool {}
315 public function getChildren() : \ion\Reader
{}
317 public function rewind() : void
{}
318 public function next() : void
{}
319 public function valid() : bool {}
320 public function key() : mixed {}
321 public function current() : mixed {}
323 public function getType() : \ion\Type
{}
324 public function hasAnnotations() : bool {}
325 public function hasAnnotation(string $annotation) : bool {}
326 public function isNull() : bool {}
327 public function isInStruct() : bool {}
328 public function getFieldName() : string {}
329 public function getFieldNameSymbol() : \ion\Symbol
{}
330 public function getAnnotations() : array {}
331 public function getAnnotationSymbols() : array {}
332 public function countAnnotations() : int {}
333 public function getAnnotation(int $index) : string {}
334 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
336 public function readNull() : \ion\Type
{}
337 public function readBool() : bool {}
338 public function readInt() : int|
string {}
339 public function readFloat() : float {}
340 public function readDecimal() : \ion\Decimal
{}
341 public function readTimestamp() : \ion\Timestamp
{}
342 public function readSymbol() : \ion\Symbol
{}
343 public function readString() : string {}
344 /** @param ref $string */
345 public function readStringPart(&$string, int $length = 0x1000) : bool {}
346 public function readLob() : string {}
347 /** @param ref $string */
348 public function readLobPart(&$string, int $length = 0x1000) : bool {}
350 public function getPosition() : int {}
351 public function getDepth() : int{}
353 public function seek(int $offset, int $length = -1) : void
{}
355 public function getSymbolTable() : SymbolTable {}
356 public function setSymbolTable(SymbolTable $table) : void {}
358 public function getValueOffset() : int {}
359 public function getValueLength() : int {}
361 namespace ion\Reader
;
362 interface Buffer
extends \ion\Reader
{
363 public function getBuffer() : string;
366 namespace ion\Reader\Buffer
;
367 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
368 public function __construct(
370 ?\ion\Reader\Options
$options = null,
373 public function getBuffer() : string {}
376 namespace ion\Reader
;
377 interface Stream
extends \ion\Reader
{
378 /** @return resource */
379 public function getStream();
380 /** @param resource $stream */
381 public function resetStream($stream) : void
;
382 /** @param resource $stream */
383 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
386 namespace ion\Reader\Stream
;
387 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
388 /** @param resource $stream */
389 public function __construct(
391 ?\ion\Reader\Options
$options = null,
394 /** @return resource */
395 public function getStream() {}
396 /** @param resource $stream */
397 public function resetStream($stream) : void
{}
398 /** @param resource $stream */
399 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
402 namespace ion\Writer
;
404 public function __construct(
405 public readonly ?\ion\Catalog
$catalog = null,
406 public readonly ?\ion\Decimal\Context
$decimalContext = null,
407 public readonly
bool $outputBinary = false,
408 public readonly
bool $compactFloats = false,
409 public readonly
bool $escapeNonAscii = false,
410 public readonly
bool $prettyPrint = false,
411 public readonly
bool $indentTabs = true,
412 public readonly
int $indentSize = 2,
413 public readonly
bool $smallContainersInline = true,
414 public readonly
bool $suppressSystemValues = false,
415 public readonly
bool $flushEveryValue = false,
416 public readonly
int $maxContainerDepth = 10,
417 public readonly
int $maxAnnotations = 10,
418 public readonly
int $tempBufferSize = 0x4000,
419 public readonly
int $allocationPageSize = 0x10000,
425 public function writeNull() : void
;
426 public function writeTypedNull(Type
$type) : void
;
427 public function writeBool(bool $value) : void
;
428 public function writeInt(int|
string $value) : void
;
429 public function writeFloat(float $value) : void
;
430 public function writeDecimal(Decimal|
string $value) : void
;
431 public function writeTimestamp(Timestamp|
string $value) : void
;
432 public function writeSymbol(Symbol|
string $value) : void
;
433 public function writeString(string $value) : void
;
434 public function writeCLob(string $value) : void
;
435 public function writeBLob(string $value) : void
;
437 public function startLob(Type
$type) : void
;
438 public function appendLob(string $data) : void
;
439 public function finishLob() : void
;
441 public function startContainer(Type
$type) : void
;
442 public function finishContainer() : void
;
444 public function writeFieldName(string $name) : void
;
446 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
448 public function getDepth() : int;
449 public function flush() : int;
450 public function finish() : int;
452 public function writeOne(Reader
$reader) : void
;
453 public function writeAll(Reader
$reader) : void
;
455 // public function getCatalog() : Catalog;
456 // public function setCatalog(Catalog $catalog) : void;
458 // public function getSymbolTable() : Symbol\Table;
459 // puvlic function setSymbolTable(Symbol\Table $table) : void;
462 namespace ion\Writer
;
463 abstract class Writer
implements \ion\Writer
{
464 public function writeNull() : void
{}
465 public function writeTypedNull(\ion\Type
$type) : void
{}
466 public function writeBool(bool $value) : void
{}
467 public function writeInt(int|
string $value) : void
{}
468 public function writeFloat(float $value) : void
{}
469 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
470 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
471 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
472 public function writeString(string $value) : void
{}
473 public function writeCLob(string $value) : void
{}
474 public function writeBLob(string $value) : void
{}
476 public function startLob(\ion\Type
$type) : void
{}
477 public function appendLob(string $data) : void
{}
478 public function finishLob() : void
{}
480 public function startContainer(\ion\Type
$type) : void
{}
481 public function finishContainer() : void
{}
483 public function writeFieldName(string $name) : void
{}
485 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
487 public function getDepth() : int {}
488 public function flush() : int {}
489 public function finish() : int {}
491 public function writeOne(\ion\Reader
$reader) : void
{}
492 public function writeAll(\ion\Reader
$reader) : void
{}
495 namespace ion\Writer
;
496 interface Buffer
extends \ion\Writer
{
497 public function getBuffer() : string;
500 namespace ion\Writer\Buffer
;
501 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
502 /** @param ref $buffer */
503 public function __construct(
505 ?\ion\Writer\Options
$options = null,
509 * @return string a _copy_ of $buffer passed to the constructor
511 public function getBuffer() : string {}
514 namespace ion\Writer
;
515 interface Stream
extends \ion\Writer
{
516 /** @return resource */
517 public function getStream();
520 namespace ion\Writer\Stream
;
521 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
522 /** @param resource $stream */
523 public function __construct(
525 ?\ion\Writer\Options
$options = null,
527 /** @return resource */
528 public function getStream() {}
532 interface Serializer
{
533 public function serialize(mixed $data) : string;
536 interface Unserializer
{
537 /** @param string|resource $data */
538 public function unserialize($data) : mixed;
541 namespace ion\Serializer
;
542 class PHP
implements \ion\Serializer
{
543 public function __construct(
544 public readonly ?\ion\Writer\Options
$writerOptions = null,
545 public readonly
bool $multiSequence = false,
546 public readonly
bool $callMagicSerialize = true,
547 public readonly ?
string $callCustomSerialize = null,
549 public function serialize(mixed $data) : string {}
552 namespace ion\Unserializer
;
553 class PHP
implements \ion\Unserializer
{
554 public function __construct(
555 public readonly ?\ion\Reader\Options
$readerOptions = null,
556 public readonly
bool $multiSequence = false,
557 public readonly
bool $callMagicUnserialize = true,
558 public readonly ?
string $callCustomUnserialize = null,
560 /** @param string|resource $data */
561 public function unserialize($data) : mixed {}
565 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
566 /** @param string|resource $data */
567 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}