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 private array $symbols = [];
136 public function __construct(
137 public readonly
string $name,
138 public readonly
int $version = 1,
141 /** @alias ion\Symbol\Table::getMaxId */
142 public function getMaxId() : int {}
144 /** @alias ion\Symbol\Table::add */
145 public function add(\ion\Symbol|
string $symbol) : int {}
146 /** @alias ion\Symbol\Table::find */
147 public function find(string|
int $id) : ?\ion\Symbol
{}
148 /** @alias ion\Symbol\Table::findLocal */
149 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
153 class Catalog
implements Countable
{
154 private array $symbolTables = [];
156 public function __construct() {}
158 public function count() : int {}
160 public function add(Symbol\Table
$table) : void
{}
161 public function remove(Symbol\Table|
string $table) : bool {}
163 public function find(string $name, int $version = 0) : ?Symbol\Table
{}
164 public function findBest(string $name, int $version = 0) : ?Symbol\Table
{}
169 public function __construct(
170 public readonly
string $value,
171 public readonly Type
$type = Type
::CLob
,
176 namespace ion\Decimal\Context
;
177 enum Rounding
: int {
188 namespace ion\Decimal
;
190 public function __construct(
191 public readonly
int $digits,
192 public readonly
int $eMax,
193 public readonly
int $eMin,
194 public readonly Context\Rounding|
int $round,
195 public readonly
bool $clamp,
198 public static function Dec32() : Context
{}
199 public static function Dec64() : Context
{}
200 public static function Dec128() : Context
{}
201 public static function DecMax(Context\Rounding|
int $round = Context\Rounding
::HalfEven
) : Context
{}
206 public function __construct(
207 public readonly
string|
int $number,
208 public readonly ?Decimal\Context
$context = null,
211 public function equals(Decimal
$decimal) : bool {}
212 public function isInt() : bool {}
214 public function __toString() : string {}
215 /** @alias ion\Decimal::__toString */
216 public function toString() : string {}
217 public function toInt() : int {}
220 namespace ion\Timestamp
;
221 enum Precision
: int {
223 case Month
= 0x1|
0x2;
224 case Day
= 0x1|
0x2|
0x4;
225 case Min
= 0x1|
0x2|
0x4|
0x10;
226 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
227 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
228 case MinTZ
= 0x1|
0x2|
0x4|
0x10|
0x80;
229 case SecTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x80;
230 case FracTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40|
0x80;
233 class Timestamp
extends \DateTime
{
234 public readonly
int $precision;
235 public readonly
string $format;
237 public function __construct(
238 Timestamp\Precision|
int $precision,
239 ?
string $format = null,
240 ?
string $datetime = null,
241 ?\DateTimeZone
$timezone = null,
244 public function __toString() : string {}
249 interface Reader
extends \RecursiveIterator
{
250 public function getType() : Type
;
251 public function hasAnnotations() : bool;
252 public function hasAnnotation(string $annotation) : bool;
253 public function isNull() : bool;
254 public function isInStruct() : bool;
255 public function getFieldName() : string;
256 public function getFieldNameSymbol() : Symbol
;
257 public function getAnnotations() : array;
258 public function getAnnotationSymbols() : array;
259 public function countAnnotations() : int;
260 public function getAnnotation(int $index) : string;
261 public function getAnnotationSymbol(int $index) : Symbol
;
263 public function readNull() : Type
;
264 public function readBool() : bool;
265 public function readInt() : int|
string;
266 public function readFloat() : float;
267 public function readDecimal() : Decimal
;
268 public function readTimestamp() : Timestamp
;
269 public function readSymbol() : Symbol
;
270 public function readString() : string;
271 /** @param ref $string */
272 public function readStringPart(&$string, int $length = 0x1000) : bool;
273 public function readLob() : string;
274 /** @param ref $string */
275 public function readLobPart(&$string, int $length = 0x1000) : bool;
277 public function getPosition() : int;
278 public function getDepth() : int;
280 public function seek(int $offset, int $length = -1) : void
;
282 public function getSymbolTable() : SymbolTable;
283 public function setSymbolTable(SymbolTable $table) : void;
285 public function getValueOffset() : int;
286 public function getValueLength() : int;
288 namespace ion\Reader
;
290 public function __construct(
291 public readonly ?\ion\Catalog
$catalog = null,
292 public readonly ?\ion\Decimal\Context
$decimalContext = null,
293 public readonly ?\Closure
$onContextChange = null,
294 public readonly
bool $returnSystemValues = false,
295 public readonly
int $newLine = 0xa,
296 public readonly
int $maxContainerDepth = 10,
297 public readonly
int $maxAnnotations = 10,
298 public readonly
int $maxAnnotationBuffered = 512,
299 public readonly
int $symbolThreshold = 0x4000,
300 public readonly
int $userValueThreshold = 0x4000,
301 public readonly
int $chunkThreshold = 0x4000,
302 public readonly
int $allocationPageSize = 0x10000,
303 public readonly
bool $skipCharacterValidation = false,
307 namespace ion\Reader
;
308 abstract class Reader
implements \ion\Reader
{
309 public readonly ?Options
$options;
311 public function hasChildren() : bool {}
312 public function getChildren() : \ion\Reader
{}
314 public function rewind() : void
{}
315 public function next() : void
{}
316 public function valid() : bool {}
317 public function key() : mixed {}
318 public function current() : mixed {}
320 public function getType() : \ion\Type
{}
321 public function hasAnnotations() : bool {}
322 public function hasAnnotation(string $annotation) : bool {}
323 public function isNull() : bool {}
324 public function isInStruct() : bool {}
325 public function getFieldName() : string {}
326 public function getFieldNameSymbol() : \ion\Symbol
{}
327 public function getAnnotations() : array {}
328 public function getAnnotationSymbols() : array {}
329 public function countAnnotations() : int {}
330 public function getAnnotation(int $index) : string {}
331 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
333 public function readNull() : \ion\Type
{}
334 public function readBool() : bool {}
335 public function readInt() : int|
string {}
336 public function readFloat() : float {}
337 public function readDecimal() : \ion\Decimal
{}
338 public function readTimestamp() : \ion\Timestamp
{}
339 public function readSymbol() : \ion\Symbol
{}
340 public function readString() : string {}
341 /** @param ref $string */
342 public function readStringPart(&$string, int $length = 0x1000) : bool {}
343 public function readLob() : string {}
344 /** @param ref $string */
345 public function readLobPart(&$string, int $length = 0x1000) : bool {}
347 public function getPosition() : int {}
348 public function getDepth() : int{}
350 public function seek(int $offset, int $length = -1) : void
{}
352 public function getSymbolTable() : SymbolTable {}
353 public function setSymbolTable(SymbolTable $table) : void {}
355 public function getValueOffset() : int {}
356 public function getValueLength() : int {}
358 namespace ion\Reader
;
359 interface Buffer
extends \ion\Reader
{
360 public function getBuffer() : string;
363 namespace ion\Reader\Buffer
;
364 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
365 public function __construct(
367 ?\ion\Reader\Options
$options = null,
370 public function getBuffer() : string {}
373 namespace ion\Reader
;
374 interface Stream
extends \ion\Reader
{
375 /** @return resource */
376 public function getStream();
377 /** @param resource $stream */
378 public function resetStream($stream) : void
;
379 /** @param resource $stream */
380 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
383 namespace ion\Reader\Stream
;
384 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
385 /** @param resource $stream */
386 public function __construct(
388 ?\ion\Reader\Options
$options = null,
391 /** @return resource */
392 public function getStream() {}
393 /** @param resource $stream */
394 public function resetStream($stream) : void
{}
395 /** @param resource $stream */
396 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
399 namespace ion\Writer
;
401 public function __construct(
402 public readonly ?\ion\Catalog
$catalog = null,
403 public readonly ?\ion\Decimal\Context
$decimalContext = null,
404 ?\ion\Collection
$encodingSymbolTable = null,
405 public readonly
bool $outputBinary = false,
406 public readonly
bool $compactFloats = false,
407 public readonly
bool $escapeNonAscii = false,
408 public readonly
bool $prettyPrint = false,
409 public readonly
bool $indentTabs = true,
410 public readonly
int $indentSize = 2,
411 public readonly
bool $smallContainersInline = true,
412 public readonly
bool $suppressSystemValues = false,
413 public readonly
bool $flushEveryValue = false,
414 public readonly
int $maxContainerDepth = 10,
415 public readonly
int $maxAnnotations = 10,
416 public readonly
int $tempBufferSize = 0x4000,
417 public readonly
int $allocationPageSize = 0x10000,
423 public function writeNull() : void
;
424 public function writeTypedNull(Type
$type) : void
;
425 public function writeBool(bool $value) : void
;
426 public function writeInt(int|
string $value) : void
;
427 public function writeFloat(float $value) : void
;
428 public function writeDecimal(Decimal|
string $value) : void
;
429 public function writeTimestamp(Timestamp|
string $value) : void
;
430 public function writeSymbol(Symbol|
string $value) : void
;
431 public function writeString(string $value) : void
;
432 public function writeCLob(string $value) : void
;
433 public function writeBLob(string $value) : void
;
435 public function startLob(Type
$type) : void
;
436 public function appendLob(string $data) : void
;
437 public function finishLob() : void
;
439 public function startContainer(Type
$type) : void
;
440 public function finishContainer() : void
;
442 public function writeFieldName(string $name) : void
;
444 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
446 public function getDepth() : int;
447 public function flush() : int;
448 public function finish() : int;
450 public function writeOne(Reader
$reader) : void
;
451 public function writeAll(Reader
$reader) : void
;
453 // public function getCatalog() : Catalog;
454 // public function setCatalog(Catalog $catalog) : void;
456 // public function getSymbolTable() : Symbol\Table;
457 // puvlic function setSymbolTable(Symbol\Table $table) : void;
460 namespace ion\Writer
;
461 abstract class Writer
implements \ion\Writer
{
462 public function writeNull() : void
{}
463 public function writeTypedNull(\ion\Type
$type) : void
{}
464 public function writeBool(bool $value) : void
{}
465 public function writeInt(int|
string $value) : void
{}
466 public function writeFloat(float $value) : void
{}
467 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
468 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
469 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
470 public function writeString(string $value) : void
{}
471 public function writeCLob(string $value) : void
{}
472 public function writeBLob(string $value) : void
{}
474 public function startLob(\ion\Type
$type) : void
{}
475 public function appendLob(string $data) : void
{}
476 public function finishLob() : void
{}
478 public function startContainer(\ion\Type
$type) : void
{}
479 public function finishContainer() : void
{}
481 public function writeFieldName(string $name) : void
{}
483 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
485 public function getDepth() : int {}
486 public function flush() : int {}
487 public function finish() : int {}
489 public function writeOne(\ion\Reader
$reader) : void
{}
490 public function writeAll(\ion\Reader
$reader) : void
{}
493 namespace ion\Writer
;
494 interface Buffer
extends \ion\Writer
{
495 public function getBuffer() : string;
498 namespace ion\Writer\Buffer
;
499 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
500 /** @param ref $buffer */
501 public function __construct(
503 ?\ion\Writer\Options
$options = null,
507 * @return string a _copy_ of $buffer passed to the constructor
509 public function getBuffer() : string {}
512 namespace ion\Writer
;
513 interface Stream
extends \ion\Writer
{
514 /** @return resource */
515 public function getStream();
518 namespace ion\Writer\Stream
;
519 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
520 /** @param resource $stream */
521 public function __construct(
523 ?\ion\Writer\Options
$options = null,
525 /** @return resource */
526 public function getStream() {}
530 interface Serializer
{
531 public function __invoke(mixed $data) : string;
532 // protected function serialize(mixed $data) : string;
535 interface Unserializer
{
536 /** @param string|resource $data */
537 public function __invoke($data) : mixed;
538 // /** @param string|resource $data */
539 // protected function unserialize($data) : mixed;
542 namespace ion\Serializer
;
543 class PHP
implements \ion\Serializer
{
544 public function __construct(
545 public readonly ?\ion\Writer\Options
$writerOptions = null,
546 public readonly
bool $multiSequence = false,
547 public readonly
bool $callMagicSerialize = true,
548 public readonly ?
string $callCustomSerialize = null,
550 public function __invoke(mixed $data) : string {}
551 protected function serialize(mixed $data) : string {}
554 namespace ion\Unserializer
;
555 class PHP
implements \ion\Unserializer
{
556 public function __construct(
557 public readonly ?\ion\Reader\Options
$readerOptions = null,
558 public readonly
bool $multiSequence = true,
559 public readonly
bool $callMagicUnserialize = true,
560 public readonly ?
string $callCustomUnserialize = null,
562 /** @param string|resource $data */
563 public function __invoke($data) : mixed {}
564 /** @param string|resource $data */
565 protected function unserialize($data) : mixed {}
569 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
570 /** @param string|resource $data */
571 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}