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;
167 class Timestamp
extends \DateTime
{
168 public readonly
int $precision;
169 public readonly
string $format;
171 public function __construct(
172 Timestamp\Precision|
int $precision,
173 ?
string $format = null,
174 ?
string $datetime = null,
175 ?\DateTimeZone
$timezone = null,
178 public function __toString() : string {}
183 interface Reader
extends \RecursiveIterator
{
184 public function getType() : Type
;
185 public function hasAnnotations() : bool;
186 public function hasAnnotation(string $annotation) : bool;
187 public function isNull() : bool;
188 public function isInStruct() : bool;
189 public function getFieldName() : string;
190 public function getFieldNameSymbol() : Symbol
;
191 public function getAnnotations() : array;
192 public function getAnnotationSymbols() : array;
193 public function countAnnotations() : int;
194 public function getAnnotation(int $index) : string;
195 public function getAnnotationSymbol(int $index) : Symbol
;
197 public function readNull() : Type
;
198 public function readBool() : bool;
199 public function readInt() : int|
string;
200 public function readFloat() : float;
201 public function readDecimal() : Decimal
;
202 public function readTimestamp() : Timestamp
;
203 public function readSymbol() : Symbol
;
204 public function readString() : string;
205 /** @param ref $string */
206 public function readStringPart(&$string, int $length = 0x1000) : bool;
207 public function readLob() : string;
208 /** @param ref $string */
209 public function readLobPart(&$string, int $length = 0x1000) : bool;
211 public function getPosition() : int;
212 public function getDepth() : int;
214 public function seek(int $offset, int $length = -1) : void
;
216 public function getSymbolTable() : SymbolTable;
217 public function setSymbolTable(SymbolTable $table) : void;
219 public function getValueOffset() : int;
220 public function getValueLength() : int;
222 namespace ion\Reader
;
224 public function __construct(
225 public readonly ?\ion\Catalog
$catalog = null,
226 public readonly ?\ion\Decimal\Context
$decimalContext = null,
227 public readonly ?\Closure
$onContextChange = null,
228 public readonly
bool $returnSystemValues = false,
229 public readonly
int $newLine = 0xa,
230 public readonly
int $maxContainerDepth = 10,
231 public readonly
int $maxAnnotations = 10,
232 public readonly
int $maxAnnotationBuffered = 512,
233 public readonly
int $symbolThreshold = 4096,
234 public readonly
int $userValueThreshold = 4096,
235 public readonly
int $chunkThreshold = 4096,
236 public readonly
int $allocationPageSize = 4096,
237 public readonly
bool $skipCharacterValidation = false,
241 namespace ion\Reader
;
242 abstract class Reader
implements \ion\Reader
{
243 public readonly ?Options
$options;
245 public function hasChildren() : bool {}
246 public function getChildren() : \ion\Reader
{}
248 public function rewind() : void
{}
249 public function next() : void
{}
250 public function valid() : bool {}
251 public function key() : mixed {}
252 public function current() : mixed {}
254 public function getType() : \ion\Type
{}
255 public function hasAnnotations() : bool {}
256 public function hasAnnotation(string $annotation) : bool {}
257 public function isNull() : bool {}
258 public function isInStruct() : bool {}
259 public function getFieldName() : string {}
260 public function getFieldNameSymbol() : \ion\Symbol
{}
261 public function getAnnotations() : array {}
262 public function getAnnotationSymbols() : array {}
263 public function countAnnotations() : int {}
264 public function getAnnotation(int $index) : string {}
265 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
267 public function readNull() : \ion\Type
{}
268 public function readBool() : bool {}
269 public function readInt() : int|
string {}
270 public function readFloat() : float {}
271 public function readDecimal() : \ion\Decimal
{}
272 public function readTimestamp() : \ion\Timestamp
{}
273 public function readSymbol() : \ion\Symbol
{}
274 public function readString() : string {}
275 /** @param ref $string */
276 public function readStringPart(&$string, int $length = 0x1000) : bool {}
277 public function readLob() : string {}
278 /** @param ref $string */
279 public function readLobPart(&$string, int $length = 0x1000) : bool {}
281 public function getPosition() : int {}
282 public function getDepth() : int{}
284 public function seek(int $offset, int $length = -1) : void
{}
286 public function getSymbolTable() : SymbolTable {}
287 public function setSymbolTable(SymbolTable $table) : void {}
289 public function getValueOffset() : int {}
290 public function getValueLength() : int {}
292 namespace ion\Reader
;
293 interface Buffer
extends \ion\Reader
{
294 public function getBuffer() : string;
297 namespace ion\Reader\Buffer
;
298 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
299 public function __construct(
301 ?\ion\Reader\Options
$options = null,
304 public function getBuffer() : string {}
307 namespace ion\Reader
;
308 interface Stream
extends \ion\Reader
{
309 /** @return resource */
310 public function getStream();
311 /** @param resource $stream */
312 public function resetStream($stream) : void
;
313 /** @param resource $stream */
314 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
317 namespace ion\Reader\Stream
;
318 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
319 /** @param resource $stream */
320 public function __construct(
322 ?\ion\Reader\Options
$options = null,
325 /** @return resource */
326 public function getStream() {}
327 /** @param resource $stream */
328 public function resetStream($stream) : void
{}
329 /** @param resource $stream */
330 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
333 namespace ion\Writer
;
335 public function __construct(
336 public readonly ?\ion\Catalog
$catalog = null,
337 public readonly ?\ion\Decimal\Context
$decimalContext = null,
338 ?\ion\Collection
$encodingSymbolTable = null,
339 public readonly
bool $outputBinary = false,
340 public readonly
bool $compactFloats = false,
341 public readonly
bool $escapeNonAscii = false,
342 public readonly
bool $prettyPrint = false,
343 public readonly
bool $indentTabs = true,
344 public readonly
int $indentSize = 2,
345 public readonly
bool $smallContainersInline = true,
346 public readonly
bool $suppressSystemValues = false,
347 public readonly
bool $flushEveryValue = false,
348 public readonly
int $maxContainerDepth = 10,
349 public readonly
int $maxAnnotations = 10,
350 public readonly
int $tempBufferSize = 0x400,
351 public readonly
int $allocationPageSize = 0x1000,
354 // public function addSharedImports(\ion\Collection|\ion\Symbol\Table ...$imports) : void;
359 public function writeNull() : void
;
360 public function writeTypedNull(Type
$type) : void
;
361 public function writeBool(bool $value) : void
;
362 public function writeInt(int|
string $value) : void
;
363 public function writeFloat(float $value) : void
;
364 public function writeDecimal(Decimal|
string $value) : void
;
365 public function writeTimestamp(Timestamp|
string $value) : void
;
366 public function writeSymbol(Symbol|
string $value) : void
;
367 public function writeString(string $value) : void
;
368 public function writeCLob(string $value) : void
;
369 public function writeBLob(string $value) : void
;
371 public function startLob(Type
$type) : void
;
372 public function appendLob(string $data) : void
;
373 public function finishLob() : void
;
375 public function startContainer(Type
$type) : void
;
376 public function finishContainer() : void
;
378 public function writeFieldName(string $name) : void
;
380 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
382 public function getDepth() : int;
383 public function flush() : int;
384 public function finish() : int;
386 public function writeOne(Reader
$reader) : void
;
387 public function writeAll(Reader
$reader) : void
;
389 // public function getCatalog() : Catalog;
390 // public function setCatalog(Catalog $catalog) : void;
392 // public function getSymbolTable() : Symbol\Table;
393 // puvlic function setSymbolTable(Symbol\Table $table) : void;
396 namespace ion\Writer
;
397 abstract class Writer
implements \ion\Writer
{
398 public function writeNull() : void
{}
399 public function writeTypedNull(\ion\Type
$type) : void
{}
400 public function writeBool(bool $value) : void
{}
401 public function writeInt(int|
string $value) : void
{}
402 public function writeFloat(float $value) : void
{}
403 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
404 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
405 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
406 public function writeString(string $value) : void
{}
407 public function writeCLob(string $value) : void
{}
408 public function writeBLob(string $value) : void
{}
410 public function startLob(\ion\Type
$type) : void
{}
411 public function appendLob(string $data) : void
{}
412 public function finishLob() : void
{}
414 public function startContainer(\ion\Type
$type) : void
{}
415 public function finishContainer() : void
{}
417 public function writeFieldName(string $name) : void
{}
419 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
421 public function getDepth() : int {}
422 public function flush() : int {}
423 public function finish() : int {}
425 public function writeOne(\ion\Reader
$reader) : void
{}
426 public function writeAll(\ion\Reader
$reader) : void
{}
429 namespace ion\Writer
;
430 interface Buffer
extends \ion\Writer
{
431 public function getBuffer() : string;
434 namespace ion\Writer\Buffer
;
435 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
436 /** @param ref $buffer */
437 public function __construct(
439 ?\ion\Writer\Options
$options = null,
443 * @return string a _copy_ of $buffer passed to the constructor
445 public function getBuffer() : string {}
448 namespace ion\Writer
;
449 interface Stream
extends \ion\Writer
{
450 /** @return resource */
451 public function getStream();
454 namespace ion\Writer\Stream
;
455 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
456 /** @param resource $stream */
457 public function __construct(
459 ?\ion\Writer\Options
$options = null,
461 /** @return resource */
462 public function getStream() {}
466 interface Serializer
{
467 public function __invoke(mixed $data) : string;
468 // protected function serialize(mixed $data) : string;
471 interface Unserializer
{
472 /** @param string|resource $data */
473 public function __invoke($data) : mixed;
474 // /** @param string|resource $data */
475 // protected function unserialize($data) : mixed;
478 namespace ion\Serializer
;
479 class PHP
implements \ion\Serializer
{
480 public function __construct(
481 public readonly ?\ion\Writer\Options
$writerOptions = null,
482 public readonly
bool $multiSequence = false,
483 public readonly
bool $callMagicSerialize = true,
484 public readonly ?
string $callCustomSerialize = null,
486 public function __invoke(mixed $data) : string {}
487 protected function serialize(mixed $data) : string {}
490 namespace ion\Unserializer
;
491 class PHP
implements \ion\Unserializer
{
492 public function __construct(
493 public readonly ?\ion\Reader\Options
$readerOptions = null,
494 public readonly
bool $multiSequence = true,
495 public readonly
bool $callMagicUnserialize = true,
496 public readonly ?
string $callCustomUnserialize = null,
498 /** @param string|resource $data */
499 public function __invoke($data) : mixed {}
500 /** @param string|resource $data */
501 protected function unserialize($data) : mixed {}
505 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
506 /** @param string|resource $data */
507 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}