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 {}
126 class Timestamp
extends \DateTime
{
127 public function __construct(
128 public readonly
int $precision,
129 public readonly
string $format = "c",
130 string $datetime = "now",
131 ?\DateTimeZone
$timezone = null,
134 public function __toString() : string {}
139 interface Reader
extends \RecursiveIterator
{
140 public function getType() : Type
;
141 public function hasAnnotations() : bool;
142 public function hasAnnotation(string $annotation) : bool;
143 public function isNull() : bool;
144 public function isInStruct() : bool;
145 public function getFieldName() : string;
146 public function getFieldNameSymbol() : Symbol
;
147 public function getAnnotations() : array;
148 public function getAnnotationSymbols() : array;
149 public function countAnnotations() : int;
150 public function getAnnotation(int $index) : string;
151 public function getAnnotationSymbol(int $index) : Symbol
;
153 public function readNull() : Type
;
154 public function readBool() : bool;
155 public function readInt() : int|
string;
156 public function readFloat() : float;
157 public function readDecimal() : Decimal
;
158 public function readTimestamp() : Timestamp
;
159 public function readSymbol() : Symbol
;
160 public function readString() : string;
161 /** @param ref $string */
162 public function readStringPart(&$string, int $length = 0x1000) : bool;
163 public function readLob() : string;
164 /** @param ref $string */
165 public function readLobPart(&$string, int $length = 0x1000) : bool;
167 public function getPosition() : int;
168 public function getDepth() : int;
170 public function seek(int $offset, int $length = -1) : void
;
172 public function getSymbolTable() : SymbolTable;
173 public function setSymbolTable(SymbolTable $table) : void;
175 public function getValueOffset() : int;
176 public function getValueLength() : int;
178 namespace ion\Reader
;
180 public function __construct(
181 public readonly ?\ion\Catalog
$catalog = null,
182 public readonly ?\ion\Decimal\Context
$decimalContext = null,
183 public readonly ?\Closure
$onContextChange = null,
184 public readonly
bool $returnSystemValues = false,
185 public readonly
int $newLine = 0xa,
186 public readonly
int $maxContainerDepth = 10,
187 public readonly
int $maxAnnotations = 10,
188 public readonly
int $maxAnnotationBuffered = 512,
189 public readonly
int $symbolThreshold = 4096,
190 public readonly
int $userValueThreshold = 4096,
191 public readonly
int $chunkThreshold = 4096,
192 public readonly
int $allocationPageSize = 4096,
193 public readonly
bool $skipCharacterValidation = false,
197 namespace ion\Reader
;
198 abstract class Reader
implements \ion\Reader
{
199 public readonly ?Options
$options;
201 public function hasChildren() : bool {}
202 public function getChildren() : \ion\Reader
{}
204 public function rewind() : void
{}
205 public function next() : void
{}
206 public function valid() : bool {}
207 public function key() : mixed {}
208 public function current() : mixed {}
210 public function getType() : \ion\Type
{}
211 public function hasAnnotations() : bool {}
212 public function hasAnnotation(string $annotation) : bool {}
213 public function isNull() : bool {}
214 public function isInStruct() : bool {}
215 public function getFieldName() : string {}
216 public function getFieldNameSymbol() : \ion\Symbol
{}
217 public function getAnnotations() : array {}
218 public function getAnnotationSymbols() : array {}
219 public function countAnnotations() : int {}
220 public function getAnnotation(int $index) : string {}
221 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
223 public function readNull() : \ion\Type
{}
224 public function readBool() : bool {}
225 public function readInt() : int|
string {}
226 public function readFloat() : float {}
227 public function readDecimal() : \ion\Decimal
{}
228 public function readTimestamp() : \ion\Timestamp
{}
229 public function readSymbol() : \ion\Symbol
{}
230 public function readString() : string {}
231 /** @param ref $string */
232 public function readStringPart(&$string, int $length = 0x1000) : bool {}
233 public function readLob() : string {}
234 /** @param ref $string */
235 public function readLobPart(&$string, int $length = 0x1000) : bool {}
237 public function getPosition() : int {}
238 public function getDepth() : int{}
240 public function seek(int $offset, int $length = -1) : void
{}
242 public function getSymbolTable() : SymbolTable {}
243 public function setSymbolTable(SymbolTable $table) : void {}
245 public function getValueOffset() : int {}
246 public function getValueLength() : int {}
248 namespace ion\Reader
;
249 interface Buffer
extends \ion\Reader
{
250 public function getBuffer() : string;
253 namespace ion\Reader\Buffer
;
254 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
255 public function __construct(
257 ?\ion\Reader\Options
$options = null,
260 public function getBuffer() : string {}
263 namespace ion\Reader
;
264 interface Stream
extends \ion\Reader
{
265 /** @return resource */
266 public function getStream();
267 /** @param resource $stream */
268 public function resetStream($stream) : void
;
269 /** @param resource $stream */
270 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
;
273 namespace ion\Reader\Stream
;
274 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
275 /** @param resource $stream */
276 public function __construct(
278 ?\ion\Reader\Options
$options = null,
281 /** @return resource */
282 public function getStream() {}
283 /** @param resource $stream */
284 public function resetStream($stream) : void
{}
285 /** @param resource $stream */
286 public function resetStreamWithLength($stream, int $position, int $length = -1) : void
{}
289 namespace ion\Writer
;
291 public function __construct(
292 public readonly ?\ion\Catalog
$catalog = null,
293 public readonly ?\ion\Decimal\Context
$decimalContext = null,
294 ?\ion\Collection
$encodingSymbolTable = null,
295 public readonly
bool $outputBinary = false,
296 public readonly
bool $compactFloats = false,
297 public readonly
bool $escapeNonAscii = false,
298 public readonly
bool $prettyPrint = false,
299 public readonly
bool $indentTabs = true,
300 public readonly
int $indentSize = 2,
301 public readonly
bool $smallContainersInline = true,
302 public readonly
bool $suppressSystemValues = false,
303 public readonly
bool $flushEveryValue = false,
304 public readonly
int $maxContainerDepth = 10,
305 public readonly
int $maxAnnotations = 10,
306 public readonly
int $tempBufferSize = 0x400,
307 public readonly
int $allocationPageSize = 0x1000,
310 // public function addSharedImports(\ion\Collection|\ion\Symbol\Table ...$imports) : void;
315 public function writeNull() : void
;
316 public function writeTypedNull(Type
$type) : void
;
317 public function writeBool(bool $value) : void
;
318 public function writeInt(int|
string $value) : void
;
319 public function writeFloat(float $value) : void
;
320 public function writeDecimal(Decimal|
string $value) : void
;
321 public function writeTimestamp(Timestamp|
string $value) : void
;
322 public function writeSymbol(Symbol|
string $value) : void
;
323 public function writeString(string $value) : void
;
324 public function writeCLob(string $value) : void
;
325 public function writeBLob(string $value) : void
;
327 public function startLob(Type
$type) : void
;
328 public function appendLob(string $data) : void
;
329 public function finishLob() : void
;
331 public function startContainer(Type
$type) : void
;
332 public function finishContainer() : void
;
334 public function writeFieldName(string $name) : void
;
336 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
338 public function getDepth() : int;
339 public function flush() : int;
340 public function finish() : int;
342 public function writeOne(Reader
$reader) : void
;
343 public function writeAll(Reader
$reader) : void
;
345 // public function getCatalog() : Catalog;
346 // public function setCatalog(Catalog $catalog) : void;
348 // public function getSymbolTable() : Symbol\Table;
349 // puvlic function setSymbolTable(Symbol\Table $table) : void;
352 namespace ion\Writer
;
353 abstract class Writer
implements \ion\Writer
{
354 public function writeNull() : void
{}
355 public function writeTypedNull(\ion\Type
$type) : void
{}
356 public function writeBool(bool $value) : void
{}
357 public function writeInt(int|
string $value) : void
{}
358 public function writeFloat(float $value) : void
{}
359 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
360 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
361 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
362 public function writeString(string $value) : void
{}
363 public function writeCLob(string $value) : void
{}
364 public function writeBLob(string $value) : void
{}
366 public function startLob(\ion\Type
$type) : void
{}
367 public function appendLob(string $data) : void
{}
368 public function finishLob() : void
{}
370 public function startContainer(\ion\Type
$type) : void
{}
371 public function finishContainer() : void
{}
373 public function writeFieldName(string $name) : void
{}
375 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
377 public function getDepth() : int {}
378 public function flush() : int {}
379 public function finish() : int {}
381 public function writeOne(\ion\Reader
$reader) : void
{}
382 public function writeAll(\ion\Reader
$reader) : void
{}
385 namespace ion\Writer
;
386 interface Buffer
extends \ion\Writer
{
387 public function getBuffer() : string;
390 namespace ion\Writer\Buffer
;
391 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
392 /** @param ref $buffer */
393 public function __construct(
395 ?\ion\Writer\Options
$options = null,
399 * @return string a _copy_ of $buffer passed to the constructor
401 public function getBuffer() : string {}
404 namespace ion\Writer
;
405 interface Stream
extends \ion\Writer
{
406 /** @return resource */
407 public function getStream();
410 namespace ion\Writer\Stream
;
411 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
412 /** @param resource $stream */
413 public function __construct(
415 ?\ion\Writer\Options
$options = null,
417 /** @return resource */
418 public function getStream() {}
423 public function __construct(
424 public readonly \ion\Writer
$writer,
425 public readonly
bool $callMagicSerialize = true,
426 public readonly ?
string $callCustomSerialize = null,
428 public function __invoke(mixed $data) : void
{}
429 protected function serialize(mixed $data) : void
{}
434 public function __construct(
435 public readonly \ion\Reader
$reader,
436 public readonly
bool $callMagicUnserialize = true,
437 public readonly ?
string $callCustomUnserialize = null,
439 public function __invoke() : mixed {}
440 protected function unserialize() : mixed {}
444 function serialize(mixed $data, Writer\Options
$options = null) : string {}
445 function unserialize(mixed $serialized, Reader\Options
$options = null) : mixed {}