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 /** Internal cache */
116 private array $imports = [];
117 /** Internal cache */
118 private array $symbols = [];
120 public function __construct() {}
121 public function import(\ion\Symbol\Table
$table) : void
{}
123 /** @alias ion\Symbol\Table::getMaxId */
124 public function getMaxId() : int {}
126 /** @alias ion\Symbol\Table::add */
127 public function add(\ion\Symbol|
string $symbol) : int {}
128 /** @alias ion\Symbol\Table::find */
129 public function find(string|
int $id) : ?\ion\Symbol
{}
130 /** @alias ion\Symbol\Table::findLocal */
131 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
134 namespace ion\Symbol\Table
;
135 class Shared
implements \ion\Symbol\Table
{
136 public function __construct(
137 public readonly
string $name,
138 public readonly
int $version = 1,
139 ?
array $symbols = null,
142 /** Internal cache */
143 private array $symbols = [];
145 /** @alias ion\Symbol\Table::getMaxId */
146 public function getMaxId() : int {}
148 /** @alias ion\Symbol\Table::add */
149 public function add(\ion\Symbol|
string $symbol) : int {}
150 /** @alias ion\Symbol\Table::find */
151 public function find(string|
int $id) : ?\ion\Symbol
{}
152 /** @alias ion\Symbol\Table::findLocal */
153 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
157 class Catalog
implements Countable
{
158 /** Internal cache */
159 private array $symbolTables = [];
161 public function __construct() {}
163 public function count() : int {}
165 public function add(Symbol\Table
$table) : void
{}
166 public function remove(Symbol\Table|
string $table) : bool {}
168 public function find(string $name, int $version = 0) : ?Symbol\Table
{}
169 public function findBest(string $name, int $version = 0) : ?Symbol\Table
{}
174 public function __construct(
175 public readonly
string $value,
176 public readonly Type
$type = Type
::CLob
,
181 namespace ion\Decimal\Context
;
182 enum Rounding
: int {
193 namespace ion\Decimal
;
195 public function __construct(
196 public readonly
int $digits,
197 public readonly
int $eMax,
198 public readonly
int $eMin,
199 public readonly Context\Rounding|
int $round,
200 public readonly
bool $clamp,
203 public static function Dec32() : Context
{}
204 public static function Dec64() : Context
{}
205 public static function Dec128() : Context
{}
206 public static function DecMax(Context\Rounding|
int $round = Context\Rounding
::HalfEven
) : Context
{}
211 public function __construct(
212 public readonly
string|
int $number,
213 public readonly ?Decimal\Context
$context = null,
216 public function equals(Decimal
$decimal) : bool {}
217 public function isInt() : bool {}
219 public function __toString() : string {}
220 /** @alias ion\Decimal::__toString */
221 public function toString() : string {}
222 public function toInt() : int {}
225 namespace ion\Timestamp
;
226 enum Precision
: int {
228 case Month
= 0x1|
0x2;
229 case Day
= 0x1|
0x2|
0x4;
230 case Min
= 0x1|
0x2|
0x4|
0x10;
231 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
232 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
233 case MinTZ
= 0x1|
0x2|
0x4|
0x10|
0x80;
234 case SecTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x80;
235 case FracTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40|
0x80;
238 namespace ion\Timestamp
;
239 enum Format
: string {
241 case Month
= "Y-m\T";
242 case Day
= "Y-m-d\T";
243 case Min
= "Y-m-d\TH:i";
244 case Sec
= "Y-m-d\TH:i:s";
245 case Frac
= "Y-m-d\TH:i:s.v";
246 case MinTZ
= "Y-m-d\TH:iP";
247 case SecTZ
= "Y-m-d\TH:i:sP";
248 case FracTZ
= "Y-m-d\TH:i:s.vP";
251 class Timestamp
extends \DateTime
{
252 public readonly
int $precision;
253 public readonly
string $format;
255 public function __construct(
256 Timestamp\Precision|
int $precision,
257 Timestamp\Format|
string|
null $format = null,
258 ?
string $datetime = null,
259 ?\DateTimeZone
$timezone = null,
262 public function __toString() : string {}
267 interface Reader
extends \RecursiveIterator
{
268 public function getType() : Type
;
269 public function hasAnnotations() : bool;
270 public function hasAnnotation(string $annotation) : bool;
271 public function isNull() : bool;
272 public function isInStruct() : bool;
273 public function getFieldName() : string;
274 public function getFieldNameSymbol() : Symbol
;
275 public function getAnnotations() : array;
276 public function getAnnotationSymbols() : array;
277 public function countAnnotations() : int;
278 public function getAnnotation(int $index) : string;
279 public function getAnnotationSymbol(int $index) : Symbol
;
281 public function readNull() : Type
;
282 public function readBool() : bool;
283 public function readInt() : int|
string;
284 public function readFloat() : float;
285 public function readDecimal() : Decimal
;
286 public function readTimestamp() : Timestamp
;
287 public function readSymbol() : Symbol
;
288 public function readString() : string;
289 /** @param ref $string */
290 public function readStringPart(&$string, int $length = 0x1000) : bool;
291 public function readLob() : string;
292 /** @param ref $string */
293 public function readLobPart(&$string, int $length = 0x1000) : bool;
295 public function getPosition() : int;
296 public function getDepth() : int;
298 public function seek(int $offset, int $length = -1) : void
;
300 public function getSymbolTable() : SymbolTable;
301 public function setSymbolTable(SymbolTable $table) : void;
303 public function getValueOffset() : int;
304 public function getValueLength() : int;
307 namespace ion\Reader
;
309 public function __construct(
310 public readonly ?\ion\Catalog
$catalog = null,
311 public readonly ?\ion\Decimal\Context
$decimalContext = null,
312 public readonly ?\Closure
$onContextChange = null,
313 public readonly
bool $returnSystemValues = false,
314 public readonly
int $newLine = 0xa,
315 public readonly
int $maxContainerDepth = 10,
316 public readonly
int $maxAnnotations = 10,
317 public readonly
int $maxAnnotationBuffered = 512,
318 public readonly
int $symbolThreshold = 0x4000,
319 public readonly
int $userValueThreshold = 0x4000,
320 public readonly
int $chunkThreshold = 0x4000,
321 public readonly
int $allocationPageSize = 0x10000,
322 public readonly
bool $skipCharacterValidation = false,
326 namespace ion\Reader
;
327 abstract class Reader
implements \ion\Reader
{
328 public readonly ?Options
$options;
330 public function hasChildren() : bool {}
331 public function getChildren() : \ion\Reader
{}
333 public function rewind() : void
{}
334 public function next() : void
{}
335 public function valid() : bool {}
336 public function key() : mixed {}
337 public function current() : mixed {}
339 public function getType() : \ion\Type
{}
340 public function hasAnnotations() : bool {}
341 public function hasAnnotation(string $annotation) : bool {}
342 public function isNull() : bool {}
343 public function isInStruct() : bool {}
344 public function getFieldName() : string {}
345 public function getFieldNameSymbol() : \ion\Symbol
{}
346 public function getAnnotations() : array {}
347 public function getAnnotationSymbols() : array {}
348 public function countAnnotations() : int {}
349 public function getAnnotation(int $index) : string {}
350 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
352 public function readNull() : \ion\Type
{}
353 public function readBool() : bool {}
354 public function readInt() : int|
string {}
355 public function readFloat() : float {}
356 public function readDecimal() : \ion\Decimal
{}
357 public function readTimestamp() : \ion\Timestamp
{}
358 public function readSymbol() : \ion\Symbol
{}
359 public function readString() : string {}
360 /** @param ref $string */
361 public function readStringPart(&$string, int $length = 0x1000) : bool {}
362 public function readLob() : string {}
363 /** @param ref $string */
364 public function readLobPart(&$string, int $length = 0x1000) : bool {}
366 public function getPosition() : int {}
367 public function getDepth() : int{}
369 public function seek(int $offset, int $length = -1) : void
{}
371 public function getSymbolTable() : SymbolTable {}
372 public function setSymbolTable(SymbolTable $table) : void {}
374 public function getValueOffset() : int {}
375 public function getValueLength() : int {}
377 namespace ion\Reader
;
378 interface Buffer
extends \ion\Reader
{
379 public function getBuffer() : string;
382 namespace ion\Reader\Buffer
;
383 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
384 public function __construct(
386 ?\ion\Reader\Options
$options = null,
389 public function getBuffer() : string {}
392 namespace ion\Reader
;
393 interface Stream
extends \ion\Reader
{
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 $length) : void
;
402 namespace ion\Reader\Stream
;
403 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
404 /** @param resource $stream */
405 public function __construct(
407 ?\ion\Reader\Options
$options = null,
410 /** @return resource */
411 public function getStream() {}
412 /** @param resource $stream */
413 public function resetStream($stream) : void
{}
414 /** @param resource $stream */
415 public function resetStreamWithLength($stream, int $length) : void
{}
418 namespace ion\Writer
;
420 public function __construct(
421 public readonly ?\ion\Catalog
$catalog = null,
422 public readonly ?\ion\Decimal\Context
$decimalContext = null,
423 public readonly
bool $outputBinary = false,
424 public readonly
bool $compactFloats = false,
425 public readonly
bool $escapeNonAscii = false,
426 public readonly
bool $prettyPrint = false,
427 public readonly
bool $indentTabs = true,
428 public readonly
int $indentSize = 2,
429 public readonly
bool $smallContainersInline = true,
430 public readonly
bool $suppressSystemValues = false,
431 public readonly
bool $flushEveryValue = false,
432 public readonly
int $maxContainerDepth = 10,
433 public readonly
int $maxAnnotations = 10,
434 public readonly
int $tempBufferSize = 0x4000,
435 public readonly
int $allocationPageSize = 0x10000,
441 public function writeNull() : void
;
442 public function writeTypedNull(Type
$type) : void
;
443 public function writeBool(bool $value) : void
;
444 public function writeInt(int|
string $value) : void
;
445 public function writeFloat(float $value) : void
;
446 public function writeDecimal(Decimal|
string $value) : void
;
447 public function writeTimestamp(Timestamp|
string $value) : void
;
448 public function writeSymbol(Symbol|
string $value) : void
;
449 public function writeString(string $value) : void
;
450 public function writeCLob(string $value) : void
;
451 public function writeBLob(string $value) : void
;
453 public function startLob(Type
$type) : void
;
454 public function appendLob(string $data) : void
;
455 public function finishLob() : void
;
457 public function startContainer(Type
$type) : void
;
458 public function finishContainer() : void
;
460 public function writeFieldName(string $name) : void
;
462 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
464 public function getDepth() : int;
465 public function flush() : int;
466 public function finish() : int;
468 public function writeOne(Reader
$reader) : void
;
469 public function writeAll(Reader
$reader) : void
;
471 // public function getCatalog() : Catalog;
472 // public function setCatalog(Catalog $catalog) : void;
474 // public function getSymbolTable() : Symbol\Table;
475 // puvlic function setSymbolTable(Symbol\Table $table) : void;
478 namespace ion\Writer
;
479 abstract class Writer
implements \ion\Writer
{
480 public function writeNull() : void
{}
481 public function writeTypedNull(\ion\Type
$type) : void
{}
482 public function writeBool(bool $value) : void
{}
483 public function writeInt(int|
string $value) : void
{}
484 public function writeFloat(float $value) : void
{}
485 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
486 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
487 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
488 public function writeString(string $value) : void
{}
489 public function writeCLob(string $value) : void
{}
490 public function writeBLob(string $value) : void
{}
492 public function startLob(\ion\Type
$type) : void
{}
493 public function appendLob(string $data) : void
{}
494 public function finishLob() : void
{}
496 public function startContainer(\ion\Type
$type) : void
{}
497 public function finishContainer() : void
{}
499 public function writeFieldName(string $name) : void
{}
501 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
503 public function getDepth() : int {}
504 public function flush() : int {}
505 public function finish() : int {}
507 public function writeOne(\ion\Reader
$reader) : void
{}
508 public function writeAll(\ion\Reader
$reader) : void
{}
511 namespace ion\Writer
;
512 interface Buffer
extends \ion\Writer
{
513 public function getBuffer() : string;
514 public function resetBuffer() : void
;
517 namespace ion\Writer\Buffer
;
518 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
519 public function __construct(
520 ?\ion\Writer\Options
$options = null,
523 public function getBuffer() : string {}
524 public function resetBuffer() : void
{}
527 namespace ion\Writer
;
528 interface Stream
extends \ion\Writer
{
529 /** @return resource */
530 public function getStream();
533 namespace ion\Writer\Stream
;
534 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
535 /** @param resource $stream */
536 public function __construct(
538 ?\ion\Writer\Options
$options = null,
540 /** @return resource */
541 public function getStream() {}
545 interface Serializer
{
546 public function serialize(mixed $data) : string;
549 interface Unserializer
{
550 /** @param string|resource $data */
551 public function unserialize($data) : mixed;
554 namespace ion\Serializer
;
555 class PHP
implements \ion\Serializer
{
556 public function __construct(
557 public readonly ?\ion\Writer\Options
$writerOptions = null,
558 public readonly
bool $multiSequence = false,
559 public readonly
bool $callMagicSerialize = true,
560 public readonly ?
string $callCustomSerialize = null,
562 public function serialize(mixed $data) : string {}
565 namespace ion\Unserializer
;
566 class PHP
implements \ion\Unserializer
{
567 public function __construct(
568 public readonly ?\ion\Reader\Options
$readerOptions = null,
569 public readonly
bool $multiSequence = false,
570 public readonly
bool $callMagicUnserialize = true,
571 public readonly ?
string $callCustomUnserialize = null,
573 /** @param string|resource $data */
574 public function unserialize($data) : mixed {}
578 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
579 /** @param string|resource $data */
580 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}