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
;
115 public function __construct(
116 public readonly
int $bits = 128
122 public function __construct(
123 public readonly
string|
int $number,
124 public readonly ?Decimal\Context
$context = null,
127 public function equals(Decimal
$decimal) : bool {}
128 public function isInt() : bool {}
130 public function __toString() : string {}
131 /** @alias ion\Decimal::__toString */
132 public function toString() : string {}
133 public function toInt() : int {}
136 namespace ion\Timestamp
;
137 enum Precision
: int {
139 case Month
= 0x1|
0x2;
140 case Day
= 0x1|
0x2|
0x4;
141 case Min
= 0x1|
0x2|
0x4|
0x10;
142 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
143 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
146 class Timestamp
extends \DateTime
{
147 public readonly
int $precision;
148 public readonly
string $format;
150 public function __construct(
151 Timestamp\Precision|
int $precision,
152 ?
string $format = null,
153 ?
string $datetime = null,
154 ?\DateTimeZone
$timezone = null,
157 public function __toString() : string {}
162 interface Reader
extends \RecursiveIterator
{
163 public function getType() : Type
;
164 public function hasAnnotations() : bool;
165 public function hasAnnotation(string $annotation) : bool;
166 public function isNull() : bool;
167 public function isInStruct() : bool;
168 public function getFieldName() : string;
169 public function getFieldNameSymbol() : Symbol
;
170 public function getAnnotations() : array;
171 public function getAnnotationSymbols() : array;
172 public function countAnnotations() : int;
173 public function getAnnotation(int $index) : string;
174 public function getAnnotationSymbol(int $index) : Symbol
;
176 public function readNull() : Type
;
177 public function readBool() : bool;
178 public function readInt() : int|
string;
179 public function readFloat() : float;
180 public function readDecimal() : Decimal
;
181 public function readTimestamp() : Timestamp
;
182 public function readSymbol() : Symbol
;
183 public function readString() : string;
184 /** @param ref $string */
185 public function readStringPart(&$string, int $length = 0x1000) : bool;
186 public function readLob() : string;
187 /** @param ref $string */
188 public function readLobPart(&$string, int $length = 0x1000) : bool;
190 public function getPosition() : int;
191 public function getDepth() : int;
193 public function seek(int $offset, int $length = -1) : void
;
195 public function getSymbolTable() : SymbolTable;
196 public function setSymbolTable(SymbolTable $table) : void;
198 public function getValueOffset() : int;
199 public function getValueLength() : int;
201 namespace ion\Reader
;
203 public function __construct(
204 public readonly ?\ion\Catalog
$catalog = null,
205 public readonly ?\ion\Decimal\Context
$decimalContext = null,
206 public readonly ?\Closure
$onContextChange = null,
207 public readonly
bool $returnSystemValues = false,
208 public readonly
int $newLine = 0xa,
209 public readonly
int $maxContainerDepth = 10,
210 public readonly
int $maxAnnotations = 10,
211 public readonly
int $maxAnnotationBuffered = 512,
212 public readonly
int $symbolThreshold = 4096,
213 public readonly
int $userValueThreshold = 4096,
214 public readonly
int $chunkThreshold = 4096,
215 public readonly
int $allocationPageSize = 4096,
216 public readonly
bool $skipCharacterValidation = false,
220 namespace ion\Reader
;
221 abstract class Reader
implements \ion\Reader
{
222 public readonly ?Options
$options;
224 public function hasChildren() : bool {}
225 public function getChildren() : \ion\Reader
{}
227 public function rewind() : void
{}
228 public function next() : void
{}
229 public function valid() : bool {}
230 public function key() : mixed {}
231 public function current() : mixed {}
233 public function getType() : \ion\Type
{}
234 public function hasAnnotations() : bool {}
235 public function hasAnnotation(string $annotation) : bool {}
236 public function isNull() : bool {}
237 public function isInStruct() : bool {}
238 public function getFieldName() : string {}
239 public function getFieldNameSymbol() : \ion\Symbol
{}
240 public function getAnnotations() : array {}
241 public function getAnnotationSymbols() : array {}
242 public function countAnnotations() : int {}
243 public function getAnnotation(int $index) : string {}
244 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
246 public function readNull() : \ion\Type
{}
247 public function readBool() : bool {}
248 public function readInt() : int|
string {}
249 public function readFloat() : float {}
250 public function readDecimal() : \ion\Decimal
{}
251 public function readTimestamp() : \ion\Timestamp
{}
252 public function readSymbol() : \ion\Symbol
{}
253 public function readString() : string {}
254 /** @param ref $string */
255 public function readStringPart(&$string, int $length = 0x1000) : bool {}
256 public function readLob() : string {}
257 /** @param ref $string */
258 public function readLobPart(&$string, int $length = 0x1000) : bool {}
260 public function getPosition() : int {}
261 public function getDepth() : int{}
263 public function seek(int $offset, int $length = -1) : void
{}
265 public function getSymbolTable() : SymbolTable {}
266 public function setSymbolTable(SymbolTable $table) : void {}
268 public function getValueOffset() : int {}
269 public function getValueLength() : int {}
271 namespace ion\Reader
;
272 interface Buffer
extends \ion\Reader
{
273 public function getBuffer() : string;
276 namespace ion\Reader\Buffer
;
277 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
278 public function __construct(
280 ?\ion\Reader\Options
$options = null,
283 public function getBuffer() : string {}
286 namespace ion\Reader
;
287 interface Stream
extends \ion\Reader
{
288 /** @return resource */
289 public function getStream();
290 /** @param resource $stream */
291 public function resetStream($stream) : void
;
292 /** @param resource $stream */
293 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
296 namespace ion\Reader\Stream
;
297 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
298 /** @param resource $stream */
299 public function __construct(
301 ?\ion\Reader\Options
$options = null,
304 /** @return resource */
305 public function getStream() {}
306 /** @param resource $stream */
307 public function resetStream($stream) : void
{}
308 /** @param resource $stream */
309 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
312 namespace ion\Writer
;
314 public function __construct(
315 public readonly ?\ion\Catalog
$catalog = null,
316 public readonly ?\ion\Decimal\Context
$decimalContext = null,
317 ?\ion\Collection
$encodingSymbolTable = null,
318 public readonly
bool $outputBinary = false,
319 public readonly
bool $compactFloats = false,
320 public readonly
bool $escapeNonAscii = false,
321 public readonly
bool $prettyPrint = false,
322 public readonly
bool $indentTabs = true,
323 public readonly
int $indentSize = 2,
324 public readonly
bool $smallContainersInline = true,
325 public readonly
bool $suppressSystemValues = false,
326 public readonly
bool $flushEveryValue = false,
327 public readonly
int $maxContainerDepth = 10,
328 public readonly
int $maxAnnotations = 10,
329 public readonly
int $tempBufferSize = 0x400,
330 public readonly
int $allocationPageSize = 0x1000,
333 // public function addSharedImports(\ion\Collection|\ion\Symbol\Table ...$imports) : void;
338 public function writeNull() : void
;
339 public function writeTypedNull(Type
$type) : void
;
340 public function writeBool(bool $value) : void
;
341 public function writeInt(int|
string $value) : void
;
342 public function writeFloat(float $value) : void
;
343 public function writeDecimal(Decimal|
string $value) : void
;
344 public function writeTimestamp(Timestamp|
string $value) : void
;
345 public function writeSymbol(Symbol|
string $value) : void
;
346 public function writeString(string $value) : void
;
347 public function writeCLob(string $value) : void
;
348 public function writeBLob(string $value) : void
;
350 public function startLob(Type
$type) : void
;
351 public function appendLob(string $data) : void
;
352 public function finishLob() : void
;
354 public function startContainer(Type
$type) : void
;
355 public function finishContainer() : void
;
357 public function writeFieldName(string $name) : void
;
359 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
361 public function getDepth() : int;
362 public function flush() : int;
363 public function finish() : int;
365 public function writeOne(Reader
$reader) : void
;
366 public function writeAll(Reader
$reader) : void
;
368 // public function getCatalog() : Catalog;
369 // public function setCatalog(Catalog $catalog) : void;
371 // public function getSymbolTable() : Symbol\Table;
372 // puvlic function setSymbolTable(Symbol\Table $table) : void;
375 namespace ion\Writer
;
376 abstract class Writer
implements \ion\Writer
{
377 public function writeNull() : void
{}
378 public function writeTypedNull(\ion\Type
$type) : void
{}
379 public function writeBool(bool $value) : void
{}
380 public function writeInt(int|
string $value) : void
{}
381 public function writeFloat(float $value) : void
{}
382 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
383 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
384 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
385 public function writeString(string $value) : void
{}
386 public function writeCLob(string $value) : void
{}
387 public function writeBLob(string $value) : void
{}
389 public function startLob(\ion\Type
$type) : void
{}
390 public function appendLob(string $data) : void
{}
391 public function finishLob() : void
{}
393 public function startContainer(\ion\Type
$type) : void
{}
394 public function finishContainer() : void
{}
396 public function writeFieldName(string $name) : void
{}
398 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
400 public function getDepth() : int {}
401 public function flush() : int {}
402 public function finish() : int {}
404 public function writeOne(\ion\Reader
$reader) : void
{}
405 public function writeAll(\ion\Reader
$reader) : void
{}
408 namespace ion\Writer
;
409 interface Buffer
extends \ion\Writer
{
410 public function getBuffer() : string;
413 namespace ion\Writer\Buffer
;
414 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
415 /** @param ref $buffer */
416 public function __construct(
418 ?\ion\Writer\Options
$options = null,
422 * @return string a _copy_ of $buffer passed to the constructor
424 public function getBuffer() : string {}
427 namespace ion\Writer
;
428 interface Stream
extends \ion\Writer
{
429 /** @return resource */
430 public function getStream();
433 namespace ion\Writer\Stream
;
434 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
435 /** @param resource $stream */
436 public function __construct(
438 ?\ion\Writer\Options
$options = null,
440 /** @return resource */
441 public function getStream() {}
445 interface Serializer
{
446 public function __invoke(mixed $data) : string;
447 // protected function serialize(mixed $data) : string;
450 interface Unserializer
{
451 /** @param string|resource $data */
452 public function __invoke($data) : mixed;
453 // /** @param string|resource $data */
454 // protected function unserialize($data) : mixed;
457 namespace ion\Serializer
;
458 class PHP
implements \ion\Serializer
{
459 public function __construct(
460 public readonly ?\ion\Writer\Options
$writerOptions = null,
461 public readonly
bool $callMagicSerialize = true,
462 public readonly ?
string $callCustomSerialize = null,
464 public function __invoke(mixed $data) : string {}
465 protected function serialize(mixed $data) : string {}
468 namespace ion\Unserializer
;
469 class PHP
implements \ion\Unserializer
{
470 public function __construct(
471 public readonly ?\ion\Reader\Options
$readerOptions = null,
472 public readonly
bool $callMagicUnserialize = true,
473 public readonly ?
string $callCustomUnserialize = null,
475 /** @param string|resource $data */
476 public function __invoke($data) : mixed {}
477 /** @param string|resource $data */
478 protected function unserialize($data) : mixed {}
482 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
483 /** @param string|resource $data */
484 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}