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";
39 case FIELD_NAME_INT
= "i";
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,
80 public readonly
int $sid = -1,
81 public readonly ?Symbol\ImportLocation
$importLocation = null,
84 public function equals(Symbol
$symbol): bool { }
102 namespace ion\Decimal
;
104 public function __construct(
105 public readonly
int $bits = 128
111 public function __construct(
112 public readonly
string|
int $number,
113 public readonly ?Decimal\Context
$context = null,
116 public function equals(Decimal
$decimal) : bool {}
117 public function isInt() : bool {}
119 public function __toString() : string {}
120 /** @alias ion\Decimal::__toString */
121 public function toString() : string {}
122 public function toInt() : int {}
125 namespace ion\Timestamp
;
126 enum Precision
: int {
128 case Month
= 0x1|
0x2;
129 case Day
= 0x1|
0x2|
0x4;
130 case Min
= 0x1|
0x2|
0x4|
0x10;
131 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
132 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
135 class Timestamp
extends \DateTime
{
136 public readonly
int $precision;
137 public readonly
string $format;
139 public function __construct(
140 Timestamp\Precision|
int $precision,
141 ?
string $format = null,
142 ?
string $datetime = null,
143 ?\DateTimeZone
$timezone = null,
146 public function __toString() : string {}
151 interface Reader
extends \RecursiveIterator
{
152 public function getType() : Type
;
153 public function hasAnnotations() : bool;
154 public function hasAnnotation(string $annotation) : bool;
155 public function isNull() : bool;
156 public function isInStruct() : bool;
157 public function getFieldName() : string;
158 public function getFieldNameSymbol() : Symbol
;
159 public function getAnnotations() : array;
160 public function getAnnotationSymbols() : array;
161 public function countAnnotations() : int;
162 public function getAnnotation(int $index) : string;
163 public function getAnnotationSymbol(int $index) : Symbol
;
165 public function readNull() : Type
;
166 public function readBool() : bool;
167 public function readInt() : int|
string;
168 public function readFloat() : float;
169 public function readDecimal() : Decimal
;
170 public function readTimestamp() : Timestamp
;
171 public function readSymbol() : Symbol
;
172 public function readString() : string;
173 /** @param ref $string */
174 public function readStringPart(&$string, int $length = 0x1000) : bool;
175 public function readLob() : string;
176 /** @param ref $string */
177 public function readLobPart(&$string, int $length = 0x1000) : bool;
179 public function getPosition() : int;
180 public function getDepth() : int;
182 public function seek(int $offset, int $length = -1) : void
;
184 public function getSymbolTable() : SymbolTable;
185 public function setSymbolTable(SymbolTable $table) : void;
187 public function getValueOffset() : int;
188 public function getValueLength() : int;
190 namespace ion\Reader
;
192 public function __construct(
193 public readonly ?\ion\Catalog
$catalog = null,
194 public readonly ?\ion\Decimal\Context
$decimalContext = null,
195 public readonly ?\Closure
$onContextChange = null,
196 public readonly
bool $returnSystemValues = false,
197 public readonly
int $newLine = 0xa,
198 public readonly
int $maxContainerDepth = 10,
199 public readonly
int $maxAnnotations = 10,
200 public readonly
int $maxAnnotationBuffered = 512,
201 public readonly
int $symbolThreshold = 4096,
202 public readonly
int $userValueThreshold = 4096,
203 public readonly
int $chunkThreshold = 4096,
204 public readonly
int $allocationPageSize = 4096,
205 public readonly
bool $skipCharacterValidation = false,
209 namespace ion\Reader
;
210 abstract class Reader
implements \ion\Reader
{
211 public readonly ?Options
$options;
213 public function hasChildren() : bool {}
214 public function getChildren() : \ion\Reader
{}
216 public function rewind() : void
{}
217 public function next() : void
{}
218 public function valid() : bool {}
219 public function key() : mixed {}
220 public function current() : mixed {}
222 public function getType() : \ion\Type
{}
223 public function hasAnnotations() : bool {}
224 public function hasAnnotation(string $annotation) : bool {}
225 public function isNull() : bool {}
226 public function isInStruct() : bool {}
227 public function getFieldName() : string {}
228 public function getFieldNameSymbol() : \ion\Symbol
{}
229 public function getAnnotations() : array {}
230 public function getAnnotationSymbols() : array {}
231 public function countAnnotations() : int {}
232 public function getAnnotation(int $index) : string {}
233 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
235 public function readNull() : \ion\Type
{}
236 public function readBool() : bool {}
237 public function readInt() : int|
string {}
238 public function readFloat() : float {}
239 public function readDecimal() : \ion\Decimal
{}
240 public function readTimestamp() : \ion\Timestamp
{}
241 public function readSymbol() : \ion\Symbol
{}
242 public function readString() : string {}
243 /** @param ref $string */
244 public function readStringPart(&$string, int $length = 0x1000) : bool {}
245 public function readLob() : string {}
246 /** @param ref $string */
247 public function readLobPart(&$string, int $length = 0x1000) : bool {}
249 public function getPosition() : int {}
250 public function getDepth() : int{}
252 public function seek(int $offset, int $length = -1) : void
{}
254 public function getSymbolTable() : SymbolTable {}
255 public function setSymbolTable(SymbolTable $table) : void {}
257 public function getValueOffset() : int {}
258 public function getValueLength() : int {}
260 namespace ion\Reader
;
261 interface Buffer
extends \ion\Reader
{
262 public function getBuffer() : string;
265 namespace ion\Reader\Buffer
;
266 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
267 public function __construct(
269 ?\ion\Reader\Options
$options = null,
272 public function getBuffer() : string {}
275 namespace ion\Reader
;
276 interface Stream
extends \ion\Reader
{
277 /** @return resource */
278 public function getStream();
279 /** @param resource $stream */
280 public function resetStream($stream) : void
;
281 /** @param resource $stream */
282 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
285 namespace ion\Reader\Stream
;
286 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
287 /** @param resource $stream */
288 public function __construct(
290 ?\ion\Reader\Options
$options = null,
293 /** @return resource */
294 public function getStream() {}
295 /** @param resource $stream */
296 public function resetStream($stream) : void
{}
297 /** @param resource $stream */
298 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
301 namespace ion\Writer
;
303 public function __construct(
304 public readonly ?\ion\Catalog
$catalog = null,
305 public readonly ?\ion\Decimal\Context
$decimalContext = null,
306 ?\ion\Collection
$encodingSymbolTable = null,
307 public readonly
bool $outputBinary = false,
308 public readonly
bool $compactFloats = false,
309 public readonly
bool $escapeNonAscii = false,
310 public readonly
bool $prettyPrint = false,
311 public readonly
bool $indentTabs = true,
312 public readonly
int $indentSize = 2,
313 public readonly
bool $smallContainersInline = true,
314 public readonly
bool $suppressSystemValues = false,
315 public readonly
bool $flushEveryValue = false,
316 public readonly
int $maxContainerDepth = 10,
317 public readonly
int $maxAnnotations = 10,
318 public readonly
int $tempBufferSize = 0x400,
319 public readonly
int $allocationPageSize = 0x1000,
322 // public function addSharedImports(\ion\Collection|\ion\Symbol\Table ...$imports) : void;
327 public function writeNull() : void
;
328 public function writeTypedNull(Type
$type) : void
;
329 public function writeBool(bool $value) : void
;
330 public function writeInt(int|
string $value) : void
;
331 public function writeFloat(float $value) : void
;
332 public function writeDecimal(Decimal|
string $value) : void
;
333 public function writeTimestamp(Timestamp|
string $value) : void
;
334 public function writeSymbol(Symbol|
string $value) : void
;
335 public function writeString(string $value) : void
;
336 public function writeCLob(string $value) : void
;
337 public function writeBLob(string $value) : void
;
339 public function startLob(Type
$type) : void
;
340 public function appendLob(string $data) : void
;
341 public function finishLob() : void
;
343 public function startContainer(Type
$type) : void
;
344 public function finishContainer() : void
;
346 public function writeFieldName(string $name) : void
;
348 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
350 public function getDepth() : int;
351 public function flush() : int;
352 public function finish() : int;
354 public function writeOne(Reader
$reader) : void
;
355 public function writeAll(Reader
$reader) : void
;
357 // public function getCatalog() : Catalog;
358 // public function setCatalog(Catalog $catalog) : void;
360 // public function getSymbolTable() : Symbol\Table;
361 // puvlic function setSymbolTable(Symbol\Table $table) : void;
364 namespace ion\Writer
;
365 abstract class Writer
implements \ion\Writer
{
366 public function writeNull() : void
{}
367 public function writeTypedNull(\ion\Type
$type) : void
{}
368 public function writeBool(bool $value) : void
{}
369 public function writeInt(int|
string $value) : void
{}
370 public function writeFloat(float $value) : void
{}
371 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
372 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
373 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
374 public function writeString(string $value) : void
{}
375 public function writeCLob(string $value) : void
{}
376 public function writeBLob(string $value) : void
{}
378 public function startLob(\ion\Type
$type) : void
{}
379 public function appendLob(string $data) : void
{}
380 public function finishLob() : void
{}
382 public function startContainer(\ion\Type
$type) : void
{}
383 public function finishContainer() : void
{}
385 public function writeFieldName(string $name) : void
{}
387 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
389 public function getDepth() : int {}
390 public function flush() : int {}
391 public function finish() : int {}
393 public function writeOne(\ion\Reader
$reader) : void
{}
394 public function writeAll(\ion\Reader
$reader) : void
{}
397 namespace ion\Writer
;
398 interface Buffer
extends \ion\Writer
{
399 public function getBuffer() : string;
402 namespace ion\Writer\Buffer
;
403 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
404 /** @param ref $buffer */
405 public function __construct(
407 ?\ion\Writer\Options
$options = null,
411 * @return string a _copy_ of $buffer passed to the constructor
413 public function getBuffer() : string {}
416 namespace ion\Writer
;
417 interface Stream
extends \ion\Writer
{
418 /** @return resource */
419 public function getStream();
422 namespace ion\Writer\Stream
;
423 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
424 /** @param resource $stream */
425 public function __construct(
427 ?\ion\Writer\Options
$options = null,
429 /** @return resource */
430 public function getStream() {}
435 public function __construct(
436 public readonly \ion\Writer
$writer,
437 public readonly
bool $callMagicSerialize = true,
438 public readonly ?
string $callCustomSerialize = null,
440 public function __invoke(mixed $data) : void
{}
441 protected function serialize(mixed $data) : void
{}
446 public function __construct(
447 public readonly \ion\Reader
$reader,
448 public readonly
bool $callMagicUnserialize = true,
449 public readonly ?
string $callCustomUnserialize = null,
451 public function __invoke() : mixed {}
452 protected function unserialize() : mixed {}
456 function serialize(mixed $data, Writer\Options
$options = null) : string {}
457 function unserialize(mixed $serialized, Reader\Options
$options = null) : mixed {}