3 /** @generate-class-entries */
12 case Timestamp
= 0x600;
20 case Datagram
= 0xf00;
26 enum Annotation
: string {
34 case CUSTOM_OBJ
= "C";
35 case SERIALIZABLE
= "S";
38 case FIELD_NAME_INT
= "i";
42 class ImportLocation
{
43 public function __construct(
44 public readonly
string $name,
45 public readonly
int $location,
50 enum System
: string {
52 case Ivm_1_0
= '$ion_1_0';
53 case IonSymbolTable
= '$ion_symbol_table';
55 case Version
= 'version';
56 case Imports
= 'imports';
57 case Symbols
= 'symbols';
58 case MaxId
= 'max_id';
59 case SharedSymbolTable
= '$ion_shared_symbol_table';
62 namespace ion\Symbol\System
;
66 case IonSymbolTable
= 3;
72 case SharedSymbolTable
= 9;
77 public function __construct(
78 public readonly
string $value,
79 public readonly
int $sid = -1,
80 public readonly ?Symbol\ImportLocation
$importLocation = null,
83 public function equals(Symbol
$symbol): bool { }
102 public function __construct(
104 public readonly ?Decimal\Context
$context = null,
107 public function equals(Decimal
$decimal) : bool {}
108 public function zero() : void
{}
110 public function __toString() : string {}
111 /** @alias ion\Decimal::__toString */
112 public function toString() : string {}
113 public function toInt() : int {}
116 namespace ion\Decimal
;
123 class Timestamp
extends \DateTime
{
124 public function __construct(
125 public readonly
int $precision,
126 public readonly
string $format = "c",
127 string $datetime = "now",
128 ?\DateTimeZone
$timezone = null,
131 public function __toString() : string {}
136 interface Reader
extends \RecursiveIterator
{
137 public function getType() : Type
;
138 public function hasAnnotations() : bool;
139 public function hasAnnotation(string $annotation) : bool;
140 public function isNull() : bool;
141 public function isInStruct() : bool;
142 public function getFieldName() : string;
143 public function getFieldNameSymbol() : Symbol
;
144 public function getAnnotations() : array;
145 public function getAnnotationSymbols() : array;
146 public function countAnnotations() : int;
147 public function getAnnotation(int $index) : string;
148 public function getAnnotationSymbol(int $index) : Symbol
;
150 public function readNull() : Type
;
151 public function readBool() : bool;
152 public function readInt() : int|
string;
153 public function readFloat() : float;
154 public function readDecimal() : Decimal
;
155 public function readTimestamp() : Timestamp
;
156 public function readSymbol() : Symbol
;
157 public function readString() : string;
158 /** @param ref $string */
159 public function readStringPart(&$string, int $length = 0x1000) : bool;
160 public function readLob() : string;
161 /** @param ref $string */
162 public function readLobPart(&$string, int $length = 0x1000) : bool;
164 public function getPosition() : int;
165 public function getDepth() : int;
167 public function seek(int $offset, int $length = -1) : void
;
169 public function getSymbolTable() : SymbolTable;
170 public function setSymbolTable(SymbolTable $table) : void;
172 public function getValueOffset() : int;
173 public function getValueLength() : int;
175 namespace ion\Reader
;
177 public function __construct(
178 public readonly ?\ion\Catalog
$catalog = null,
179 public readonly ?\ion\Decimal\Context
$decimalContext = null,
180 public readonly ?\Closure
$onContextChange = null,
181 public readonly
bool $returnSystemValues = false,
182 public readonly
int $newLine = 0xa,
183 public readonly
int $maxContainerDepth = 10,
184 public readonly
int $maxAnnotations = 10,
185 public readonly
int $maxAnnotationBuffered = 512,
186 public readonly
int $symbolThreshold = 4096,
187 public readonly
int $userValueThreshold = 4096,
188 public readonly
int $chunkThreshold = 4096,
189 public readonly
int $allocationPageSize = 4096,
190 public readonly
bool $skipCharacterValidation = false,
194 namespace ion\Reader
;
195 abstract class Reader
implements \ion\Reader
{
196 public readonly ?Options
$options;
198 public function hasChildren() : bool {}
199 public function getChildren() : \ion\Reader
{}
201 public function rewind() : void
{}
202 public function next() : void
{}
203 public function valid() : bool {}
204 public function key() : mixed {}
205 public function current() : mixed {}
207 public function getType() : \ion\Type
{}
208 public function hasAnnotations() : bool {}
209 public function hasAnnotation(string $annotation) : bool {}
210 public function isNull() : bool {}
211 public function isInStruct() : bool {}
212 public function getFieldName() : string {}
213 public function getFieldNameSymbol() : \ion\Symbol
{}
214 public function getAnnotations() : array {}
215 public function getAnnotationSymbols() : array {}
216 public function countAnnotations() : int {}
217 public function getAnnotation(int $index) : string {}
218 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
220 public function readNull() : \ion\Type
{}
221 public function readBool() : bool {}
222 public function readInt() : int|
string {}
223 public function readFloat() : float {}
224 public function readDecimal() : \ion\Decimal
{}
225 public function readTimestamp() : \ion\Timestamp
{}
226 public function readSymbol() : \ion\Symbol
{}
227 public function readString() : string {}
228 /** @param ref $string */
229 public function readStringPart(&$string, int $length = 0x1000) : bool {}
230 public function readLob() : string {}
231 /** @param ref $string */
232 public function readLobPart(&$string, int $length = 0x1000) : bool {}
234 public function getPosition() : int {}
235 public function getDepth() : int{}
237 public function seek(int $offset, int $length = -1) : void
{}
239 public function getSymbolTable() : SymbolTable {}
240 public function setSymbolTable(SymbolTable $table) : void {}
242 public function getValueOffset() : int {}
243 public function getValueLength() : int {}
245 namespace ion\Reader
;
246 interface Buffer
extends \ion\Reader
{
247 public function getBuffer() : string;
250 namespace ion\Reader\Buffer
;
251 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
252 public function __construct(
254 ?\ion\Reader\Options
$options = null,
257 public function getBuffer() : string {}
260 namespace ion\Reader
;
261 interface Stream
extends \ion\Reader
{
262 /** @return resource */
263 public function getStream();
264 /** @param resource $stream */
265 public function resetStream($stream) : void
;
266 /** @param resource $stream */
267 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
270 namespace ion\Reader\Stream
;
271 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
272 /** @param resource $stream */
273 public function __construct(
275 ?\ion\Reader\Options
$options = null,
278 /** @return resource */
279 public function getStream() {}
280 /** @param resource $stream */
281 public function resetStream($stream) : void
{}
282 /** @param resource $stream */
283 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
286 namespace ion\Writer
;
288 public function __construct(
289 public readonly ?\ion\Catalog
$catalog = null,
290 public readonly ?\ion\Decimal\Context
$decimalContext = null,
291 ?\ion\Collection
$encodingSymbolTable = null,
292 public readonly
bool $outputBinary = false,
293 public readonly
bool $compactFloats = false,
294 public readonly
bool $escapeNonAscii = false,
295 public readonly
bool $prettyPrint = false,
296 public readonly
bool $indentTabs = true,
297 public readonly
int $indentSize = 2,
298 public readonly
bool $smallContainersInline = true,
299 public readonly
bool $suppressSystemValues = false,
300 public readonly
bool $flushEveryValue = false,
301 public readonly
int $maxContainerDepth = 10,
302 public readonly
int $maxAnnotations = 10,
303 public readonly
int $tempBufferSize = 0x400,
304 public readonly
int $allocationPageSize = 0x1000,
307 // public function addSharedImports(\ion\Collection|\ion\Symbol\Table ...$imports) : void;
312 public function writeNull() : void
;
313 public function writeTypedNull(Type
$type) : void
;
314 public function writeBool(bool $value) : void
;
315 public function writeInt(int|
string $value) : void
;
316 public function writeFloat(float $value) : void
;
317 public function writeDecimal(Decimal|
string $value) : void
;
318 public function writeTimestamp(Timestamp|
string $value) : void
;
319 public function writeSymbol(Symbol|
string $value) : void
;
320 public function writeString(string $value) : void
;
321 public function writeCLob(string $value) : void
;
322 public function writeBLob(string $value) : void
;
324 public function startLob(Type
$type) : void
;
325 public function appendLob(string $data) : void
;
326 public function finishLob() : void
;
328 public function startContainer(Type
$type) : void
;
329 public function finishContainer() : void
;
331 public function writeFieldName(string $name) : void
;
333 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
335 public function getDepth() : int;
336 public function flush() : int;
337 public function finish() : int;
339 public function writeOne(Reader
$reader) : void
;
340 public function writeAll(Reader
$reader) : void
;
342 // public function getCatalog() : Catalog;
343 // public function setCatalog(Catalog $catalog) : void;
345 // public function getSymbolTable() : Symbol\Table;
346 // puvlic function setSymbolTable(Symbol\Table $table) : void;
349 namespace ion\Writer
;
350 abstract class Writer
implements \ion\Writer
{
351 public function writeNull() : void
{}
352 public function writeTypedNull(\ion\Type
$type) : void
{}
353 public function writeBool(bool $value) : void
{}
354 public function writeInt(int|
string $value) : void
{}
355 public function writeFloat(float $value) : void
{}
356 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
357 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
358 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
359 public function writeString(string $value) : void
{}
360 public function writeCLob(string $value) : void
{}
361 public function writeBLob(string $value) : void
{}
363 public function startLob(\ion\Type
$type) : void
{}
364 public function appendLob(string $data) : void
{}
365 public function finishLob() : void
{}
367 public function startContainer(\ion\Type
$type) : void
{}
368 public function finishContainer() : void
{}
370 public function writeFieldName(string $name) : void
{}
372 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
374 public function getDepth() : int {}
375 public function flush() : int {}
376 public function finish() : int {}
378 public function writeOne(\ion\Reader
$reader) : void
{}
379 public function writeAll(\ion\Reader
$reader) : void
{}
382 namespace ion\Writer
;
383 interface Buffer
extends \ion\Writer
{
384 public function getBuffer() : string;
387 namespace ion\Writer\Buffer
;
388 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
389 /** @param ref $buffer */
390 public function __construct(
392 ?\ion\Writer\Options
$options = null,
396 * @return string a _copy_ of $buffer passed to the constructor
398 public function getBuffer() : string {}
401 namespace ion\Writer
;
402 interface Stream
extends \ion\Writer
{
403 /** @return resource */
404 public function getStream();
407 namespace ion\Writer\Stream
;
408 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
409 /** @param resource $stream */
410 public function __construct(
412 ?\ion\Writer\Options
$options = null,
414 /** @return resource */
415 public function getStream() {}
420 public function __construct(
421 public readonly \ion\Writer
$writer,
422 public readonly
bool $callMagicSerialize = true,
423 public readonly ?
string $callCustomSerialize = null,
425 public function __invoke(mixed $data) : void
{}
426 protected function serialize(mixed $data) : void
{}
431 public function __construct(
432 public readonly \ion\Reader
$reader,
433 public readonly
bool $callMagicUnserialize = true,
434 public readonly ?
string $callCustomUnserialize = null,
436 public function __invoke() : mixed {}
437 protected function unserialize() : mixed {}
441 function serialize(mixed $data, Writer\Options
$options = null) : string {}
442 function unserialize(mixed $serialized, Reader\Options
$options = null) : mixed {}