#!/usr/bin/env dub
/+ dub.sdl:
name "images_wired_isobmff"
dependency "sparkles:wired" path="../../../../.."
dflags "-preview=in" "-preview=dip1000"
buildType "checked" {
buildOptions "optimize" "inline" "debugInfo"
}
+/
/**
* The ISOBMFF box structure that AVIF and HEIF use, on the
* `sparkles:wired` that ships today.
*
* The fixed parts (the 8-byte box header, the FullBox version and flags,
* `ftyp`, `hdlr`, `infe` version 2, `ispe`) are plain D structs read and
* written by the schema walk of `png-chunks.d`. Everything else is
* hand-written D, marked `GAP`: the 64-bit `largesize` when `size` is 1,
* `size` 0 meaning "to the end of the file", the `uuid` extended type,
* nesting inside a parent's declared size, version-dependent field widths
* (`pitm`, `iinf`, `iloc`, `ipma`), `iloc`'s 4-bit size fields that set the
* width of later fields, `ipma`'s 7- or 15-bit property indices with an
* essential bit, and the references by item ID and by property index that
* tie `pitm`, `iinf`, `iloc`, `ipco` and `ipma` together. On encode, every
* box size and every `iloc` offset is back-patched by hand.
*
* Backs ../index.md (section "ISOBMFF"). Run with:
* `dub run --single isobmff.d`
*/
module (module) images_wired_isobmffThe ISOBMFF box structure that AVIF and HEIF use, on the
sparkles:wired that ships today.
The fixed parts (the 8-byte box header, the FullBox version and flags,
ftyp, hdlr, infe version 2, ispe) are plain D structs read and
written by the schema walk of png-chunks.d. Everything else is
hand-written D, marked GAP: the 64-bit largesize when size is 1,
size 0 meaning "to the end of the file", the uuid extended type,
nesting inside a parent's declared size, version-dependent field widths
(pitm, iinf, iloc, ipma), iloc's 4-bit size fields that set the
width of later fields, ipma's 7- or 15-bit property indices with an
essential bit, and the references by item ID and by property index that
tie pitm, iinf, iloc, ipco and ipma together. On encode, every
box size and every iloc offset is back-patched by hand.
Backs ../index.md (section "ISOBMFF"). Run with:
dub run --single isobmff.d
images_wired_isobmff;
import (package) stdstd.(module) std.formatThis package provides string formatting functionality using
printf style format strings.
Submodule Function Name Description package format Converts its arguments according to a format string into a string.
| package |
sformat |
Converts its arguments according to a format string into a buffer. |
| package |
FormatException |
Signals a problem while formatting. |
| write |
formattedWrite |
Converts its arguments according to a format string and writes
the result to an output range. |
| write |
formatValue |
Formats a value of any type according to a format specifier and
writes the result to an output range. |
| read |
formattedRead |
Reads an input range according to a format string and stores the read
values into its arguments. |
| read |
unformatValue |
Reads a value from the given input range and converts it according to
a format specifier. |
| spec |
FormatSpec |
A general handler for format strings. |
| spec |
singleSpec |
Helper function that returns a FormatSpec for a single format specifier. |
Limitation
This package does not support localization, but
adheres to the rounding mode of the floating point unit, if
available.
Format Strings
The functions contained in this package use format strings. A
format string describes the layout of another string for reading or
writing purposes. A format string is composed of normal text
interspersed with format specifiers. A format specifier starts
with a percentage sign '%', optionally followed by one or more
parameters and ends with a format indicator. A format
indicator may be a simple format character or a compound
indicator.
Format strings are composed according to the following grammar:
FormatString:
FormatStringItem FormatString
FormatStringItem:
Character
FormatSpecifier
FormatSpecifier:
'%' Parameters FormatIndicator
FormatIndicator:
FormatCharacter
CompoundIndicator
FormatCharacter:
see remark below
CompoundIndicator:
'(' FormatString '%)'
'(' FormatString '%|' Delimiter '%)'
Delimiter
empty
Character Delimiter
Parameters:
Position Flags Width Precision Separator
Position:
empty
Integer '$'**
*Integer* **':'** *Integer* **'$'
Integer ':' '$'**
*Flags*:
*empty*
*Flag* *Flags*
*Flag*:
**'-'**|**'+'**|**' '**|**'0'**|**'#'**|**'='**
*Width*:
*OptionalPositionalInteger*
*Precision*:
*empty*
**'.'** *OptionalPositionalInteger*
*Separator*:
*empty*
**','** *OptionalInteger*
**','** *OptionalInteger* **'?'**
*OptionalInteger*:
*empty*
*Integer*
**'*'**
*OptionalPositionalInteger*:
*OptionalInteger*
**'*'** *Integer* **'$'
Character
'%%'
AnyCharacterExceptPercent
Integer:
NonZeroDigit Digits
Digits:
empty
Digit Digits
NonZeroDigit:
'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
Digit:
'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
Note
FormatCharacter is unspecified. It can be any character
that has no other purpose in this grammar, but it is
recommended to assign (lower- and uppercase) letters.
Note
The Parameters of a CompoundIndicator are currently
limited to a '-' flag.
Format Indicator
The format indicator can either be a single character or an
expression surrounded by '%(' and '%)'. It specifies the
basic manner in which a value will be formatted and is the minimum
requirement to format a value.
The following characters can be used as format characters:
FormatCharacter Semantics 's' To be formatted in a human readable format. Can be used with all types. 'c' To be formatted as a character. 'd' To be formatted as a signed decimal integer. 'u' To be formatted as a decimal image of the underlying bit representation. 'b' To be formatted as a binary image of the underlying bit representation. 'o' To be formatted as an octal image of the underlying bit representation. 'x' / 'X' To be formatted as a hexadecimal image of the underlying bit representation. 'e' / 'E' To be formatted as a real number in decimal scientific notation. 'f' / 'F' To be formatted as a real number in decimal natural notation. 'g' / 'G' To be formatted as a real number in decimal short notation. Depending on the number, a scientific notation or a natural notation is used. 'a' / 'A' To be formatted as a real number in hexadecimal scientific notation. 'r' To be formatted as raw bytes. The output may not be printable and depends on endianness.
The compound indicator can be used to describe compound types
like arrays or structs in more detail. A compound type is enclosed
within '%(' and '%)'. The enclosed sub-format string is
applied to individual elements. The trailing portion of the
sub-format string following the specifier for the element is
interpreted as the delimiter, and is therefore omitted following the
last element. The '%|' specifier may be used to explicitly
indicate the start of the delimiter, so that the preceding portion of
the string will be included following the last element.
The format string inside of the compound indicator should
contain exactly one format specifier (two in case of associative
arrays), which specifies the formatting mode of the elements of the
compound type. This format specifier can be a compound
indicator itself.
Note
Inside a compound indicator, strings and characters are
escaped automatically. To avoid this behavior, use "%-("
instead of "%(".
Flags
There are several flags that affect the outcome of the formatting.
Flag Semantics '-' When the formatted result is shorter than the value given by the width parameter, the output is left justified. Without the '-' flag, the output remains right justified.
There are two exceptions where the '-' flag has a
different meaning: (1) with 'r' it denotes to use little
endian and (2) in case of a compound indicator it means that
no special handling of the members is applied. |
| '=' |
When the formatted result is shorter than the value
given by the width parameter, the output is centered.
If the central position is not possible it is moved slightly
to the right. In this case, if '-' flag is present in
addition to the '=' flag, it is moved slightly to the left. |
| '+' / *' '* |
Applies to numerical values. By default, positive numbers are not
formatted to include the + sign. With one of these two flags present,
positive numbers are preceded by a plus sign or a space.
When both flags are present, a plus sign is used.
In case of 'r', a big endian format is used. |
| '0' |
Is applied to numerical values that are printed right justified.
If the zero flag is present, the space left to the number is
filled with zeros instead of spaces. |
| '#' |
Denotes that an alternative output must be used. This depends on the type
to be formatted and the format character used. See the
sections below for more information. |
Width, Precision and Separator
The width parameter specifies the minimum width of the result.
The meaning of precision depends on the format indicator. For
integers it denotes the minimum number of digits printed, for
real numbers it denotes the number of fractional digits and for
strings and compound types it denotes the maximum number of elements
that are included in the output.
A separator is used for formatting numbers. If it is specified,
the output is divided into chunks of three digits, separated by a ','. The number of digits in a chunk can be given explicitly by
providing a number or a ''* after the ','.
In all three cases the number of digits can be replaced by a ''*. In this scenario, the next argument is used as the number of
digits. If the argument is a negative number, the precision and
separator parameters are considered unspecified. For width,
the absolute value is used and the '-' flag is set.
The separator can also be followed by a '?'. In that case,
an additional argument is used to specify the symbol that should be
used to separate the chunks.
Position
By default, the arguments are processed in the provided order. With
the position parameter it is possible to address arguments
directly. It is also possible to denote a series of arguments with
two numbers separated by ':', that are all processed in the same
way. The second number can be omitted. In that case the series ends
with the last argument.
It's also possible to use positional arguments for width, precision and separator by adding a number and a '$' after the ''*.
Types
This section describes the result of combining types with format
characters. It is organized in 2 subsections: a list of general
information regarding the formatting of types in the presence of
format characters and a table that contains details for every
available combination of type and format character.
When formatting types, the following rules apply:
If the format character is upper case, the resulting string will
be formatted using upper case letters.
The default precision for floating point numbers is 6 digits.
Rounding of floating point numbers adheres to the rounding mode
of the floating point unit, if available.
The floating point values NaN and Infinity are formatted as
nan and inf, possibly preceded by '+' or '-' sign.
Formatting reals is only supported for 64 bit reals and 80 bit reals.
All other reals are cast to double before they are formatted. This will
cause the result to be inf for very large numbers.
Characters and strings formatted with the 's' format character
inside of compound types are surrounded by single and double quotes
and unprintable characters are escaped. To avoid this, a '-'
flag can be specified for the compound specifier
(e.g. "%-(%s%)" instead of "%(%s%)" ).
Structs, unions, classes and interfaces are formatted by calling a
toString method if available.
See module std.format.write for more
details.
Only part of these combinations can be used for reading. See
module std.format.read for more
detailed information.
This table contains descriptions for every possible combination of
type and format character:
<th scope="col" width="20%">Type</th> <th scope="col" width="20%">Format Character</th> Formatted as... <td rowspan="1">null</td> 's' null
|<td rowspan="3">bool</td> 's' |
false or true |
| 'b', 'd', 'o', 'u', 'x', 'X' |
As the integrals 0 or 1 with the same format character.
Please note, that 'o' and 'x' with '#' flag
might produce unexpected results due to special handling of
the value 0. |
| 'r' |
\0 or \1 |
|<td rowspan="4">Integral</td> 's', 'd' |
A signed decimal number. The '#' flag is ignored. |
| 'b', 'o', 'u', 'x', 'X' |
An unsigned binary, decimal, octal or hexadecimal number.
In case of 'o' and 'x', the '#' flag
denotes that the number must be preceded by 0 and 0x, with
the exception of the value 0, where this does not apply. For
'b' and 'u' the '#' flag has no effect. |
| 'e', 'E', 'f', 'F', 'g', 'G', 'a', 'A' |
As a floating point value with the same specifier.
Default precision is large enough to add all digits
of the integral value.
In case of 'a' and 'A', the integral digit can be
any hexadecimal digit.
|
| 'r' |
Characters taken directly from the binary representation. |
|<td rowspan="5">Floating Point</td> 'e', 'E' |
Scientific notation: Exactly one integral digit followed by a dot
and fractional digits, followed by the exponent.
The exponent is formatted as 'e' followed by
a '+' or '-' sign, followed by at least
two digits.
When there are no fractional digits and the '#' flag
is not present, the dot is omitted. |
| 'f', 'F' |
Natural notation: Integral digits followed by a dot and
fractional digits.
When there are no fractional digits and the '#' flag
is not present, the dot is omitted.
Please note: the difference between 'f' and 'F'
is only visible for NaN and Infinity. |
| 's', 'g', 'G' |
Short notation: If the absolute value is larger than 10 ^^ precision
or smaller than 0.0001, the scientific notation is used.
If not, the natural notation is applied.
In both cases precision denotes the count of all digits, including
the integral digits. Trailing zeros (including a trailing dot) are removed.
If '#' flag is present, trailing zeros are not removed. |
| 'a', 'A' |
Hexadecimal scientific notation: 0x followed by 1
(or 0 in case of value zero or denormalized number)
followed by a dot, fractional digits in hexadecimal
notation and an exponent. The exponent is build by p,
followed by a sign and the exponent in decimal notation.
When there are no fractional digits and the '#' flag
is not present, the dot is omitted. |
| 'r' |
Characters taken directly from the binary representation. |
|<td rowspan="3">Character</td> 's', 'c' |
As the character.
Inside of a compound indicator 's' is treated differently: The
character is surrounded by single quotes and non printable
characters are escaped. This can be avoided by preceding
the compound indicator with a '-' flag
(e.g. "%-(%s%)"). |
| 'b', 'd', 'o', 'u', 'x', 'X' |
As the integral that represents the character. |
| 'r' |
Characters taken directly from the binary representation. |
|<td rowspan="3">String</td> 's' |
The sequence of characters that form the string.
Inside of a compound indicator the string is surrounded by double quotes
and non printable characters are escaped. This can be avoided
by preceding the compound indicator with a '-' flag
(e.g. "%-(%s%)"). |
| 'r' |
The sequence of characters, each formatted with 'r'. |
| compound |
As an array of characters. |
|<td rowspan="3">Array</td> 's' |
When the elements are characters, the array is formatted as
a string. In all other cases the array is surrounded by square brackets
and the elements are separated by a comma and a space. If the elements
are strings, they are surrounded by double quotes and non
printable characters are escaped. |
| 'r' |
The sequence of the elements, each formatted with 'r'. |
| compound |
The sequence of the elements, each formatted according to the specifications
given inside of the compound specifier. |
|<td rowspan="2">Associative Array</td> 's' |
As a sequence of the elements in unpredictable order. The output is
surrounded by square brackets. The elements are separated by a
comma and a space. The elements are formatted as key:value. |
| compound |
As a sequence of the elements in unpredictable order. Each element
is formatted according to the specifications given inside of the
compound specifier. The first specifier is used for formatting
the key and the second specifier is used for formatting the value.
The order can be changed with positional arguments. For example
"%(%2$s (%1$s), %)" will write the value, followed by the key in
parenthesis. |
|<td rowspan="2">Enum</td> 's' |
The name of the value. If the name is not available, the base value
is used, preceeded by a cast. |
| All, but 's' |
Enums can be formatted with all format characters that can be used
with the base value. In that case they are formatted like the base value. |
|<td rowspan="3">Input Range</td> 's' |
When the elements of the range are characters, they are written like a string.
In all other cases, the elements are enclosed by square brackets and separated
by a comma and a space. |
| 'r' |
The sequence of the elements, each formatted with 'r'. |
| compound |
The sequence of the elements, each formatted according to the specifications
given inside of the compound specifier. |
|<td rowspan="1">Struct</td> 's' |
When the struct has neither an applicable toString
nor is an input range, it is formatted as follows:
StructType(field1, field2, ...). |
|<td rowspan="1">Class</td> 's' |
When the class has neither an applicable toString
nor is an input range, it is formatted as the
fully qualified name of the class. |
|<td rowspan="1">Union</td> 's' |
When the union has neither an applicable toString
nor is an input range, it is formatted as its base name. |
|<td rowspan="2">Pointer</td> 's' |
A null pointer is formatted as 'null'. All other pointers are
formatted as hexadecimal numbers with the format character 'X'. |
| 'x', 'X' |
Formatted as a hexadecimal number. |
|<td rowspan="3">SIMD vector</td> 's' |
The array is surrounded by square brackets
and the elements are separated by a comma and a space. |
| 'r' |
The sequence of the elements, each formatted with 'r'. |
| compound |
The sequence of the elements, each formatted according to the specifications
given inside of the compound specifier. |
|<td rowspan="1">Delegate</td> 's', 'r', compound |
As the .stringof of this delegate treated as a string.
Please note: The implementation is currently buggy
and its use is discouraged. |
Source
std/format/package.d
Examples
Simple use:
// Easiest way is to use `%s` everywhere:
assert(format("I got %s %s for %s euros.", 30, "eggs", 5.27) == "I got 30 eggs for 5.27 euros.");
// Other format characters provide more control:
assert(format("I got %b %(%X%) for %f euros.", 30, "eggs", 5.27) == "I got 11110 65676773 for 5.270000 euros.");
Compound specifiers allow formatting arrays and other compound types:
/*
The trailing end of the sub-format string following the specifier for
each item is interpreted as the array delimiter, and is therefore
omitted following the last array item:
*/
assert(format("My items are %(%s %).", [1,2,3]) == "My items are 1 2 3.");
assert(format("My items are %(%s, %).", [1,2,3]) == "My items are 1, 2, 3.");
/*
The "%|" delimiter specifier may be used to indicate where the
delimiter begins, so that the portion of the format string prior to
it will be retained in the last array element:
*/
assert(format("My items are %(-%s-%|, %).", [1,2,3]) == "My items are -1-, -2-, -3-.");
/*
These compound format specifiers may be nested in the case of a
nested array argument:
*/
auto mat = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]];
assert(format("%(%(%d %) - %)", mat), "1 2 3 - 4 5 6 - 7 8 9");
assert(format("[%(%(%d %) - %)]", mat), "[1 2 3 - 4 5 6 - 7 8 9]");
assert(format("[%([%(%d %)]%| - %)]", mat), "[1 2 3] - [4 5 6] - [7 8 9]");
/*
Strings and characters are escaped automatically inside compound
format specifiers. To avoid this behavior, use "%-(" instead of "%(":
*/
assert(format("My friends are %s.", ["John", "Nancy"]) == `My friends are ["John", "Nancy"].`);
assert(format("My friends are %(%s, %).", ["John", "Nancy"]) == `My friends are "John", "Nancy".`);
assert(format("My friends are %-(%s, %).", ["John", "Nancy"]) == `My friends are John, Nancy.`);
Using parameters:
// Flags can be used to influence to outcome:
assert(format("%g != %+#g", 3.14, 3.14) == "3.14 != +3.14000");
// Width and precision help to arrange the formatted result:
assert(format(">%10.2f<", 1234.56789) == "> 1234.57<");
// Numbers can be grouped:
assert(format("%,4d", int.max) == "21,4748,3647");
// It's possible to specify the position of an argument:
assert(format("%3$s %1$s", 3, 17, 5) == "5 3");
Providing parameters as arguments:
// Width as argument
assert(format(">%*s<", 10, "abc") == "> abc<");
// Precision as argument
assert(format(">%.*f<", 5, 123.2) == ">123.20000<");
// Grouping as argument
assert(format("%,*d", 1, int.max) == "2,1,4,7,4,8,3,6,4,7");
// Grouping separator as argument
assert(format("%,3?d", '_', int.max) == "2_147_483_647");
// All at once
assert(format("%*.*,*?d", 20, 15, 6, '/', int.max) == " 000/002147/483647");
format : (alias template) images_wired_isobmff.format = std.format.format(Char, Args...)(in Char[] fmt, Args args) if (isSomeChar!Char)Converts its arguments according to a format string into a string.
The second version of format takes the format string as template
argument. In this case, it is checked for consistency at
compile-time and produces slightly faster code, because the length of
the output buffer can be estimated in advance.
format;
import (package) stdstd.(module) std.stdioCategory Symbols File handles _popen File isFileHandle openNetwork stderr stdin stdout Reading chunks lines readf readfln readln Writing toFile write writef writefln writeln Misc KeepTerminator LockType StdioException
Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio
is publically imported when importing std.stdio.
There are three layers of I/O:
The lowest layer is the operating system layer. The two main schemes are Windows and Posix.
C's stdio.h which unifies the two operating system schemes.
std.stdio, this module, unifies the various stdio.h implementations into
a high level package for D programs.
Source
std/stdio.d
stdio : (alias template) images_wired_isobmff.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))Equivalent to writef(fmt, args, '\n').
writefln;
import (package) stdstd.(module) std.traitsTemplates which extract information about types and symbols at compile time.
Category Templates Symbol Name traits fullyQualifiedName mangledName moduleName packageName Function traits isFunction arity functionAttributes hasFunctionAttributes functionLinkage FunctionTypeOf isSafe isUnsafe isFinal ParameterDefaults ParameterIdentifierTuple ParameterStorageClassTuple Parameters ReturnType SetFunctionAttributes variadicFunctionStyle Aggregate Type traits BaseClassesTuple BaseTypeTuple classInstanceAlignment EnumMembers FieldNameTuple Fields hasAliasing hasElaborateAssign hasElaborateCopyConstructor hasElaborateDestructor hasElaborateMove hasIndirections hasMember hasStaticMember hasNested hasUnsharedAliasing InterfacesTuple isInnerClass isNested MemberFunctionsTuple RepresentationTypeTuple TemplateArgsOf TemplateOf TransitiveBaseTypeTuple Type Conversion CommonType AllImplicitConversionTargets ImplicitConversionTargets CopyTypeQualifiers CopyConstness isAssignable isCovariantWith isImplicitlyConvertible isQualifierConvertible Type Constructors InoutOf ConstOf SharedOf SharedInoutOf SharedConstOf SharedConstInoutOf ImmutableOf QualifierOf Categories of types allSameType ifTestable isType isAggregateType isArray isAssociativeArray isAutodecodableString isBasicType isBoolean isBuiltinType isCopyable isDynamicArray isEqualityComparable isFloatingPoint isIntegral isNarrowString isConvertibleToString isNumeric isOrderingComparable isPointer isScalarType isSigned isSIMDVector isSomeChar isSomeString isStaticArray isUnsigned Type behaviours isAbstractClass isAbstractFunction isCallable isDelegate isExpressions isFinalClass isFinalFunction isFunctionPointer isInstanceOf isIterable isMutable isSomeFunction isTypeTuple General Types ForeachType KeyType Largest mostNegative OriginalType PointerTarget Signed Unconst Unshared Unqual Unsigned ValueType Promoted Misc lvalueOf rvalueOf Select select User-Defined Attributes hasUDA getUDAs getSymbolsByUDA
Source
std/traits.d
traits : (alias template) images_wired_isobmff.EnumMembers = std.traits.EnumMembers(E) if (is(E == enum))Retrieves the members of an enumerated type enum E.
Note
An enum can have multiple members which have the same value. If you want
to use EnumMembers to e.g. generate switch cases at compile-time,
you should use the NoDuplicates template to avoid
generating duplicate switch cases.
Note
Returned values are strictly typed with E. Thus, the following code
does not work without the explicit cast:
enum E : int { a, b, c }
int[] abc = cast(int[]) [ EnumMembers!E ];
Cast is not necessary if the type of the variable is inferred. See the
example below.
EnumMembers, (alias template) images_wired_isobmff.OriginalType = std.traits.OriginalType(T)Strips off all enums from type T.
OriginalType;
import (package) sparklessparkles.(package) sparkles.basebase.(module) sparkles.base.expectedThis module is implementing the Expected idiom.
See the $(LINK2 http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C, Andrei Alexandrescu’s talk (Systematic Error Handling in C++)
and its slides.
Or more recent "Expect the Expected" by Andrei Alexandrescu for further background.
It is also inspired by C++'s proposed std::expected and Rust's Result.
Similar work is expectations by Paul Backus.
Main features
lightweight, no other external dependencies
works with pure, @safe, @nogc, nothrow, and immutable
provides methods: ok, err, consume, expect, expectErr, andThen, orElse, map, mapError, mapOrElse
type inference for ease of use with ok and err
allows to use same types for T and E
allows to define Expected without value (void for T) - can be disabled with custom Hook
provides facility to change the Expected behavior by custom Hook implementation using the Design by introspection paradigm.
can enforce result check (with a cost)
can behave like a normal Exception handled code by changing the used Hook implementation
range interface
Description
Actual Expected type is defined as Expected!(T, E, Hook), where:
T defines type of the success value
E defines type of the error
Hook defines behavior of the Expected
Default type for error is string, i.e. Expected!int is the same as Expected!(int, string).
Abort is used as a default hook.
Hooks
Expected has customizable behavior with the help of a third type parameter,
Hook. Depending on what methods Hook defines, core operations on the
Expected may be verified or completely redefined.
If Hook defines no method at all and carries no state, there is no change in
default behavior.
This module provides a few predefined hooks (below) that add useful behavior to
Expected:
| Abort | Fails every incorrect operation with a call to assert(0). It is the default third parameter, i.e. Expected!short is the same as Expected!(short, string, Abort). |
| Throw | Fails every incorrect operation by throwing an exception. |
| AsException | With this hook implementation Expected behaves just like regular Exception handled code.
That means when function returns expected value, it returns instance
of Expected with a success value.
But when it tries to return error, Exception is thrown right away,
i.e. Expected fails in constructor.
|
| RCAbort | Similar to Abort hook but uses reference counted payload instead which enables checking if the caller properly checked result of the Expected. |
The hook's members are looked up statically in a Design by Introspection manner
and are all optional. The table below illustrates the members that a hook type
may define and their influence over the behavior of the Checked type using it.
In the table, hook is an alias for Hook if the type Hook does not
introduce any state, or an object of type Hook otherwise.
Hook member
Semantics in Expected!(T, E, Hook)
-
- `enableDefaultConstructor`
- If defined, `Expected` would have enabled or disabled default constructor
based on it's `bool` value. Default constructor is disabled by default.
`opAssign` for value and error types is generated if default constructor is enabled.
-
- `enableCopyConstructor`
- If defined, `Expected` would have enabled or disabled copy constructor based
on it's `bool` value. It is enabled by default. When disabled, it enables automatic
check if the result was checked either for value or error.
When not checked it calls `hook.onUnchecked` if provided.
WARNING: As currently it's not possible to change internal state of `const`
or `immutable` object, automatic checking would't work on these. Hopefully with
`__mutable` proposal..
-
- `enableRefCountedPayload`
- Set `Expected` instances to use reference counted payload storage. It's usefull
when combined with `onUnchecked` to forcibly check that the result was checked for value
or error.
-
- `enableVoidValue`
- Defines if `Expected` supports `void` values. It's enabled by default so this
hook can be used to disable it.
-
- `onAccessEmptyValue`
- If value is accessed on unitialized `Expected` or `Expected` with error
value, `hook.onAccessEmptyValue!E(err)` is called. If hook doesn't implement the
handler, `T.init` is returned.
-
- `onAccessEmptyError`
- If error is accessed on unitialized `Expected` or `Expected` with value,
`hook.onAccessEmptyError()` is called. If hook doesn't implement the handler,
`E.init` is returned.
-
- `onUnchecked`
- If the result of `Expected` isn't checked, `hook.onUnchecked()` is called to
handle the error. If hook doesn't implement the handler, assert is thrown.
Note that `hook.enableCopyConstructor` must be `false` or `hook.enableRefCountedPayload`
must be `true` for checks to work.
-
- `onValueSet`
- `hook.onValueSet!T(val)` function is called when success value is being set to
`Expected`. It can be used for loging purposes, etc.
-
- `onErrorSet`
- `hook.onErrorSet!E(err)` function is called when error value is being set to
`Expected`. This hook function is used by `AsException` hook implementation
to change `Expected` idiom to normal `Exception` handling behavior.
Vendored from
tchaloupka/expected
by Tomáš Chaloupka, at commit 0793e8b7dc06dd05b3fa3103e5a99bf0bfd5f638: release 0.4.1
plus the five commits upstream made after it, which no release tags:
e35db58c5b454aceffcc2f90fb6aa2a9e4e2e132 makes the advanced usage example work
outside the module;
60afab8725bb4c48542884174bb67a68548fe0a0 keeps the source hook in map/mapError
and lets map return void;
5f1f2083381fdfcfa22428541be98694087fcd30 makes isVoidValueEnabled read the
member it checks;
5ee6c2a531b3d66964795274b1bcbdbd9cb7294f allocates the reference-counted payload
of a void Expected;
0793e8b7dc06dd05b3fa3103e5a99bf0bfd5f638 tests that map to void keeps the source
hook.
It stops before 0.5.0, which marks Expected @mustuse by making it an explicit
template around the struct: that breaks matching Expected!(T, E, H) in is
expressions, which Sparkles relies on, and turns every discarded result into an
error.
Changed from upstream only where Sparkles' build flags require it: the module name
(and the advanced example's imports of it), the ``expected. prefix on its test
names, const for in on the extern(C) GC declarations (-preview=in rejects
in there), and the Throw hook throwing an error object read through an inout
accessor unqualified (base disallows deprecations). No other changes.
Why vendored: it is one module of about 2000 lines under Sparkles' own licence
(BSL-1.0). As a dub package it put expected and, through its unittest
configuration, silly (which Sparkles does not use) into nearly every one of the
repository's 88 dub.selections.json files and into the Nix dub locks. The fixes
upstream made after 0.4.1 are untagged, so dub could not take them. Owning the
copy keeps it building under Sparkles' flags and conventions.
Examples
Basic usage
auto foo(int i) {
if (i == 0) return err!int("oops");
return ok(42 / i);
}
version (D_Exceptions)
{
auto bar(int i) {
if (i == 0) throw new Exception("err");
return i-1;
}
}
// basic checks
assert(foo(2));
assert(foo(2).hasValue);
assert(!foo(2).hasError);
assert(foo(2).value == 21);
assert(!foo(0));
assert(!foo(0).hasValue);
assert(foo(0).hasError);
assert(foo(0).error == "oops");
// void result
assert(ok()); // no error -> success
assert(!ok().hasError);
// assert(err("foo").hasValue); // doesn't have hasValue and value properties
version (D_Exceptions)
{
// expected from throwing function
assert(consume!bar(1) == 0);
assert(consume!bar(0).error.msg == "err");
}
// orElse
assert(foo(2).orElse!(() => 0) == 21);
assert(foo(0).orElse(100) == 100);
// andThen
assert(foo(2).andThen(foo(6)) == 7);
assert(foo(0).andThen(foo(6)).error == "oops");
// map
assert(foo(2).map!(a => a*2).map!(a => a - 2) == 40);
assert(foo(0).map!(a => a*2).map!(a => a - 2).error == "oops");
// mapError
assert(foo(0).mapError!(e => "OOPS").error == "OOPS");
assert(foo(2).mapError!(e => "OOPS") == 21);
// mapOrElse
assert(foo(2).mapOrElse!(v => v*2, e => 0) == 42);
assert(foo(0).mapOrElse!(v => v*2, e => 0) == 0);
Advanced usage - behavior modification
import exp = sparkles.base.expected;
import sparkles.base.expected : orElse; // UFCS doesn't work with renamed imports
import std.exception : assertThrown;
// define our Expected type using Exception as Error values
// and Throw hook, which throws when empty value or error is accessed
template Expected(T)
{
alias Expected = exp.Expected!(T, Exception, exp.Throw);
}
// create wrappers for simplified usage of our Expected
auto ok(T)(T val) { return exp.ok!(Exception, exp.Throw)(val); }
auto err(T)(Exception err) { return exp.err!(T, exp.Throw)(err); }
// use it as normal
assert(ok(42) == 42);
assert(err!int(new Exception("foo")).orElse(0) == 0);
assertThrown(ok(42).error);
assertThrown(err!int(new Exception("bar")).value);
expected : (alias struct) images_wired_isobmff.Expected = sparkles.base.expected.Expected(T, E = string, Hook = Abort) if (!is(E == void) && (isVoidValueEnabled!Hook || !is(T == void)))``Expected!(T, E) is a type that represents either success or failure.
Type T is used for success value.
If T is void, then Expected can only hold error value and is considered a success when there is no error value.
Type E is used for error value.
The default type for the error value is string.
Default behavior of Expected can be modified by the Hook template parameter.
Expected, (alias template) images_wired_isobmff.err = sparkles.base.expected.err(T = void, Hook = Abort, E)(auto ref E err)Creates an Expected object from an error value, with type inference.
err, (alias template) images_wired_isobmff.ok = sparkles.base.expected.ok(E = string, Hook = Abort, T)(auto ref T value)Creates an Expected object from an expected value, with type inference.
ok;
import (package) sparklessparkles.(package) sparkles.wiredwired.(module) sparkles.wired.policyFormat-aware @Wire* policy attributes and their value vocabulary.
This module is the format-agnostic policy layer of sparkles:wired: it defines
the marker sentinel AnyFormat, the policy enums (Repr, WireTarget,
WireSkip, WireInvalid), and the @Wire* user-defined attributes a type
author annotates enum members, fields, and types with. A concrete format backend
(e.g. sparkles.wired.json) resolves these against its own format tag.
Each value-carrying attribute is a factory function (WireName, WireCase,
WireRepr, WireOptional) returning a format-parameterized *Attr struct — so
both @WireName("x") and @WireName!Json("x") work as ordinary compile-time
calls. Resolvers detect and read the attributes through the *Attr structs.
See docs/specs/wired/SPEC.md §5 for the normative surface.
policy : (alias template) images_wired_isobmff.isBetween = sparkles.wired.policy.isBetween(alias lower, alias upper)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween, (alias template) images_wired_isobmff.isOneOf = sparkles.wired.policy.isOneOf(values...)Declarative membership check usable as a WireCheck predicate.
isOneOf, (alias struct) images_wired_isobmff.WireCheck = sparkles.wired.policy.WireCheck(alias predicate_, string message_ = "", Format_ = AnyFormat)A field/type refinement, applied after decode conversion and before encode conversion.
WireCheck, (alias template) images_wired_isobmff.wireCheckFailures = sparkles.wired.policy.wireCheckFailures(F, alias symbol, T)(in T value)Runs the shared four-protocol check vocabulary at a type or field site.
static because symbol may alias a field: without it the instantiation
would need an instance of the field's aggregate as its context.
wireCheckFailures;
import (package) sparklessparkles.(package) sparkles.wiredwired.(module) sparkles.wired.schemaCompile-time wire-schema reification.
wireSchemaOf!(F, T) lowers the currently supported wired type vocabulary to
plain data. Nodes and child edges are flat arenas; recursive re-entry is an
explicit NodeKind.reference node whose referenceIndex names an earlier
node. Policy values are resolved through sparkles.wired.policy, once, while
the arena is built.
fieldPolicies is a compatibility projection of aggregate child snapshots.
The builder consumes the declaration-only policy seed, avoiding a
policy/schema template cycle.
schema : (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind, (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind, (struct) sparkles.wired.schema.WireSchemaFlat compile-time schema arena. Node zero is always the root.
edges[node.firstEdge .. node.firstEdge + node.edgeCount] contains child node
indices. Annotation ranges use the same extent convention.
WireSchema, (alias template) images_wired_isobmff.wireSchemaOf = sparkles.wired.schema.wireSchemaOf(F, T)Complete CTFE schema of T under format F.
wireSchemaOf;
// ---------------------------------------------------------------------------
// A big-endian, fixed-layout walk over the shipped schema (same in all three
// programs of this experiment)
// ---------------------------------------------------------------------------
/// Byte size of the subtree at `index`, or -1 when the schema gives none.
/// Takes the schema by value: as an `in` parameter, CTFE fails on DMD and crashes LDC.
long long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize(const (struct) sparkles.wired.schema.WireSchemaFlat compile-time schema arena. Node zero is always the root.
edges[node.firstEdge .. node.firstEdge + node.edgeCount] contains child node
indices. Annotation ranges use the same extent convention.
WireSchema (parameter) const(sparkles.wired.schema.WireSchema) schemaschema, (alias) object.size_t = ulongsize_t (parameter) ulong indexindex) @safe pure nothrow
{
const (local variable) const(sparkles.wired.schema.SchemaNode) nodenode = (parameter) const(sparkles.wired.schema.WireSchema) schemaschema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(parameter) ulong indexindex];
switch ((local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind)
{
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.scalar = cast(ubyte)0uscalar:
return (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKindscalarKind == (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind.(enum value) sparkles.wired.schema.ScalarKind.unsignedInteger = 3unsignedInteger
|| (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKindscalarKind == (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind.(enum value) sparkles.wired.schema.ScalarKind.signedInteger = 2signedInteger
|| (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) sparkles.wired.schema.ScalarKind sparkles.wired.schema.SchemaNode.scalarKindscalarKind == (enum) sparkles.wired.schema.ScalarKindScalar distinctions which can affect a format's wire representation.
ScalarKind.(enum value) sparkles.wired.schema.ScalarKind.character = 5character
? (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8 : -1;
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.enumeration = 1enumeration:
return (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits ? (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8 : -1;
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.staticArray = 5staticArray:
const (local variable) const(long) elementelement = long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((parameter) const(sparkles.wired.schema.WireSchema) schemaschema, (parameter) const(sparkles.wired.schema.WireSchema) schemaschema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge]);
return (local variable) const(long) elementelement < 0 ? -1 : (local variable) const(long) elementelement * cast(long) (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.staticLengthT[N] length, zero otherwise
staticLength;
case (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.aggregate = 2aggregate:
long (local variable) long totaltotal;
foreach ((parameter) const(ulong) edgeedge; (parameter) const(sparkles.wired.schema.WireSchema) schemaschema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge .. (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge + (local variable) const(sparkles.wired.schema.SchemaNode) nodenode.(field) ulong sparkles.wired.schema.SchemaNode.edgeCountrange in WireSchema.edges
edgeCount])
{
const (local variable) const(long) fieldfield = long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((parameter) const(sparkles.wired.schema.WireSchema) schemaschema, (local variable) const(ulong) edgeedge);
if ((local variable) const(long) fieldfield < 0)
return -1;
(local variable) long totaltotal += (local variable) const(long) fieldfield;
}
return (local variable) long totaltotal;
default:
return -1; // sequences, maps, unions, strings: the schema has no size
}
}
/// Format marker. Its schema hook admits only fixed-size shapes; the byte
/// order is a property of the marker, since `SchemaNode` has no such field.
struct (struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed
{
template (template) images_wired_isobmff.BeFixed.validateWireSchema(T, alias schema)validateWireSchema(T, alias schema)
{
enum bool (constant) bool images_wired_isobmff.BeFixed.validateWireSchema!(images_wired_isobmff.FullBoxHeader, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FullBoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "version_", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("version_", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte[3]", "flags", null, true, false, 2LU, 1LU, 18446744073709551615LU, 3LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], null, ["version_", "flags"])) = truevalidateWireSchema = long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((constant) sparkles.wired.schema.WireSchema sparkles.wired.schema.rawWireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.FullBoxHeader) = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FullBoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "version_", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("version_", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte[3]", "flags", null, true, false, 2LU, 1LU, 18446744073709551615LU, 3LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], null, ["version_", "flags"])The schema of T under F before the format's validation hook runs.
A format projects its per-type sidecar from this arena, so the hook may
consult that projection for every type it reaches without re-entering
wireSchemaOf. Keyed by the two types alone: one build per pair.
schema, 0) >= 0;
}
}
enum (enum) images_wired_isobmff.BinErrorKindBinErrorKind : ubyte
{
(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone,
(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated,
(enum value) images_wired_isobmff.BinErrorKind.notAMember = 2notAMember,
(enum value) images_wired_isobmff.BinErrorKind.checkFailed = 3checkFailed,
(enum value) images_wired_isobmff.BinErrorKind.badSize = 4badSize,
(enum value) images_wired_isobmff.BinErrorKind.badVersion = 5badVersion,
(enum value) images_wired_isobmff.BinErrorKind.badReference = 6badReference,
(enum value) images_wired_isobmff.BinErrorKind.duplicate = 7duplicate,
}
struct (struct) images_wired_isobmff.BinErrorBinError
{
(enum) images_wired_isobmff.BinErrorKindBinErrorKind (field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_isobmff.BinError.offsetoffset;
(alias) object.string = stringstring (field) string images_wired_isobmff.BinError.whatwhat;
}
alias (alias) images_wired_isobmff.BinResult!(images_wired_isobmff.Heif) = sparkles.base.expected.Expected!(Heif, BinError, Abort)BinResult(T) = (struct) sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort)``Expected!(T, E) is a type that represents either success or failure.
Type T is used for success value.
If T is void, then Expected can only hold error value and is considered a success when there is no error value.
Type E is used for error value.
The default type for the error value is string.
Default behavior of Expected can be modified by the Hook template parameter.
Expected!((alias) T = images_wired_isobmff.HeifT, (struct) images_wired_isobmff.BinErrorBinError);
ulong ulong images_wired_isobmff.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe(in ubyte[] (parameter) const(ubyte[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong atat, (alias) object.size_t = ulongsize_t (parameter) ulong widthwidth) @safe pure nothrow @nogc
{
ulong (local variable) ulong valuevalue;
foreach ((parameter) const(ubyte) bb; (parameter) const(ubyte[]) bytesbytes[(parameter) ulong atat .. (parameter) ulong atat + (parameter) ulong widthwidth])
(local variable) ulong valuevalue = ((local variable) ulong valuevalue << 8) | (local variable) const(ubyte) bb;
return (local variable) ulong valuevalue;
}
/// Reads schema node `index` into `value`, in lockstep with the D type.
(struct) images_wired_isobmff.BinErrorBinError images_wired_isobmff.BinError images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU)(ref images_wired_isobmff.FileTypeFixed value, in ubyte[] bytes, ref ulong pos, string path) pure nothrow @safeReads schema node index into value, in lockstep with the D type.
readNode(V, alias schema, size_t index)(ref (alias) V = images_wired_isobmff.FileTypeFixedV (parameter) images_wired_isobmff.FileTypeFixed valuevalue, in ubyte[] (parameter) const(ubyte[]) bytesbytes,
ref (alias) object.size_t = ulongsize_t (parameter) ulong pospos, (alias) object.string = stringstring (parameter) string pathpath)
{
enum (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node = (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(constant) ulong images_wired_isobmff.index = 0LUindex];
static if ((constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.aggregate = 2aggregate)
{
static foreach (i; 0 .. V.tupleof.length)
{{
enum (constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).child = 1LUchild = (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge + (constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi];
const (local variable) const(string) fieldPathfieldPath = (parameter) string pathpath.(field) ulong string.lengthlength ? (parameter) string pathpath ~ "." ~ schema.nodes[child].name : (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).child = 1LUchild].(field) string sparkles.wired.schema.SchemaNode.namefield key, enum-member name, or union variant name
name;
const (local variable) const(ulong) fieldStartfieldStart = (parameter) ulong pospos;
auto (local variable) images_wired_isobmff.BinError ee = (constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).child = 1LUreadNode!(typeof((field) char[4] images_wired_isobmff.FileTypeFixed.majorBrandV.tupleof[(constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi]), (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema, (constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).child = 1LUchild)((parameter) images_wired_isobmff.FileTypeFixed valuevalue.tupleof[(constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi], (parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (local variable) const(string) fieldPathfieldPath);
if ((local variable) images_wired_isobmff.BinError ee.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind != (enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_isobmff.BinError ee;
auto (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures = (constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUwireCheckFailures!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (alias) V = images_wired_isobmff.FileTypeFixedV.tupleof[(constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi])((parameter) images_wired_isobmff.FileTypeFixed valuevalue.tupleof[(constant) ulong images_wired_isobmff.readNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi]);
if ((local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures.(field) ulong sparkles.wired.policy.WireCheckFailure[].lengthlength)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.checkFailed = 3checkFailed, (local variable) const(ulong) fieldStartfieldStart, (local variable) const(string) fieldPathfieldPath ~ ": " ~ (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures[0].(field) string sparkles.wired.policy.WireCheckFailure.reasonreason);
}}
return (struct) images_wired_isobmff.BinErrorBinError.(constant) images_wired_isobmff.BinError images_wired_isobmff.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
else static if ((constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"]), 1LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.staticArray = 5staticArray)
{
enum (constant) ulong images_wired_isobmff.readNode!(uint[3], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 4LU).child = 5LUchild = (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.HandlerFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"])schema.(field) ulong[] sparkles.wired.schema.WireSchema.edgesedges[(constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge];
foreach ((local variable) ulong kk; 0 .. (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(uint[3], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 4LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ulong sparkles.wired.schema.SchemaNode.staticLengthT[N] length, zero otherwise
staticLength)
{
auto (local variable) images_wired_isobmff.BinError ee = (constant) ulong images_wired_isobmff.readNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 2LU).child = 3LUreadNode!(typeof((parameter) uint[3] valuevalue[0]), (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.HandlerFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"])schema, (constant) ulong images_wired_isobmff.readNode!(uint[3], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 4LU).child = 5LUchild)((parameter) uint[3] valuevalue[(local variable) ulong kk], (parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (parameter) string pathpath);
if ((local variable) images_wired_isobmff.BinError ee.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind != (enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_isobmff.BinError ee;
}
return (struct) images_wired_isobmff.BinErrorBinError.(constant) images_wired_isobmff.BinError images_wired_isobmff.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
else static if ((constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"]), 1LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.enumeration = 1enumeration)
{
const raw = cast(OriginalType!V) readBe(bytes, pos, node.scalarBits / 8);
static foreach (member; EnumMembers!V)
if (raw == member)
{
value = member;
pos += node.scalarBits / 8;
return BinError.init;
}
return BinError(BinErrorKind.notAMember, pos, path);
}
else
{
(parameter) uint valuevalue = cast((alias) V = uintV) ulong images_wired_isobmff.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"]), 1LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8);
(parameter) ulong pospos += (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.readNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"]), 1LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8;
return (struct) images_wired_isobmff.BinErrorBinError.(constant) images_wired_isobmff.BinError images_wired_isobmff.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
}
/// Decodes a fixed record at `at`: one bounds check, the schema walk with
/// field checks, then the type-level `@WireCheck`s.
(alias) images_wired_isobmff.BinResult!(images_wired_isobmff.ItemInfoEntryV2) = sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort)BinResult!(alias) T = images_wired_isobmff.ItemInfoEntryV2T sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed(T)(in ubyte[] (parameter) const(ubyte[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong atat)
{
enum (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"])schema = (template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.ItemInfoEntryV2)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (alias) T = images_wired_isobmff.FileTypeFixedT);
enum (alias) object.size_t = ulongsize_t (constant) ulong images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2).size = 8LUsize = long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"])schema, 0);
if ((parameter) ulong atat > (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength || (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength - (parameter) ulong atat < (constant) ulong images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2).size = 8LUsize)
return sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) sparkles.base.expected.err!(images_wired_isobmff.ItemInfoEntryV2, sparkles.base.expected.Abort, images_wired_isobmff.BinError)(images_wired_isobmff.BinError err) pure nothrow @nogc @safeCreates an Expected object from an error value, with type inference.
Examples
// implicit void value type
{
auto res = err("foo");
static assert(is(typeof(res) == Expected!(void, string)));
assert(!res);
assert(res.error == "foo");
}
// bool
{
auto res = err!int("42");
static assert(is(typeof(res) == Expected!(int, string)));
assert(!res);
assert(res.error == "42");
}
// other error type
{
auto res = err!bool(42);
static assert(is(typeof(res) == Expected!(bool, int)));
assert(!res);
assert(res.error == 42);
}
err!(alias) T = images_wired_isobmff.ItemInfoEntryV2T((struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (parameter) ulong atat, (struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
T.(constant) string images_wired_isobmff.ItemInfoEntryV2.stringof = "ItemInfoEntryV2"stringof));
(alias) T = images_wired_isobmff.ItemInfoEntryV2T (local variable) images_wired_isobmff.ItemInfoEntryV2 valuevalue;
(alias) object.size_t = ulongsize_t (local variable) ulong pospos = (parameter) ulong atat;
auto (local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.readNode!(images_wired_isobmff.ItemInfoEntryV2, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"]), 0LU)(ref images_wired_isobmff.ItemInfoEntryV2 value, in ubyte[] bytes, ref ulong pos, string path) pure nothrow @safeReads schema node index into value, in lockstep with the D type.
readNode!((alias) T = images_wired_isobmff.ItemInfoEntryV2T, (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"])schema, 0)((local variable) images_wired_isobmff.ItemInfoEntryV2 valuevalue, (parameter) const(ubyte[]) bytesbytes, (local variable) ulong pospos, "");
if ((local variable) images_wired_isobmff.BinError ee.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind != (enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone)
{
(local variable) images_wired_isobmff.BinError ee.(field) string images_wired_isobmff.BinError.whatwhat = (struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
T.(constant) string images_wired_isobmff.ItemInfoEntryV2.stringof = "ItemInfoEntryV2"stringof ~ "." ~ (local variable) images_wired_isobmff.BinError ee.(field) string images_wired_isobmff.BinError.whatwhat;
return sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) sparkles.base.expected.err!(images_wired_isobmff.ItemInfoEntryV2, sparkles.base.expected.Abort, images_wired_isobmff.BinError)(ref images_wired_isobmff.BinError err) pure nothrow @nogc @safeCreates an Expected object from an error value, with type inference.
Examples
// implicit void value type
{
auto res = err("foo");
static assert(is(typeof(res) == Expected!(void, string)));
assert(!res);
assert(res.error == "foo");
}
// bool
{
auto res = err!int("42");
static assert(is(typeof(res) == Expected!(int, string)));
assert(!res);
assert(res.error == "42");
}
// other error type
{
auto res = err!bool(42);
static assert(is(typeof(res) == Expected!(bool, int)));
assert(!res);
assert(res.error == 42);
}
err!(alias) T = images_wired_isobmff.ItemInfoEntryV2T((local variable) images_wired_isobmff.BinError ee);
}
auto (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures = sparkles.wired.policy.WireCheckFailure[] sparkles.wired.policy.wireCheckFailures!(images_wired_isobmff.BeFixed, images_wired_isobmff.ItemInfoEntryV2, images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value) pure nothrow @nogc @safeRuns the shared four-protocol check vocabulary at a type or field site.
static because symbol may alias a field: without it the instantiation
would need an instance of the field's aggregate as its context.
wireCheckFailures!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (alias) T = images_wired_isobmff.ItemInfoEntryV2T)((local variable) images_wired_isobmff.ItemInfoEntryV2 valuevalue);
if ((local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures.(field) ulong sparkles.wired.policy.WireCheckFailure[].lengthlength)
return sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) sparkles.base.expected.err!(images_wired_isobmff.ItemInfoEntryV2, sparkles.base.expected.Abort, images_wired_isobmff.BinError)(images_wired_isobmff.BinError err) pure nothrow @nogc @safeCreates an Expected object from an error value, with type inference.
Examples
// implicit void value type
{
auto res = err("foo");
static assert(is(typeof(res) == Expected!(void, string)));
assert(!res);
assert(res.error == "foo");
}
// bool
{
auto res = err!int("42");
static assert(is(typeof(res) == Expected!(int, string)));
assert(!res);
assert(res.error == "42");
}
// other error type
{
auto res = err!bool(42);
static assert(is(typeof(res) == Expected!(bool, int)));
assert(!res);
assert(res.error == 42);
}
err!(alias) T = images_wired_isobmff.ItemInfoEntryV2T((struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.checkFailed = 3checkFailed, (parameter) ulong atat, (struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
T.(constant) string images_wired_isobmff.ItemInfoEntryV2.stringof = "ItemInfoEntryV2"stringof ~ ": " ~ (local variable) sparkles.wired.policy.WireCheckFailure[] failuresfailures[0].(field) string sparkles.wired.policy.WireCheckFailure.reasonreason));
return sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) sparkles.base.expected.ok!(images_wired_isobmff.BinError, sparkles.base.expected.Abort, images_wired_isobmff.ItemInfoEntryV2)(ref images_wired_isobmff.ItemInfoEntryV2 value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_isobmff.BinErrorBinError((local variable) images_wired_isobmff.ItemInfoEntryV2 valuevalue);
}
void void images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU)(in images_wired_isobmff.FileTypeFixed value, ref ubyte[] output) pure nothrow @safewriteNode(V, alias schema, size_t index)(in (alias) V = images_wired_isobmff.FileTypeFixedV (parameter) const(images_wired_isobmff.FileTypeFixed) valuevalue, ref ubyte[] (parameter) ubyte[] outputoutput)
{
enum (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node = (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema.(field) sparkles.wired.schema.SchemaNode[] sparkles.wired.schema.WireSchema.nodesnodes[(constant) ulong images_wired_isobmff.index = 0LUindex];
static if ((constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.aggregate = 2aggregate)
{
static foreach (i; 0 .. V.tupleof.length)
void images_wired_isobmff.writeNode!(char[4], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 1LU)(in char[4] value, ref ubyte[] output) pure nothrow @safewriteNode!(typeof((field) char[4] images_wired_isobmff.FileTypeFixed.majorBrandV.tupleof[(constant) ulong images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi]), (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema, (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.FileTypeFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"])schema.(constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.BoxHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"])edges[(constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).node = SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ulong sparkles.wired.schema.SchemaNode.firstEdgerange in WireSchema.edges
firstEdge + (constant) ulong images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi])(
(parameter) const(images_wired_isobmff.FileTypeFixed) valuevalue.tupleof[(constant) ulong images_wired_isobmff.writeNode!(images_wired_isobmff.FileTypeFixed, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FileTypeFixed", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "majorBrand", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("majorBrand", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "minorVersion", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("minorVersion", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 3LU, 2LU], null, ["majorBrand", "minorVersion"]), 0LU).i = 0LUi], (parameter) ubyte[] outputoutput);
}
else static if ((constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"]), 1LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) sparkles.wired.schema.NodeKind sparkles.wired.schema.SchemaNode.kindkind == (enum) sparkles.wired.schema.NodeKindStructural node vocabulary shared by format walkers and derivations.
NodeKind.(enum value) sparkles.wired.schema.NodeKind.staticArray = 5staticArray)
{
foreach ((local variable) ulong kk; 0 .. (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(uint[3], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 4LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ulong sparkles.wired.schema.SchemaNode.staticLengthT[N] length, zero otherwise
staticLength)
void images_wired_isobmff.writeNode!(const(uint), WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 5LU)(in uint value, ref ubyte[] output) pure nothrow @safewriteNode!(typeof((parameter) const(uint[3]) valuevalue[0]), (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.HandlerFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"])schema, (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.HandlerFixed).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"])schema.(constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.FullBoxHeader).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FullBoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "version_", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("version_", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte[3]", "flags", null, true, false, 2LU, 1LU, 18446744073709551615LU, 3LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], null, ["version_", "flags"])edges[(constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(uint[3], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "HandlerFixed", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "preDefined", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("preDefined", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "handlerType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("handlerType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 4LU, 3LU, 5LU], [SchemaAnnotation("WireCheck!(isOneOf, \"\", AnyFormat)", "WireCheck!(isOneOf, \"\", AnyFormat)")], ["preDefined", "handlerType", "reserved"]), 4LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "uint[3]", "reserved", null, true, false, 4LU, 1LU, 18446744073709551615LU, 3LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("reserved", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(ubyte[3], WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "FullBoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "version_", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("version_", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte[3]", "flags", null, true, false, 2LU, 1LU, 18446744073709551615LU, 3LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)8u, NullAwareKind.none, "ubyte", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], null, ["version_", "flags"]), 2LU).node = SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ubyte[3]", "flags", null, true, false, 2LU, 1LU, 18446744073709551615LU, 3LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("flags", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))firstEdge])((parameter) const(uint[3]) valuevalue[(local variable) ulong kk], (parameter) ubyte[] outputoutput);
}
else
{
const ulong (local variable) const(ulong) rawraw = cast(ulong) (parameter) const(uint) valuevalue;
foreach_reverse ((local variable) int kk; 0 .. (constant) sparkles.wired.schema.SchemaNode images_wired_isobmff.writeNode!(uint, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "BoxHeader", "", null, false, false, 0LU, 2LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "type", null, true, false, 2LU, 1LU, 18446744073709551615LU, 4LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("type", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU], [SchemaAnnotation("WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)", "WireCheck!(isFourCc, \"box type is not printable\", AnyFormat)")], ["size", "type"]), 1LU).node = SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)32u, NullAwareKind.none, "uint", "size", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 0LU, PolicySnapshot(FieldPolicy("size", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))node.(field) ushort sparkles.wired.schema.SchemaNode.scalarBitsscalar storage width where it constrains wire values
scalarBits / 8)
(parameter) ubyte[] outputoutput ~= cast(ubyte)((local variable) const(ulong) rawraw >> (8 * (local variable) int kk));
}
}
/// Encodes a fixed record after its checks pass, as expressiveness §6.4
/// requires of encode. Returns the first failure's reason, or null.
(alias) object.string = stringstring string images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value, ref ubyte[] output) pure nothrow @safeEncodes a fixed record after its checks pass, as expressiveness §6.4
requires of encode. Returns the first failure's reason, or null.
encodeFixed(T)(in (alias) T = images_wired_isobmff.ItemInfoEntryV2T (parameter) const(images_wired_isobmff.ItemInfoEntryV2) valuevalue, ref ubyte[] (parameter) ubyte[] outputoutput)
{
enum (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"])schema = (template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.ItemInfoEntryV2)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (alias) T = images_wired_isobmff.FileTypeFixedT);
static foreach (i; 0 .. T.tupleof.length)
foreach ((parameter) sparkles.wired.policy.WireCheckFailure failurefailure; (constant) ulong images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2).i = 0LUwireCheckFailures!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (alias) T = images_wired_isobmff.ItemInfoEntryV2T.tupleof[(constant) ulong images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2).i = 0LUi])((parameter) const(images_wired_isobmff.ItemInfoEntryV2) valuevalue.tupleof[(constant) ulong images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2).i = 0LUi]))
return (local variable) sparkles.wired.policy.WireCheckFailure failurefailure.(field) string sparkles.wired.policy.WireCheckFailure.reasonreason;
foreach ((parameter) sparkles.wired.policy.WireCheckFailure failurefailure; sparkles.wired.policy.WireCheckFailure[] sparkles.wired.policy.wireCheckFailures!(images_wired_isobmff.BeFixed, images_wired_isobmff.ItemInfoEntryV2, images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value) pure nothrow @nogc @safeRuns the shared four-protocol check vocabulary at a type or field site.
static because symbol may alias a field: without it the instantiation
would need an instance of the field's aggregate as its context.
wireCheckFailures!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (alias) T = images_wired_isobmff.ItemInfoEntryV2T)((parameter) const(images_wired_isobmff.ItemInfoEntryV2) valuevalue))
return (local variable) sparkles.wired.policy.WireCheckFailure failurefailure.(field) string sparkles.wired.policy.WireCheckFailure.reasonreason;
void images_wired_isobmff.writeNode!(images_wired_isobmff.ItemInfoEntryV2, WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"]), 0LU)(in images_wired_isobmff.ItemInfoEntryV2 value, ref ubyte[] output) pure nothrow @safewriteNode!((alias) T = images_wired_isobmff.ItemInfoEntryV2T, (constant) sparkles.wired.schema.WireSchema images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2).schema = WireSchema([SchemaNode(NodeKind.aggregate, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "ItemInfoEntryV2", "", null, false, false, 0LU, 3LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy(null, null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "itemId", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 0LU, 1LU, PolicySnapshot(FieldPolicy("itemId", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.unsignedInteger, cast(ushort)16u, NullAwareKind.none, "ushort", "protectionIndex", null, true, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("protectionIndex", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.staticArray, ScalarKind.none, cast(ushort)0u, NullAwareKind.none, "char[4]", "itemType", null, true, false, 3LU, 1LU, 18446744073709551615LU, 4LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name)), SchemaNode(NodeKind.scalar, ScalarKind.character, cast(ushort)8u, NullAwareKind.none, "char", "", null, false, false, 0LU, 0LU, 18446744073709551615LU, 0LU, 1LU, 0LU, PolicySnapshot(FieldPolicy("itemType", null, false, false, false, WireSkip.never, WireInvalid.reject, MatchStrategy.exactlyOne, [false, false, false], [CaseStyle.original, CaseStyle.original, CaseStyle.original], [false, false, false], [Repr.name, Repr.name, Repr.name]), CaseStyle.original, Repr.name))], [1LU, 2LU, 3LU, 4LU], [SchemaAnnotation("WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)", "WireCheck!(isBetween, \"item_ID 0 is reserved\", AnyFormat)")], ["itemId", "protectionIndex", "itemType"])schema, 0)((parameter) const(images_wired_isobmff.ItemInfoEntryV2) valuevalue, (parameter) ubyte[] outputoutput);
return null;
}
// ---------------------------------------------------------------------------
// ISO/IEC 14496-12 fixed parts, as quoted by the MPEG reference software and
// libavif's parser
// ---------------------------------------------------------------------------
bool bool images_wired_isobmff.isFourCc(in char[4] t) pure nothrow @nogc @safeisFourCc(in char[4] (parameter) const(char[4]) tt) @safe pure nothrow @nogc
{
foreach ((parameter) const(char) cc; (parameter) const(char[4]) tt)
if ((local variable) const(char) cc < 0x20 || (local variable) const(char) cc > 0x7E)
return false;
return true;
}
/// §4.2.2: "unsigned int(32) size; unsigned int(32) type = boxtype;"
struct images_wired_isobmff.BoxHeader BoxHeaderBoxHeader
{
uint (field) uint images_wired_isobmff.BoxHeader.sizesize;
@(template instance) sparkles.wired.policy.WireCheck!(isFourCc, "box type is not printable", sparkles.metadata.wire.AnyFormat)WireCheck!(bool images_wired_isobmff.isFourCc(in char[4] t) pure nothrow @nogc @safeisFourCc, "box type is not printable") char[4] (field) char[4] images_wired_isobmff.BoxHeader.typetype;
}
/// §4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
/// 24-bit leaf, so the flags are three bytes.
struct (struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader
{
ubyte (field) ubyte images_wired_isobmff.FullBoxHeader.version_version_;
ubyte[3] (field) ubyte[3] images_wired_isobmff.FullBoxHeader.flagsflags;
}
/// §4.3 `ftyp`, before its compatible brands (which run to the box end).
struct images_wired_isobmff.FileTypeFixed FileTypeFixedFileTypeFixed
{
char[4] (field) char[4] images_wired_isobmff.FileTypeFixed.majorBrandmajorBrand;
uint (field) uint images_wired_isobmff.FileTypeFixed.minorVersionminorVersion;
}
/// §8.4.3 `hdlr`, after FullBox and before the NUL-terminated name.
struct images_wired_isobmff.HandlerFixed HandlerFixedHandlerFixed
{
@(template instance) sparkles.wired.policy.WireCheck!(isOneOf, "", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isOneOf!0uDeclarative membership check usable as a WireCheck predicate.
isOneOf!(0u)) uint (field) uint images_wired_isobmff.HandlerFixed.preDefinedpreDefined;
char[4] (field) char[4] images_wired_isobmff.HandlerFixed.handlerTypehandlerType;
uint[3] (field) uint[3] images_wired_isobmff.HandlerFixed.reservedreserved;
}
/// §8.11.6 `infe` version 2, after FullBox and before the name.
struct images_wired_isobmff.ItemInfoEntryV2 ItemInfoEntryV2ItemInfoEntryV2
{
@(template instance) sparkles.wired.policy.WireCheck!(isBetween, "item_ID 0 is reserved", sparkles.metadata.wire.AnyFormat)WireCheck!((template) sparkles.wired.policy.isBetween!(1, cast(ushort)65535u)Declarative inclusive-bound check usable as a WireCheck predicate.
isBetween!(1, ushort.max), "item_ID 0 is reserved") ushort (field) ushort images_wired_isobmff.ItemInfoEntryV2.itemIditemId;
ushort (field) ushort images_wired_isobmff.ItemInfoEntryV2.protectionIndexprotectionIndex;
char[4] (field) char[4] images_wired_isobmff.ItemInfoEntryV2.itemTypeitemType;
}
/// ISO/IEC 23008-12 `ispe`, after FullBox.
@(template instance) sparkles.wired.policy.WireCheck!((e) => e.width > 0 && (e.height > 0), "ispe dimensions must be > 0", sparkles.metadata.wire.AnyFormat)WireCheck!(e => e.width > 0 && e.height > 0, "ispe dimensions must be > 0")
struct (struct) images_wired_isobmff.ImageSpatialExtentsISO/IEC 23008-12 ispe, after FullBox.
ImageSpatialExtents
{
uint (field) uint images_wired_isobmff.ImageSpatialExtents.widthwidth;
uint (field) uint images_wired_isobmff.ImageSpatialExtents.heightheight;
}
// ---------------------------------------------------------------------------
// GAP: everything below is hand-written
// ---------------------------------------------------------------------------
/// A box located in the input: `[start, end)` with the payload after
/// `headerSize` bytes.
struct (struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box
{
char[4] (field) char[4] images_wired_isobmff.Box.typetype;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_isobmff.Box.startstart;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_isobmff.Box.headerSizeheaderSize;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_isobmff.Box.endend;
bool (field) bool images_wired_isobmff.Box.largesize was 1 and largesize followed
large; /// size was 1 and largesize followed
bool (field) bool images_wired_isobmff.Box.toEndsize was 0
toEnd; /// size was 0
ubyte[16] (field) ubyte[16] images_wired_isobmff.Box.usertypefor uuid
usertype; /// for `uuid`
(alias) object.size_t = ulongsize_t ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload() const @safe pure nothrow @nogc => (field) ulong images_wired_isobmff.Box.startstart + (field) ulong images_wired_isobmff.Box.headerSizeheaderSize;
}
alias (alias) images_wired_isobmff.fail!(images_wired_isobmff.Heif) = sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.fail(T)(images_wired_isobmff.BinErrorKind kind, ulong at, string what) pure nothrow @nogc @safefail(T) = ((enum) images_wired_isobmff.BinErrorKindBinErrorKind (parameter) images_wired_isobmff.BinErrorKind kindkind, (alias) object.size_t = ulongsize_t (parameter) ulong atat, (alias) object.string = stringstring (parameter) string whatwhat) => sparkles.base.expected.Expected!(Box, BinError, Abort) sparkles.base.expected.err!(images_wired_isobmff.Box, sparkles.base.expected.Abort, images_wired_isobmff.BinError)(images_wired_isobmff.BinError err) pure nothrow @nogc @safeCreates an Expected object from an error value, with type inference.
Examples
// implicit void value type
{
auto res = err("foo");
static assert(is(typeof(res) == Expected!(void, string)));
assert(!res);
assert(res.error == "foo");
}
// bool
{
auto res = err!int("42");
static assert(is(typeof(res) == Expected!(int, string)));
assert(!res);
assert(res.error == "42");
}
// other error type
{
auto res = err!bool(42);
static assert(is(typeof(res) == Expected!(bool, int)));
assert(!res);
assert(res.error == 42);
}
err!(alias) T = images_wired_isobmff.BoxT((struct) images_wired_isobmff.BinErrorBinError((parameter) images_wired_isobmff.BinErrorKind kindkind, (parameter) ulong atat, (parameter) string whatwhat));
/// GAP: §4.2.2's header: size, type, then largesize if size == 1, then the
/// 16-byte usertype if type is `uuid`. Size 0 extends to the end of the file
/// and is legal only at the top level (libavif `avifROStreamReadBoxHeaderPartial`).
(alias) images_wired_isobmff.BinResult!(images_wired_isobmff.Box) = sparkles.base.expected.Expected!(Box, BinError, Abort)BinResult!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box sparkles.base.expected.Expected!(Box, BinError, Abort) images_wired_isobmff.readBox(in ubyte[] bytes, ulong at, ulong parentEnd, bool topLevel)GAP
§4.2.2's header: size, type, then largesize if size == 1, then the
16-byte usertype if type is uuid. Size 0 extends to the end of the file
and is legal only at the top level (libavif avifROStreamReadBoxHeaderPartial).
readBox(in ubyte[] (parameter) const(ubyte[]) bytesbytes, (alias) object.size_t = ulongsize_t (parameter) ulong atat, (alias) object.size_t = ulongsize_t (parameter) ulong parentEndparentEnd, bool (parameter) bool topLeveltopLevel)
{
auto (local variable) sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) hh = sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.BoxHeader)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.BoxHeader§4.2.2: "unsigned int(32) size; unsigned int(32) type = boxtype;"
BoxHeader((parameter) const(ubyte[]) bytesbytes[0 .. (parameter) ulong parentEndparentEnd], (parameter) ulong atat);
if ((local variable) sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) hh.bool sparkles.base.expected.Expected!(images_wired_isobmff.BoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return sparkles.base.expected.Expected!(Box, BinError, Abort) sparkles.base.expected.err!(images_wired_isobmff.Box, sparkles.base.expected.Abort, images_wired_isobmff.BinError)(ref images_wired_isobmff.BinError err) pure nothrow @nogc @safeCreates an Expected object from an error value, with type inference.
Examples
// implicit void value type
{
auto res = err("foo");
static assert(is(typeof(res) == Expected!(void, string)));
assert(!res);
assert(res.error == "foo");
}
// bool
{
auto res = err!int("42");
static assert(is(typeof(res) == Expected!(int, string)));
assert(!res);
assert(res.error == "42");
}
// other error type
{
auto res = err!bool(42);
static assert(is(typeof(res) == Expected!(bool, int)));
assert(!res);
assert(res.error == 42);
}
err!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box((local variable) sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) hh.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.BoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error);
(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box (local variable) images_wired_isobmff.Box boxbox;
(local variable) images_wired_isobmff.Box boxbox.(field) char[4] images_wired_isobmff.Box.typetype = (local variable) sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) hh.inout(images_wired_isobmff.BoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.BoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) char[4] images_wired_isobmff.BoxHeader.typetype;
(local variable) images_wired_isobmff.Box boxbox.(field) ulong images_wired_isobmff.Box.startstart = (parameter) ulong atat;
(alias) object.size_t = ulongsize_t (local variable) ulong pospos = (parameter) ulong atat + 8;
ulong (local variable) ulong sizesize = (local variable) sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) hh.inout(images_wired_isobmff.BoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.BoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) uint images_wired_isobmff.BoxHeader.sizesize;
if ((local variable) ulong sizesize == 1)
{
if ((parameter) ulong parentEndparentEnd - (local variable) ulong pospos < 8)
return (template instance) images_wired_isobmff.fail!(images_wired_isobmff.Box)fail!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pospos, "largesize");
(local variable) ulong sizesize = ulong images_wired_isobmff.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pospos, 8);
(local variable) ulong pospos += 8;
(local variable) images_wired_isobmff.Box boxbox.(field) bool images_wired_isobmff.Box.largesize was 1 and largesize followed
large = true;
}
if ((local variable) images_wired_isobmff.Box boxbox.(field) char[4] images_wired_isobmff.Box.typetype == "uuid")
{
if ((parameter) ulong parentEndparentEnd - (local variable) ulong pospos < 16)
return (template instance) images_wired_isobmff.fail!(images_wired_isobmff.Box)fail!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pospos, "usertype");
(local variable) images_wired_isobmff.Box boxbox.(field) ubyte[16] images_wired_isobmff.Box.usertypefor uuid
usertype = (parameter) const(ubyte[]) bytesbytes[(local variable) ulong pospos .. (local variable) ulong pospos + 16];
(local variable) ulong pospos += 16;
}
(local variable) images_wired_isobmff.Box boxbox.(field) ulong images_wired_isobmff.Box.headerSizeheaderSize = (local variable) ulong pospos - (parameter) ulong atat;
if ((local variable) ulong sizesize == 0)
{
if (!(parameter) bool topLeveltopLevel)
return (template instance) images_wired_isobmff.fail!(images_wired_isobmff.Box)fail!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badSize = 4badSize, (parameter) ulong atat, "size 0 below the top level");
(local variable) images_wired_isobmff.Box boxbox.(field) bool images_wired_isobmff.Box.toEndsize was 0
toEnd = true;
(local variable) images_wired_isobmff.Box boxbox.(field) ulong images_wired_isobmff.Box.endend = (parameter) ulong parentEndparentEnd;
return sparkles.base.expected.Expected!(Box, BinError, Abort) sparkles.base.expected.ok!(images_wired_isobmff.BinError, sparkles.base.expected.Abort, images_wired_isobmff.Box)(ref images_wired_isobmff.Box value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_isobmff.BinErrorBinError((local variable) images_wired_isobmff.Box boxbox);
}
if ((local variable) ulong sizesize < (local variable) images_wired_isobmff.Box boxbox.(field) ulong images_wired_isobmff.Box.headerSizeheaderSize)
return (template instance) images_wired_isobmff.fail!(images_wired_isobmff.Box)fail!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badSize = 4badSize, (parameter) ulong atat, string std.format.format!("size %s smaller than its header", ulong)(ulong __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"size %s smaller than its header"((local variable) ulong sizesize));
if ((local variable) ulong sizesize > (parameter) ulong parentEndparentEnd - (parameter) ulong atat)
return (template instance) images_wired_isobmff.fail!(images_wired_isobmff.Box)fail!(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (parameter) ulong atat, string std.format.format!("%s overruns its parent", char[4])(char[4] __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"%s overruns its parent"((local variable) images_wired_isobmff.Box boxbox.(field) char[4] images_wired_isobmff.Box.typetype));
(local variable) images_wired_isobmff.Box boxbox.(field) ulong images_wired_isobmff.Box.endend = (parameter) ulong atat + cast((alias) object.size_t = ulongsize_t) (local variable) ulong sizesize;
return sparkles.base.expected.Expected!(Box, BinError, Abort) sparkles.base.expected.ok!(images_wired_isobmff.BinError, sparkles.base.expected.Abort, images_wired_isobmff.Box)(ref images_wired_isobmff.Box value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_isobmff.BinErrorBinError((local variable) images_wired_isobmff.Box boxbox);
}
/// GAP: a FullBox's version and flags, with the versions a box accepts.
(alias) images_wired_isobmff.BinResult!(images_wired_isobmff.FullBoxHeader) = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort)BinResult!(struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull(in ubyte[] (parameter) const(ubyte[]) bytesbytes, in (struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box (parameter) const(images_wired_isobmff.Box) boxbox, ubyte (parameter) ubyte maxVersionmaxVersion)
{
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.FullBoxHeader)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader((parameter) const(ubyte[]) bytesbytes[0 .. (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend], (parameter) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff;
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_ > (parameter) ubyte maxVersionmaxVersion)
return (template instance) images_wired_isobmff.fail!(images_wired_isobmff.FullBoxHeader)fail!(struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badVersion = 5badVersion, (parameter) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload,
string std.format.format!("%s version %s", const(char[4]), ubyte)(const(char[4]) __param_0, ubyte __param_1) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"%s version %s"((parameter) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype, (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_));
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff;
}
uint uint images_wired_isobmff.flagsOf(in images_wired_isobmff.FullBoxHeader f) pure nothrow @nogc @safeflagsOf(in (struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader (parameter) const(images_wired_isobmff.FullBoxHeader) ff) @safe pure nothrow @nogc
=> (parameter) const(images_wired_isobmff.FullBoxHeader) ff.(field) ubyte[3] images_wired_isobmff.FullBoxHeader.flagsflags[0] << 16 | (parameter) const(images_wired_isobmff.FullBoxHeader) ff.(field) ubyte[3] images_wired_isobmff.FullBoxHeader.flagsflags[1] << 8 | (parameter) const(images_wired_isobmff.FullBoxHeader) ff.(field) ubyte[3] images_wired_isobmff.FullBoxHeader.flagsflags[2];
struct (struct) images_wired_isobmff.ExtentExtent
{
ulong (field) ulong images_wired_isobmff.Extent.offsetoffset;
ulong (field) ulong images_wired_isobmff.Extent.lengthlength;
}
struct (struct) images_wired_isobmff.ItemItem
{
uint (field) uint images_wired_isobmff.Item.idid;
char[4] (field) char[4] images_wired_isobmff.Item.typetype;
(alias) object.string = stringstring (field) string images_wired_isobmff.Item.namename;
(struct) images_wired_isobmff.ExtentExtent[] (field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents;
uint[] (field) uint[] images_wired_isobmff.Item.properties1-based indices into ipco
properties; /// 1-based indices into ipco
bool[] (field) bool[] images_wired_isobmff.Item.essentialessential;
}
struct (struct) images_wired_isobmff.PropertyProperty
{
char[4] (field) char[4] images_wired_isobmff.Property.typetype;
(alias) object.size_t = ulongsize_t (field) ulong images_wired_isobmff.Property.atat;
(struct) images_wired_isobmff.ImageSpatialExtentsISO/IEC 23008-12 ispe, after FullBox.
ImageSpatialExtents (field) images_wired_isobmff.ImageSpatialExtents images_wired_isobmff.Property.ispeispe;
ubyte[] (field) ubyte[] images_wired_isobmff.Property.bitsPerChannelpixi
bitsPerChannel; /// pixi
}
struct (struct) images_wired_isobmff.HeifHeif
{
(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box[] (field) images_wired_isobmff.Box[] images_wired_isobmff.Heif.treeevery box visited, depth-first
tree; /// every box visited, depth-first
(alias) object.size_t = ulongsize_t[] (field) ulong[] images_wired_isobmff.Heif.depthdepth;
char[4] (field) char[4] images_wired_isobmff.Heif.majorBrandmajorBrand;
char[4][] (field) char[4][] images_wired_isobmff.Heif.brandsbrands;
char[4] (field) char[4] images_wired_isobmff.Heif.handlerhandler;
uint (field) uint images_wired_isobmff.Heif.primaryprimary;
(struct) images_wired_isobmff.ItemItem[] (field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems;
(struct) images_wired_isobmff.PropertyProperty[] (field) images_wired_isobmff.Property[] images_wired_isobmff.Heif.propertiesproperties;
(struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box (field) images_wired_isobmff.Box images_wired_isobmff.Heif.mdatmdat;
ubyte (field) ubyte images_wired_isobmff.Heif.ilocVersionilocVersion;
ubyte[4] (field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes; /// offset, length, base_offset, index
(alias) object.size_t = ulongsize_t (field) ulong images_wired_isobmff.Heif.pitmAtpitmAt, (field) ulong images_wired_isobmff.Heif.ilocAtilocAt, (field) ulong images_wired_isobmff.Heif.ipmaAtwhere each reference table starts
ipmaAt; /// where each reference table starts
}
/// GAP: an unsigned integer whose width (0, 4 or 8 bytes) came from data.
bool bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar(in ubyte[] (parameter) const(ubyte[]) bytesbytes, ref (alias) object.size_t = ulongsize_t (parameter) ulong pospos, (alias) object.size_t = ulongsize_t (parameter) ulong endend, ubyte (parameter) ubyte widthwidth, out ulong (parameter) ulong valuevalue)
{
if ((parameter) ulong endend - (parameter) ulong pospos < (parameter) ubyte widthwidth)
return false;
(parameter) ulong valuevalue = ulong images_wired_isobmff.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((parameter) const(ubyte[]) bytesbytes, (parameter) ulong pospos, (parameter) ubyte widthwidth);
(parameter) ulong pospos += (parameter) ubyte widthwidth;
return true;
}
/// GAP: the walk, nesting, versions, varying widths and the item tables.
(alias) images_wired_isobmff.BinResult!(images_wired_isobmff.Heif) = sparkles.base.expected.Expected!(Heif, BinError, Abort)BinResult!(struct) images_wired_isobmff.HeifHeif sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.parseHeif(in ubyte[] bytes)GAP
the walk, nesting, versions, varying widths and the item tables.
parseHeif(in ubyte[] (parameter) const(ubyte[]) bytesbytes)
{
(struct) images_wired_isobmff.HeifHeif (local variable) images_wired_isobmff.Heif heifheif;
(struct) images_wired_isobmff.BinErrorBinError images_wired_isobmff.BinError images_wired_isobmff.parseHeif.walk(ulong from, ulong end, ulong level) @systemwalk((alias) object.size_t = ulongsize_t (parameter) ulong fromfrom, (alias) object.size_t = ulongsize_t (parameter) ulong endend, (alias) object.size_t = ulongsize_t (parameter) ulong levellevel)
{
(alias) object.size_t = ulongsize_t (local variable) ulong pospos = (parameter) ulong fromfrom;
while ((local variable) ulong pospos < (parameter) ulong endend)
{
auto (local variable) sparkles.base.expected.Expected!(Box, BinError, Abort) bb = sparkles.base.expected.Expected!(Box, BinError, Abort) images_wired_isobmff.readBox(in ubyte[] bytes, ulong at, ulong parentEnd, bool topLevel)GAP
§4.2.2's header: size, type, then largesize if size == 1, then the
16-byte usertype if type is uuid. Size 0 extends to the end of the file
and is legal only at the top level (libavif avifROStreamReadBoxHeaderPartial).
readBox((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pospos, (parameter) ulong endend, (parameter) ulong levellevel == 0);
if ((local variable) sparkles.base.expected.Expected!(Box, BinError, Abort) bb.bool sparkles.base.expected.Expected!(images_wired_isobmff.Box, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(Box, BinError, Abort) bb.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.Box, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
const (local variable) const(images_wired_isobmff.Box) boxbox = (local variable) sparkles.base.expected.Expected!(Box, BinError, Abort) bb.inout(images_wired_isobmff.Box) sparkles.base.expected.Expected!(images_wired_isobmff.Box, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value;
(local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Box[] images_wired_isobmff.Heif.treeevery box visited, depth-first
tree ~= (local variable) const(images_wired_isobmff.Box) boxbox;
(local variable) images_wired_isobmff.Heif heifheif.(field) ulong[] images_wired_isobmff.Heif.depthdepth ~= (parameter) ulong levellevel;
(struct) images_wired_isobmff.BinErrorBinError (local variable) images_wired_isobmff.BinError ee;
switch ((local variable) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype[])
{
case "ftyp":
auto (local variable) sparkles.base.expected.Expected!(FileTypeFixed, BinError, Abort) ff = sparkles.base.expected.Expected!(FileTypeFixed, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.FileTypeFixed)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.FileTypeFixed§4.3 ftyp, before its compatible brands (which run to the box end).
FileTypeFixed((parameter) const(ubyte[]) bytesbytes[0 .. (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend], (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload);
if ((local variable) sparkles.base.expected.Expected!(FileTypeFixed, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FileTypeFixed, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FileTypeFixed, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FileTypeFixed, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(local variable) images_wired_isobmff.Heif heifheif.(field) char[4] images_wired_isobmff.Heif.majorBrandmajorBrand = (local variable) sparkles.base.expected.Expected!(FileTypeFixed, BinError, Abort) ff.inout(images_wired_isobmff.FileTypeFixed) sparkles.base.expected.Expected!(images_wired_isobmff.FileTypeFixed, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) char[4] images_wired_isobmff.FileTypeFixed.majorBrandmajorBrand;
for ((alias) object.size_t = ulongsize_t (local variable) ulong pp = (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 8; p + 4 <= box.end; p += 4)
{
char[4] (local variable) char[4] brandbrand = cast(const(char)[]) (parameter) const(ubyte[]) bytesbytes[(local variable) ulong pp .. (local variable) ulong pp + 4];
(local variable) images_wired_isobmff.Heif heifheif.(field) char[4][] images_wired_isobmff.Heif.brandsbrands ~= (local variable) char[4] brandbrand;
}
break;
case "meta":
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, 0);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.parseHeif.walk(ulong from, ulong end, ulong level) @systemwalk((local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (parameter) ulong levellevel + 1);
break;
case "iprp", "ipco":
(local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.parseHeif.walk(ulong from, ulong end, ulong level) @systemwalk((local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (parameter) ulong levellevel + 1);
break;
case "hdlr":
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, 0);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
auto (local variable) sparkles.base.expected.Expected!(HandlerFixed, BinError, Abort) hh = sparkles.base.expected.Expected!(HandlerFixed, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.HandlerFixed)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.HandlerFixed§8.4.3 hdlr, after FullBox and before the NUL-terminated name.
HandlerFixed((parameter) const(ubyte[]) bytesbytes[0 .. (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend], (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4);
if ((local variable) sparkles.base.expected.Expected!(HandlerFixed, BinError, Abort) hh.bool sparkles.base.expected.Expected!(images_wired_isobmff.HandlerFixed, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(HandlerFixed, BinError, Abort) hh.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.HandlerFixed, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(local variable) images_wired_isobmff.Heif heifheif.(field) char[4] images_wired_isobmff.Heif.handlerhandler = (local variable) sparkles.base.expected.Expected!(HandlerFixed, BinError, Abort) hh.inout(images_wired_isobmff.HandlerFixed) sparkles.base.expected.Expected!(images_wired_isobmff.HandlerFixed, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) char[4] images_wired_isobmff.HandlerFixed.handlerTypehandlerType;
break;
case "pitm":
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, 1);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
// GAP: item_ID is 16 bits in version 0 and 32 in version 1.
(alias) object.size_t = ulongsize_t (local variable) ulong pp = (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4;
ulong (local variable) ulong idid;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_ == 0 ? 2 : 4, (local variable) ulong idid))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "pitm.item_ID");
(local variable) images_wired_isobmff.Heif heifheif.(field) uint images_wired_isobmff.Heif.primaryprimary = cast(uint) (local variable) ulong idid;
(local variable) images_wired_isobmff.Heif heifheif.(field) ulong images_wired_isobmff.Heif.pitmAtpitmAt = (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart;
break;
case "iinf":
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, 1);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(alias) object.size_t = ulongsize_t (local variable) ulong pp = (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4;
ulong (local variable) ulong countcount;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_ == 0 ? 2 : 4, (local variable) ulong countcount))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iinf.entry_count");
const (local variable) const(ulong) beforebefore = (local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems.(field) ulong images_wired_isobmff.Item[].lengthlength;
(local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.parseHeif.walk(ulong from, ulong end, ulong level) @systemwalk((local variable) ulong pp, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (parameter) ulong levellevel + 1);
if ((local variable) images_wired_isobmff.BinError ee.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind == (enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone && (local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems.(field) ulong images_wired_isobmff.Item[].lengthlength - (local variable) const(ulong) beforebefore != (local variable) ulong countcount)
(local variable) images_wired_isobmff.BinError ee = (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.checkFailed = 3checkFailed, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, "iinf entry_count differs from its infe boxes");
break;
case "infe":
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, 3);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_ != 2)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badVersion = 5badVersion, (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload, "infe version other than 2 not described");
auto (local variable) sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) vv = sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.ItemInfoEntryV2)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
ItemInfoEntryV2((parameter) const(ubyte[]) bytesbytes[0 .. (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend], (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4);
if ((local variable) sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) vv.bool sparkles.base.expected.Expected!(images_wired_isobmff.ItemInfoEntryV2, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) vv.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.ItemInfoEntryV2, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(struct) images_wired_isobmff.ItemItem (local variable) images_wired_isobmff.Item itemitem = (struct) images_wired_isobmff.ItemItem((local variable) sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) vv.inout(images_wired_isobmff.ItemInfoEntryV2) sparkles.base.expected.Expected!(images_wired_isobmff.ItemInfoEntryV2, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ushort images_wired_isobmff.ItemInfoEntryV2.itemIditemId, (local variable) sparkles.base.expected.Expected!(ItemInfoEntryV2, BinError, Abort) vv.inout(images_wired_isobmff.ItemInfoEntryV2) sparkles.base.expected.Expected!(images_wired_isobmff.ItemInfoEntryV2, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) char[4] images_wired_isobmff.ItemInfoEntryV2.itemTypeitemType);
foreach ((parameter) images_wired_isobmff.Item otherother; (local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems)
if ((local variable) images_wired_isobmff.Item otherother.(field) uint images_wired_isobmff.Item.idid == (local variable) images_wired_isobmff.Item itemitem.(field) uint images_wired_isobmff.Item.idid)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.duplicate = 7duplicate, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, "infe item_ID repeated");
// GAP: a NUL-terminated name inside the box.
(alias) object.size_t = ulongsize_t (local variable) ulong pp = (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 12;
const (local variable) const(ulong) nameStartnameStart = (local variable) ulong pp;
while ((local variable) ulong pp < (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend && (parameter) const(ubyte[]) bytesbytes[(local variable) ulong pp] != 0)
(local variable) ulong pp++;
if ((local variable) ulong pp == (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) const(ulong) nameStartnameStart, "infe.item_name has no NUL");
(local variable) images_wired_isobmff.Item itemitem.(field) string images_wired_isobmff.Item.namename = cast((alias) object.string = stringstring) (parameter) const(ubyte[]) bytesbytes[(local variable) const(ulong) nameStartnameStart .. (local variable) ulong pp].immutable(ubyte)[] object.idup!(const(ubyte))(const(ubyte)[] a) pure nothrow @property @safeProvide the .idup array property, which creates an immutable duplicate.
idup;
(local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems ~= (local variable) images_wired_isobmff.Item itemitem;
break;
case "iloc":
(local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.parseIloc(in ubyte[] bytes, in images_wired_isobmff.Box box, ref images_wired_isobmff.Heif heif)GAP
§8.11.3 iloc. Four 4-bit fields set the widths of fields that
follow; version 1 adds construction_method, version 2 widens the item
count and IDs to 32 bits.
parseIloc((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, (local variable) images_wired_isobmff.Heif heifheif);
break;
case "ispe", "pixi":
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, 0);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(struct) images_wired_isobmff.PropertyProperty (local variable) images_wired_isobmff.Property propprop = (struct) images_wired_isobmff.PropertyProperty((local variable) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart);
if ((local variable) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype == "ispe")
{
auto (local variable) sparkles.base.expected.Expected!(ImageSpatialExtents, BinError, Abort) vv = sparkles.base.expected.Expected!(ImageSpatialExtents, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.ImageSpatialExtents)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.ImageSpatialExtentsISO/IEC 23008-12 ispe, after FullBox.
ImageSpatialExtents((parameter) const(ubyte[]) bytesbytes[0 .. (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend], (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4);
if ((local variable) sparkles.base.expected.Expected!(ImageSpatialExtents, BinError, Abort) vv.bool sparkles.base.expected.Expected!(images_wired_isobmff.ImageSpatialExtents, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(ImageSpatialExtents, BinError, Abort) vv.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.ImageSpatialExtents, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
(local variable) images_wired_isobmff.Property propprop.(field) images_wired_isobmff.ImageSpatialExtents images_wired_isobmff.Property.ispeispe = (local variable) sparkles.base.expected.Expected!(ImageSpatialExtents, BinError, Abort) vv.inout(images_wired_isobmff.ImageSpatialExtents) sparkles.base.expected.Expected!(images_wired_isobmff.ImageSpatialExtents, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value;
}
else
{
// GAP: a count byte, then that many bytes.
const (local variable) const(ulong) pp = (local variable) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4;
if ((local variable) const(ulong) pp >= (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend || (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend - (local variable) const(ulong) pp - 1 < (parameter) const(ubyte[]) bytesbytes[(local variable) const(ulong) pp])
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) const(ulong) pp, "pixi.bits_per_channel");
(local variable) images_wired_isobmff.Property propprop.(field) ubyte[] images_wired_isobmff.Property.bitsPerChannelpixi
bitsPerChannel = (parameter) const(ubyte[]) bytesbytes[(local variable) const(ulong) pp + 1 .. (local variable) const(ulong) pp + 1 + (parameter) const(ubyte[]) bytesbytes[(local variable) const(ulong) pp]].ubyte[] object.dup!ubyte(const(ubyte)[] a) pure nothrow @property @safedup;
}
(local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Property[] images_wired_isobmff.Heif.propertiesproperties ~= (local variable) images_wired_isobmff.Property propprop;
break;
case "ipma":
(local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.parseIpma(in ubyte[] bytes, in images_wired_isobmff.Box box, ref images_wired_isobmff.Heif heif)GAP
ISO/IEC 23008-12 ipma. Item IDs are 16 bits in version 0, 32 in
version 1; with flags bit 0 an association is 16 bits (1 essential bit,
15-bit index), else 8 bits (1 + 7).
parseIpma((parameter) const(ubyte[]) bytesbytes, (local variable) const(images_wired_isobmff.Box) boxbox, (local variable) images_wired_isobmff.Heif heifheif);
break;
case "mdat":
(local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Box images_wired_isobmff.Heif.mdatmdat = (local variable) const(images_wired_isobmff.Box) boxbox;
break;
default:
if ((parameter) ulong levellevel != 0)
(local variable) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Property[] images_wired_isobmff.Heif.propertiesproperties ~= (struct) images_wired_isobmff.PropertyProperty((local variable) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart); // ipco keeps unknown properties
break; // unknown boxes are skipped by their size
}
if ((local variable) images_wired_isobmff.BinError ee.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind != (enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone)
return (local variable) images_wired_isobmff.BinError ee;
(local variable) ulong pospos = (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend;
}
return (struct) images_wired_isobmff.BinErrorBinError.(constant) images_wired_isobmff.BinError images_wired_isobmff.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
auto (local variable) images_wired_isobmff.BinError ee = images_wired_isobmff.BinError images_wired_isobmff.parseHeif.walk(ulong from, ulong end, ulong level) @systemwalk(0, (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength, 0);
if ((local variable) images_wired_isobmff.BinError ee.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind != (enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.none = cast(ubyte)0unone)
return sparkles.base.expected.Expected!(Heif, BinError, Abort) sparkles.base.expected.err!(images_wired_isobmff.Heif, sparkles.base.expected.Abort, images_wired_isobmff.BinError)(ref images_wired_isobmff.BinError err) pure nothrow @nogc @safeCreates an Expected object from an error value, with type inference.
Examples
// implicit void value type
{
auto res = err("foo");
static assert(is(typeof(res) == Expected!(void, string)));
assert(!res);
assert(res.error == "foo");
}
// bool
{
auto res = err!int("42");
static assert(is(typeof(res) == Expected!(int, string)));
assert(!res);
assert(res.error == "42");
}
// other error type
{
auto res = err!bool(42);
static assert(is(typeof(res) == Expected!(bool, int)));
assert(!res);
assert(res.error == 42);
}
err!(struct) images_wired_isobmff.HeifHeif((local variable) images_wired_isobmff.BinError ee);
return sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.resolve(in ubyte[] bytes, ref images_wired_isobmff.Heif heif)GAP
the references by ID and index, checked after the whole tree is read.
resolve((parameter) const(ubyte[]) bytesbytes, (local variable) images_wired_isobmff.Heif heifheif);
}
/// GAP: §8.11.3 `iloc`. Four 4-bit fields set the widths of fields that
/// follow; version 1 adds `construction_method`, version 2 widens the item
/// count and IDs to 32 bits.
(struct) images_wired_isobmff.BinErrorBinError images_wired_isobmff.BinError images_wired_isobmff.parseIloc(in ubyte[] bytes, in images_wired_isobmff.Box box, ref images_wired_isobmff.Heif heif)GAP
§8.11.3 iloc. Four 4-bit fields set the widths of fields that
follow; version 1 adds construction_method, version 2 widens the item
count and IDs to 32 bits.
parseIloc(in ubyte[] (parameter) const(ubyte[]) bytesbytes, in (struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box (parameter) const(images_wired_isobmff.Box) boxbox, ref (struct) images_wired_isobmff.HeifHeif (parameter) images_wired_isobmff.Heif heifheif)
{
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (parameter) const(images_wired_isobmff.Box) boxbox, 2);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
const (local variable) const(ubyte) vv = (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_;
(parameter) images_wired_isobmff.Heif heifheif.(field) ubyte images_wired_isobmff.Heif.ilocVersionilocVersion = (local variable) const(ubyte) vv;
(parameter) images_wired_isobmff.Heif heifheif.(field) ulong images_wired_isobmff.Heif.ilocAtilocAt = (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart;
(alias) object.size_t = ulongsize_t (local variable) ulong pp = (parameter) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4;
if ((parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend - (local variable) ulong pp < 2)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iloc sizes");
(parameter) images_wired_isobmff.Heif heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes = [(parameter) const(ubyte[]) bytesbytes[(local variable) ulong pp] >> 4, (parameter) const(ubyte[]) bytesbytes[(local variable) ulong pp] & 0xF, (parameter) const(ubyte[]) bytesbytes[(local variable) ulong pp + 1] >> 4, (local variable) const(ubyte) vv ? (parameter) const(ubyte[]) bytesbytes[(local variable) ulong pp + 1] & 0xF : 0];
(local variable) ulong pp += 2;
foreach ((parameter) ubyte sizesize; (parameter) images_wired_isobmff.Heif heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes)
if ((local variable) ubyte sizesize != 0 && (local variable) ubyte sizesize != 4 && (local variable) ubyte sizesize != 8)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.checkFailed = 3checkFailed, (parameter) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4, string std.format.format!("iloc field size %s", ubyte)(ubyte __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"iloc field size %s"((local variable) ubyte sizesize));
const ubyte (local variable) const(ubyte) offsetSizeoffsetSize = (parameter) images_wired_isobmff.Heif heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[0], (local variable) const(ubyte) lengthSizelengthSize = (parameter) images_wired_isobmff.Heif heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[1],
(local variable) const(ubyte) baseSizebaseSize = (parameter) images_wired_isobmff.Heif heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[2], (local variable) const(ubyte) indexSizeindexSize = (parameter) images_wired_isobmff.Heif heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[3];
ulong (local variable) ulong countcount;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(ubyte) vv < 2 ? 2 : 4, (local variable) ulong countcount))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iloc.item_count");
foreach ((local variable) ulong __; 0 .. (local variable) ulong countcount)
{
ulong (local variable) ulong idid, (local variable) ulong methodmethod, (local variable) ulong drefdref, (local variable) ulong basebase, (local variable) ulong extentCountextentCount;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(ubyte) vv < 2 ? 2 : 4, (local variable) ulong idid))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iloc.item_ID");
if ((local variable) const(ubyte) vv >= 1)
{
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, 2, (local variable) ulong methodmethod))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iloc.construction_method");
if (((local variable) ulong methodmethod & 0xFFF0) != 0 || ((local variable) ulong methodmethod & 0xF) != 0)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.checkFailed = 3checkFailed, (local variable) ulong pp - 2, "only construction_method 0 is described");
}
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, 2, (local variable) ulong drefdref) || !bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(ubyte) baseSizebaseSize, (local variable) ulong basebase)
|| !bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, 2, (local variable) ulong extentCountextentCount))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iloc item");
(struct) images_wired_isobmff.ItemItem* (local variable) images_wired_isobmff.Item* itemitem;
foreach (ref (parameter) images_wired_isobmff.Item candidatecandidate; (parameter) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems)
if ((local variable) images_wired_isobmff.Item candidatecandidate.(field) uint images_wired_isobmff.Item.idid == (local variable) ulong idid)
(local variable) images_wired_isobmff.Item* itemitem = &(local variable) images_wired_isobmff.Item candidatecandidate;
if ((local variable) images_wired_isobmff.Item* itemitem is null)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badReference = 6badReference, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, string std.format.format!("iloc names item %s, absent from iinf", ulong)(ulong __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"iloc names item %s, absent from iinf"((local variable) ulong idid));
if ((local variable) images_wired_isobmff.Item* itemitem.(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents.(field) ulong images_wired_isobmff.Extent[].lengthlength)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.duplicate = 7duplicate, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, string std.format.format!("item %s located twice", ulong)(ulong __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"item %s located twice"((local variable) ulong idid));
foreach ((parameter) ulong ____; 0 .. (local variable) ulong extentCountextentCount)
{
ulong (local variable) ulong indexindex, (local variable) ulong offsetoffset, (local variable) ulong lengthlength;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(ubyte) indexSizeindexSize, (local variable) ulong indexindex) || !bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(ubyte) offsetSizeoffsetSize, (local variable) ulong offsetoffset)
|| !bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(ubyte) lengthSizelengthSize, (local variable) ulong lengthlength))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "iloc extent");
if ((local variable) ulong offsetoffset > ulong.(constant) ulong ulong.max = 18446744073709551615LUmax - (local variable) ulong basebase)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badSize = 4badSize, (local variable) ulong pp, "iloc offset overflows");
(local variable) images_wired_isobmff.Item* itemitem.(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents ~= (struct) images_wired_isobmff.ExtentExtent((local variable) ulong basebase + (local variable) ulong offsetoffset, (local variable) ulong lengthlength);
}
}
return (struct) images_wired_isobmff.BinErrorBinError.(constant) images_wired_isobmff.BinError images_wired_isobmff.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
/// GAP: ISO/IEC 23008-12 `ipma`. Item IDs are 16 bits in version 0, 32 in
/// version 1; with flags bit 0 an association is 16 bits (1 essential bit,
/// 15-bit index), else 8 bits (1 + 7).
(struct) images_wired_isobmff.BinErrorBinError images_wired_isobmff.BinError images_wired_isobmff.parseIpma(in ubyte[] bytes, in images_wired_isobmff.Box box, ref images_wired_isobmff.Heif heif)GAP
ISO/IEC 23008-12 ipma. Item IDs are 16 bits in version 0, 32 in
version 1; with flags bit 0 an association is 16 bits (1 essential bit,
15-bit index), else 8 bits (1 + 7).
parseIpma(in ubyte[] (parameter) const(ubyte[]) bytesbytes, in (struct) images_wired_isobmff.BoxA box located in the input: [start, end) with the payload after
headerSize bytes.
Box (parameter) const(images_wired_isobmff.Box) boxbox, ref (struct) images_wired_isobmff.HeifHeif (parameter) images_wired_isobmff.Heif heifheif)
{
auto (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff = sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) images_wired_isobmff.readFull(in ubyte[] bytes, in images_wired_isobmff.Box box, ubyte maxVersion)GAP
a FullBox's version and flags, with the versions a box accepts.
readFull((parameter) const(ubyte[]) bytesbytes, (parameter) const(images_wired_isobmff.Box) boxbox, 1);
if ((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.bool sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
return (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error;
const (local variable) const(bool) widewide = (uint images_wired_isobmff.flagsOf(in images_wired_isobmff.FullBoxHeader f) pure nothrow @nogc @safeflagsOf((local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value) & 1) != 0;
(parameter) images_wired_isobmff.Heif heifheif.(field) ulong images_wired_isobmff.Heif.ipmaAtwhere each reference table starts
ipmaAt = (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart;
(alias) object.size_t = ulongsize_t (local variable) ulong pp = (parameter) const(images_wired_isobmff.Box) boxbox.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload + 4;
ulong (local variable) ulong countcount;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, 4, (local variable) ulong countcount))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "ipma.entry_count");
foreach ((local variable) ulong __; 0 .. (local variable) ulong countcount)
{
ulong (local variable) ulong idid, (local variable) ulong associationsassociations;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) sparkles.base.expected.Expected!(FullBoxHeader, BinError, Abort) ff.inout(images_wired_isobmff.FullBoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.FullBoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value.(field) ubyte images_wired_isobmff.FullBoxHeader.version_version_ == 0 ? 2 : 4, (local variable) ulong idid) || !bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, 1, (local variable) ulong associationsassociations))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "ipma entry");
(struct) images_wired_isobmff.ItemItem* (local variable) images_wired_isobmff.Item* itemitem;
foreach (ref (parameter) images_wired_isobmff.Item candidatecandidate; (parameter) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems)
if ((local variable) images_wired_isobmff.Item candidatecandidate.(field) uint images_wired_isobmff.Item.idid == (local variable) ulong idid)
(local variable) images_wired_isobmff.Item* itemitem = &(local variable) images_wired_isobmff.Item candidatecandidate;
if ((local variable) images_wired_isobmff.Item* itemitem is null)
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badReference = 6badReference, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, string std.format.format!("ipma names item %s, absent from iinf", ulong)(ulong __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"ipma names item %s, absent from iinf"((local variable) ulong idid));
foreach ((parameter) ulong ____; 0 .. (local variable) ulong associationsassociations)
{
ulong (local variable) ulong rawraw;
if (!bool images_wired_isobmff.readVar(in ubyte[] bytes, ref ulong pos, ulong end, ubyte width, out ulong value)GAP
an unsigned integer whose width (0, 4 or 8 bytes) came from data.
readVar((parameter) const(ubyte[]) bytesbytes, (local variable) ulong pp, (parameter) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend, (local variable) const(bool) widewide ? 2 : 1, (local variable) ulong rawraw))
return (struct) images_wired_isobmff.BinErrorBinError((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.truncated = 1truncated, (local variable) ulong pp, "ipma association");
const (local variable) const(int) essentialBitessentialBit = (local variable) const(bool) widewide ? 0x8000 : 0x80;
(local variable) images_wired_isobmff.Item* itemitem.(field) uint[] images_wired_isobmff.Item.properties1-based indices into ipco
properties ~= cast(uint)((local variable) ulong rawraw & ((local variable) const(int) essentialBitessentialBit - 1));
(local variable) images_wired_isobmff.Item* itemitem.(field) bool[] images_wired_isobmff.Item.essentialessential ~= ((local variable) ulong rawraw & (local variable) const(int) essentialBitessentialBit) != 0;
}
}
return (struct) images_wired_isobmff.BinErrorBinError.(constant) images_wired_isobmff.BinError images_wired_isobmff.BinError.init = BinError(BinErrorKind.none, 0LU, null)init;
}
/// GAP: the references by ID and index, checked after the whole tree is read.
(alias) images_wired_isobmff.BinResult!(images_wired_isobmff.Heif) = sparkles.base.expected.Expected!(Heif, BinError, Abort)BinResult!(struct) images_wired_isobmff.HeifHeif sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.resolve(in ubyte[] bytes, ref images_wired_isobmff.Heif heif)GAP
the references by ID and index, checked after the whole tree is read.
resolve(in ubyte[] (parameter) const(ubyte[]) bytesbytes, ref (struct) images_wired_isobmff.HeifHeif (parameter) images_wired_isobmff.Heif heifheif)
{
alias (alias) images_wired_isobmff.resolve.bad = sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.fail(T)(images_wired_isobmff.BinErrorKind kind, ulong at, string what) pure nothrow @nogc @safebad = sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.fail(T)(images_wired_isobmff.BinErrorKind kind, ulong at, string what) pure nothrow @nogc @safefail!(struct) images_wired_isobmff.HeifHeif;
bool (local variable) bool foundfound;
foreach ((parameter) images_wired_isobmff.Item itemitem; (parameter) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems)
(local variable) bool foundfound |= (local variable) images_wired_isobmff.Item itemitem.(field) uint images_wired_isobmff.Item.idid == (parameter) images_wired_isobmff.Heif heifheif.(field) uint images_wired_isobmff.Heif.primaryprimary;
if (!(local variable) bool foundfound)
return bad((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badReference = 6badReference, (parameter) images_wired_isobmff.Heif heifheif.(field) ulong images_wired_isobmff.Heif.pitmAtpitmAt, string std.format.format!("pitm names item %s, absent from iinf", uint)(uint __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"pitm names item %s, absent from iinf"((parameter) images_wired_isobmff.Heif heifheif.(field) uint images_wired_isobmff.Heif.primaryprimary));
foreach ((parameter) images_wired_isobmff.Item itemitem; (parameter) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems)
{
foreach ((parameter) ulong ii, (parameter) uint indexindex; (local variable) images_wired_isobmff.Item itemitem.(field) uint[] images_wired_isobmff.Item.properties1-based indices into ipco
properties)
if ((local variable) uint indexindex == 0 ? (local variable) images_wired_isobmff.Item itemitem.(field) bool[] images_wired_isobmff.Item.essentialessential[(local variable) ulong ii] : (local variable) uint indexindex > (parameter) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Property[] images_wired_isobmff.Heif.propertiesproperties.(field) ulong images_wired_isobmff.Property[].lengthlength)
return bad((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badReference = 6badReference, (parameter) images_wired_isobmff.Heif heifheif.(field) ulong images_wired_isobmff.Heif.ipmaAtwhere each reference table starts
ipmaAt,
string std.format.format!("item %s names property %s of %s", uint, uint, ulong)(uint __param_0, uint __param_1, ulong __param_2) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"item %s names property %s of %s"((local variable) images_wired_isobmff.Item itemitem.(field) uint images_wired_isobmff.Item.idid, (local variable) uint indexindex, (parameter) images_wired_isobmff.Heif heifheif.(field) images_wired_isobmff.Property[] images_wired_isobmff.Heif.propertiesproperties.(field) ulong images_wired_isobmff.Property[].lengthlength));
foreach ((parameter) images_wired_isobmff.Extent extentextent; (local variable) images_wired_isobmff.Item itemitem.(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents)
if ((local variable) images_wired_isobmff.Extent extentextent.(field) ulong images_wired_isobmff.Extent.offsetoffset > (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength || (local variable) images_wired_isobmff.Extent extentextent.(field) ulong images_wired_isobmff.Extent.lengthlength > (parameter) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength - (local variable) images_wired_isobmff.Extent extentextent.(field) ulong images_wired_isobmff.Extent.offsetoffset)
return bad((enum) images_wired_isobmff.BinErrorKindBinErrorKind.(enum value) images_wired_isobmff.BinErrorKind.badReference = 6badReference, (parameter) images_wired_isobmff.Heif heifheif.(field) ulong images_wired_isobmff.Heif.ilocAtilocAt, string std.format.format!("item %s extent outside the file", uint)(uint __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"item %s extent outside the file"((local variable) images_wired_isobmff.Item itemitem.(field) uint images_wired_isobmff.Item.idid));
}
return sparkles.base.expected.Expected!(Heif, BinError, Abort) sparkles.base.expected.ok!(images_wired_isobmff.BinError, sparkles.base.expected.Abort, images_wired_isobmff.Heif)(ref images_wired_isobmff.Heif value) pure nothrow @nogc @safeCreates an Expected object from an expected value, with type inference.
ok!(struct) images_wired_isobmff.BinErrorBinError((parameter) images_wired_isobmff.Heif heifheif);
}
// ---------------------------------------------------------------------------
// Building an input in memory
// ---------------------------------------------------------------------------
/// GAP on encode: box sizes and `iloc` offsets are only known after the
/// bytes they cover are written, so they are back-patched.
struct (struct) images_wired_isobmff.BoxWriterGAP on encode: box sizes and iloc offsets are only known after the
bytes they cover are written, so they are back-patched.
BoxWriter
{
ubyte[] (field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes;
(alias) object.size_t = ulongsize_t[] (field) ulong[] images_wired_isobmff.BoxWriter.openopen;
void void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin((alias) object.string = stringstring (parameter) string typetype, bool (parameter) bool largelarge = false)
{
(field) ulong[] images_wired_isobmff.BoxWriter.openopen ~= (field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes.(field) ulong ubyte[].lengthlength;
const (local variable) const(string) refusedrefused = string images_wired_isobmff.encodeFixed!(images_wired_isobmff.BoxHeader)(in images_wired_isobmff.BoxHeader value, ref ubyte[] output) pure nothrow @safeEncodes a fixed record after its checks pass, as expressiveness §6.4
requires of encode. Returns the first failure's reason, or null.
encodeFixed((struct) images_wired_isobmff.BoxHeader§4.2.2: "unsigned int(32) size; unsigned int(32) type = boxtype;"
BoxHeader((parameter) bool largelarge ? 1 : 0, (parameter) string typetype[0 .. 4]), (field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes);
assert((local variable) const(string) refusedrefused is null, (local variable) const(string) refusedrefused);
if ((parameter) bool largelarge)
(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= new ubyte[8];
}
void void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull((alias) object.string = stringstring (parameter) string typetype, ubyte (parameter) ubyte version_version_, uint (parameter) uint flagsflags = 0)
{
void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin((parameter) string typetype);
void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.FullBoxHeader)(in images_wired_isobmff.FullBoxHeader value) pure nothrow @safeput((struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader((parameter) ubyte version_version_, [cast(ubyte)((parameter) uint flagsflags >> 16), cast(ubyte)((parameter) uint flagsflags >> 8), cast(ubyte) (parameter) uint flagsflags]));
}
void void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value) pure nothrow @safeput(T)(in (alias) T = images_wired_isobmff.ItemInfoEntryV2T (parameter) const(images_wired_isobmff.ItemInfoEntryV2) valuevalue)
{
const (local variable) const(string) refusedrefused = string images_wired_isobmff.encodeFixed!(images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value, ref ubyte[] output) pure nothrow @safeEncodes a fixed record after its checks pass, as expressiveness §6.4
requires of encode. Returns the first failure's reason, or null.
encodeFixed((parameter) const(images_wired_isobmff.ItemInfoEntryV2) valuevalue, (field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes);
assert((local variable) const(string) refusedrefused is null, (local variable) const(string) refusedrefused);
}
void void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(ulong (parameter) ulong valuevalue, (alias) object.size_t = ulongsize_t (parameter) ulong widthwidth)
{
foreach_reverse ((local variable) ulong kk; 0 .. (parameter) ulong widthwidth)
(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= cast(ubyte)((parameter) ulong valuevalue >> (8 * (local variable) ulong kk));
}
void void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((alias) object.size_t = ulongsize_t (parameter) ulong atat, ulong (parameter) ulong valuevalue, (alias) object.size_t = ulongsize_t (parameter) ulong widthwidth)
{
foreach ((local variable) ulong kk; 0 .. (parameter) ulong widthwidth)
(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes[(parameter) ulong atat + (local variable) ulong kk] = cast(ubyte)((parameter) ulong valuevalue >> (8 * ((parameter) ulong widthwidth - 1 - (local variable) ulong kk)));
}
/// Closes the innermost box; `toEnd` leaves size 0.
void void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end(bool (parameter) bool toEndtoEnd = false)
{
const (local variable) const(ulong) startstart = (field) ulong[] images_wired_isobmff.BoxWriter.openopen[$ - 1];
(field) ulong[] images_wired_isobmff.BoxWriter.openopen = (field) ulong[] images_wired_isobmff.BoxWriter.openopen[0 .. $ - 1];
if ((parameter) bool toEndtoEnd)
return;
if (ulong images_wired_isobmff.readBe(in ubyte[] bytes, ulong at, ulong width) pure nothrow @nogc @safereadBe((field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes, (local variable) const(ulong) startstart, 4) == 1)
void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((local variable) const(ulong) startstart + 8, (field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes.(field) ulong ubyte[].lengthlength - (local variable) const(ulong) startstart, 8);
else
void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((local variable) const(ulong) startstart, (field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes.(field) ulong ubyte[].lengthlength - (local variable) const(ulong) startstart, 4);
}
}
enum (enum) images_wired_isobmff.VariantVariant
{
(enum value) images_wired_isobmff.Variant.valid = 0valid,
(enum value) images_wired_isobmff.Variant.childOverrun = 1childOverrun,
(enum value) images_wired_isobmff.Variant.sizeZeroNested = 2sizeZeroNested,
(enum value) images_wired_isobmff.Variant.ilocFieldSize3 = 3ilocFieldSize3,
(enum value) images_wired_isobmff.Variant.extentOutside = 4extentOutside,
(enum value) images_wired_isobmff.Variant.propertyMissing = 5propertyMissing,
(enum value) images_wired_isobmff.Variant.primaryMissing = 6primaryMissing,
(enum value) images_wired_isobmff.Variant.sizeBelowHeader = 7sizeBelowHeader,
}
immutable ubyte[] (immutable global) immutable(ubyte[]) images_wired_isobmff.av1Payloadav1Payload = cast(immutable(ubyte)[]) "AV1-OBU-BYTES....";
immutable ubyte[] (immutable global) immutable(ubyte[]) images_wired_isobmff.exifPayloadexifPayload = cast(immutable(ubyte)[]) "\0\0\0\0MM\0*";
ubyte[] ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant (parameter) images_wired_isobmff.Variant variantvariant)
{
(struct) images_wired_isobmff.BoxWriterGAP on encode: box sizes and iloc offsets are only known after the
bytes they cover are written, so they are back-patched.
BoxWriter (local variable) images_wired_isobmff.BoxWriter ww;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin("ftyp");
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.FileTypeFixed)(in images_wired_isobmff.FileTypeFixed value) pure nothrow @safeput((struct) images_wired_isobmff.FileTypeFixed§4.3 ftyp, before its compatible brands (which run to the box end).
FileTypeFixed("avif", 0));
foreach ((parameter) string brandbrand; ["avif", "mif1", "miaf"])
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= cast(const(ubyte)[]) (local variable) string brandbrand;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin("uuid");
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= cast(const(ubyte)[]) "0123456789abcdef"; // the usertype
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= cast(const(ubyte)[]) "note";
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("meta", 0);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("hdlr", 0);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.HandlerFixed)(in images_wired_isobmff.HandlerFixed value) pure nothrow @safeput((struct) images_wired_isobmff.HandlerFixed§8.4.3 hdlr, after FullBox and before the NUL-terminated name.
HandlerFixed(0, "pict", [0, 0, 0]));
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= 0;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("pitm", 0);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be((parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.primaryMissing = 6primaryMissing ? 7 : 1, 2);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("iinf", 0);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(2, 2);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("infe", 2);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value) pure nothrow @safeput((struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
ItemInfoEntryV2(1, 0, "av01"));
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= cast(const(ubyte)[]) "Color\0";
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("infe", 2);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.ItemInfoEntryV2)(in images_wired_isobmff.ItemInfoEntryV2 value) pure nothrow @safeput((struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
ItemInfoEntryV2(2, 0, "Exif"));
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= 0;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("iloc", 1);
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= cast(ubyte)((parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.ilocFieldSize3 = 3ilocFieldSize3 ? 0x34 : 0x44); // offset_size 4, length_size 4
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= 0x00; // base_offset_size 0, index_size 0
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(2, 2); // item_count
(alias) object.size_t = ulongsize_t[2] (local variable) ulong[2] offsetAtoffsetAt;
foreach ((parameter) ulong ii, (parameter) int idid; [1, 2])
{
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be((local variable) int idid, 2);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(0, 2); // reserved, construction_method 0
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(0, 2); // data_reference_index
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(1, 2); // extent_count
(local variable) ulong[2] offsetAtoffsetAt[(local variable) ulong ii] = (local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes.(field) ulong ubyte[].lengthlength;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(0, 4); // extent_offset, patched below
const (local variable) const(ulong) lengthlength = (local variable) ulong ii == 0 ? (immutable global) immutable(ubyte[]) images_wired_isobmff.av1Payloadav1Payload.(field) ulong immutable(ubyte[]).lengthlength : (immutable global) immutable(ubyte[]) images_wired_isobmff.exifPayloadexifPayload.(field) ulong immutable(ubyte[]).lengthlength;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be((parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.extentOutside = 4extentOutside && (local variable) ulong ii == 1 ? 0x7FFF_FFF0 : (local variable) const(ulong) lengthlength, 4);
}
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin("iprp");
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin("ipco");
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("ispe", 0);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.put!(images_wired_isobmff.ImageSpatialExtents)(in images_wired_isobmff.ImageSpatialExtents value) pure nothrow @safeput((struct) images_wired_isobmff.ImageSpatialExtentsISO/IEC 23008-12 ispe, after FullBox.
ImageSpatialExtents(64, 48));
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
const (local variable) const(ulong) pixiAtpixiAt = (local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes.(field) ulong ubyte[].lengthlength;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("pixi", 0);
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= [3, 8, 8, 8];
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.beginFull(string type, ubyte version_, uint flags = 0u)beginFull("ipma", 0, 0);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(2, 4); // entry_count
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(1, 2);
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= 2;
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= 0x01; // ispe, not essential
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= (parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.propertyMissing = 5propertyMissing ? 0x83 : 0x82; // pixi, essential
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.be(ulong value, ulong width)be(2, 2);
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= 0;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end(); // meta
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin("mdat", true); // size 1, 64-bit largesize
const (local variable) const(ulong) payloadAtpayloadAt = (local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes.(field) ulong ubyte[].lengthlength;
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= (immutable global) immutable(ubyte[]) images_wired_isobmff.av1Payloadav1Payload;
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= (immutable global) immutable(ubyte[]) images_wired_isobmff.exifPayloadexifPayload;
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end();
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((local variable) ulong[2] offsetAtoffsetAt[0], (local variable) const(ulong) payloadAtpayloadAt, 4);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((local variable) ulong[2] offsetAtoffsetAt[1], (local variable) const(ulong) payloadAtpayloadAt + (immutable global) immutable(ubyte[]) images_wired_isobmff.av1Payloadav1Payload.(field) ulong immutable(ubyte[]).lengthlength, 4);
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.begin(string type, bool large = false)begin("free");
(local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes ~= [0, 0, 0, 0];
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.end(bool toEnd = false)Closes the innermost box; toEnd leaves size 0.
end(true); // size 0: to the end of the file
if ((parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.childOverrun = 1childOverrun)
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((local variable) const(ulong) pixiAtpixiAt - 20, 200, 4); // ispe claims more than ipco holds
if ((parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.sizeZeroNested = 2sizeZeroNested)
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch((local variable) const(ulong) pixiAtpixiAt, 0, 4);
if ((parameter) images_wired_isobmff.Variant variantvariant == (enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.sizeBelowHeader = 7sizeBelowHeader)
(local variable) images_wired_isobmff.BoxWriter ww.void images_wired_isobmff.BoxWriter.patch(ulong at, ulong value, ulong width)patch(0, 4, 4);
return (local variable) images_wired_isobmff.BoxWriter ww.(field) ubyte[] images_wired_isobmff.BoxWriter.bytesbytes;
}
void void images_wired_isobmff.report(string label, in ubyte[] bytes)report((alias) object.string = stringstring (parameter) string labellabel, in ubyte[] (parameter) const(ubyte[]) bytesbytes)
{
auto (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr = sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.parseHeif(in ubyte[] bytes)GAP
the walk, nesting, versions, varying widths and the item tables.
parseHeif((parameter) const(ubyte[]) bytesbytes);
if ((local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.bool sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasError!()() const pure nothrow @nogc @property @safeChecks if Expected has error
hasError)
void std.stdio.writefln!(char, string, images_wired_isobmff.BinErrorKind, ulong, string)(in char[] fmt, string __param_1, images_wired_isobmff.BinErrorKind __param_2, ulong __param_3, string __param_4) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: %s: %s at offset %s (%s)", (parameter) string labellabel, (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error.(field) images_wired_isobmff.BinErrorKind images_wired_isobmff.BinError.kindkind, (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error.(field) ulong images_wired_isobmff.BinError.offsetoffset, (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error.(field) string images_wired_isobmff.BinError.whatwhat);
else
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: %s: ok", (parameter) string labellabel);
}
void void D main()main()
{
void std.stdio.writefln!(char, long, long, long, long, long, long)(in char[] fmt, long __param_1, long __param_2, long __param_3, long __param_4, long __param_5, long __param_6) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: schema sizes: BoxHeader %s, FullBoxHeader %s, ftyp %s, hdlr %s, infe v2 %s, ispe %s bytes",
long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.BoxHeader)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (struct) images_wired_isobmff.BoxHeader§4.2.2: "unsigned int(32) size; unsigned int(32) type = boxtype;"
BoxHeader), 0), long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.FullBoxHeader)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (struct) images_wired_isobmff.FullBoxHeader§4.2.2 FullBox: "unsigned int(8) version; bit(24) flags;" There is no
24-bit leaf, so the flags are three bytes.
FullBoxHeader), 0),
long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.FileTypeFixed)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (struct) images_wired_isobmff.FileTypeFixed§4.3 ftyp, before its compatible brands (which run to the box end).
FileTypeFixed), 0), long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.HandlerFixed)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (struct) images_wired_isobmff.HandlerFixed§8.4.3 hdlr, after FullBox and before the NUL-terminated name.
HandlerFixed), 0),
long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.ItemInfoEntryV2)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (struct) images_wired_isobmff.ItemInfoEntryV2§8.11.6 infe version 2, after FullBox and before the name.
ItemInfoEntryV2), 0), long images_wired_isobmff.fixedSize(const(sparkles.wired.schema.WireSchema) schema, ulong index) pure nothrow @safeByte size of the subtree at index, or -1 when the schema gives none.
Takes the schema by value: as an in parameter, CTFE fails on DMD and crashes LDC.
fixedSize((template instance) sparkles.wired.schema.wireSchemaOf!(images_wired_isobmff.BeFixed, images_wired_isobmff.ImageSpatialExtents)wireSchemaOf!((struct) images_wired_isobmff.BeFixedFormat marker. Its schema hook admits only fixed-size shapes; the byte
order is a property of the marker, since SchemaNode has no such field.
BeFixed, (struct) images_wired_isobmff.ImageSpatialExtentsISO/IEC 23008-12 ispe, after FullBox.
ImageSpatialExtents), 0));
const (local variable) const(ubyte[]) bytesbytes = ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.valid = 0valid);
auto (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr = sparkles.base.expected.Expected!(Heif, BinError, Abort) images_wired_isobmff.parseHeif(in ubyte[] bytes)GAP
the walk, nesting, versions, varying widths and the item tables.
parseHeif((local variable) const(ubyte[]) bytesbytes);
assert((local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.bool sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).hasValue!()() const pure nothrow @nogc @property @safeChecks if Expected has value
hasValue, (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.inout(images_wired_isobmff.BinError) sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).error() inout pure nothrow @nogc @property ref @safeReturns the error value. May only be called when hasValue returns false.
If there is no error value, it calls hook's onAccessEmptyError.
It returns E.init when hook doesn't provide onAccessEmptyError.
Note
Error is returned by reference only when hook provides onAccessEmptyError.
Otherwise the E.init fallback forces it to be returned by value (a copy).
error.(field) string images_wired_isobmff.BinError.whatwhat);
const (local variable) const(images_wired_isobmff.Heif) heifheif = (local variable) sparkles.base.expected.Expected!(Heif, BinError, Abort) rr.inout(images_wired_isobmff.Heif) sparkles.base.expected.Expected!(images_wired_isobmff.Heif, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value;
void std.stdio.writefln!(char, ulong, ulong, const(char[4]), const(char[4])[], const(char[4]))(in char[] fmt, ulong __param_1, ulong __param_2, const(char[4]) __param_3, const(char[4])[] __param_4, const(char[4]) __param_5) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: valid: %s bytes, %s boxes, brand %s %s, handler %s",
(local variable) const(ubyte[]) bytesbytes.(field) ulong const(ubyte[]).lengthlength, (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Box[] images_wired_isobmff.Heif.treeevery box visited, depth-first
tree.(field) ulong const(images_wired_isobmff.Box[]).lengthlength, (local variable) const(images_wired_isobmff.Heif) heifheif.(field) char[4] images_wired_isobmff.Heif.majorBrandmajorBrand, (local variable) const(images_wired_isobmff.Heif) heifheif.(field) char[4][] images_wired_isobmff.Heif.brandsbrands, (local variable) const(images_wired_isobmff.Heif) heifheif.(field) char[4] images_wired_isobmff.Heif.handlerhandler);
foreach ((parameter) ulong ii, (parameter) const(images_wired_isobmff.Box) boxbox; (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Box[] images_wired_isobmff.Heif.treeevery box visited, depth-first
tree)
{
(alias) object.string = stringstring (local variable) string notenote = (local variable) const(images_wired_isobmff.Box) boxbox.(field) bool images_wired_isobmff.Box.largesize was 1 and largesize followed
large ? " largesize" : (local variable) const(images_wired_isobmff.Box) boxbox.(field) bool images_wired_isobmff.Box.toEndsize was 0
toEnd ? " size 0 (to end)" : "";
if ((local variable) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype == "uuid")
(local variable) string notenote ~= " usertype " ~ cast((alias) object.string = stringstring) (local variable) const(images_wired_isobmff.Box) boxbox.(field) ubyte[16] images_wired_isobmff.Box.usertypefor uuid
usertype[].immutable(ubyte)[] object.idup!(const(ubyte))(const(ubyte)[] a) pure nothrow @property @safeProvide the .idup array property, which creates an immutable duplicate.
idup;
void std.stdio.writefln!(char, ulong, string, const(char[4]), const(ulong), const(ulong), const(ulong), string)(in char[] fmt, ulong __param_1, string __param_2, const(char[4]) __param_3, const(ulong) __param_4, const(ulong) __param_5, const(ulong) __param_6, string __param_7) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: %*s%s @%s header %s size %s%s", 2 * (local variable) const(images_wired_isobmff.Heif) heifheif.(field) ulong[] images_wired_isobmff.Heif.depthdepth[(local variable) ulong ii], "", (local variable) const(images_wired_isobmff.Box) boxbox.(field) char[4] images_wired_isobmff.Box.typetype,
(local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.headerSizeheaderSize, (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.endend - (local variable) const(images_wired_isobmff.Box) boxbox.(field) ulong images_wired_isobmff.Box.startstart, (local variable) string notenote);
}
void std.stdio.writefln!(char, const(ubyte), const(ubyte), const(ubyte), const(ubyte), const(ubyte))(in char[] fmt, const(ubyte) __param_1, const(ubyte) __param_2, const(ubyte) __param_3, const(ubyte) __param_4, const(ubyte) __param_5) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: iloc version %s, field sizes offset %s length %s base_offset %s index %s",
(local variable) const(images_wired_isobmff.Heif) heifheif.(field) ubyte images_wired_isobmff.Heif.ilocVersionilocVersion, (local variable) const(images_wired_isobmff.Heif) heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[0], (local variable) const(images_wired_isobmff.Heif) heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[1], (local variable) const(images_wired_isobmff.Heif) heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[2], (local variable) const(images_wired_isobmff.Heif) heifheif.(field) ubyte[4] images_wired_isobmff.Heif.ilocSizesoffset, length, base_offset, index
ilocSizes[3]);
foreach ((parameter) const(images_wired_isobmff.Item) itemitem; (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems)
{
(alias) object.string = stringstring (local variable) string propsprops;
foreach ((parameter) ulong ii, (parameter) const(uint) indexindex; (local variable) const(images_wired_isobmff.Item) itemitem.(field) uint[] images_wired_isobmff.Item.properties1-based indices into ipco
properties)
{
const (local variable) const(images_wired_isobmff.Property) propprop = (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Property[] images_wired_isobmff.Heif.propertiesproperties[(local variable) const(uint) indexindex - 1];
(local variable) string propsprops ~= string std.format.format!(" %s%s", const(char[4]), string)(const(char[4]) __param_0, string __param_1) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!" %s%s"((local variable) const(images_wired_isobmff.Property) propprop.(field) char[4] images_wired_isobmff.Property.typetype, (local variable) const(images_wired_isobmff.Item) itemitem.(field) bool[] images_wired_isobmff.Item.essentialessential[(local variable) ulong ii] ? "(essential)" : "");
if ((local variable) const(images_wired_isobmff.Property) propprop.(field) char[4] images_wired_isobmff.Property.typetype == "ispe")
(local variable) string propsprops ~= string std.format.format!("=%sx%s", const(uint), const(uint))(const(uint) __param_0, const(uint) __param_1) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"=%sx%s"((local variable) const(images_wired_isobmff.Property) propprop.(field) images_wired_isobmff.ImageSpatialExtents images_wired_isobmff.Property.ispeispe.(field) uint images_wired_isobmff.ImageSpatialExtents.widthwidth, (local variable) const(images_wired_isobmff.Property) propprop.(field) images_wired_isobmff.ImageSpatialExtents images_wired_isobmff.Property.ispeispe.(field) uint images_wired_isobmff.ImageSpatialExtents.heightheight);
if ((local variable) const(images_wired_isobmff.Property) propprop.(field) char[4] images_wired_isobmff.Property.typetype == "pixi")
(local variable) string propsprops ~= string std.format.format!("=%s", const(ubyte)[])(const(ubyte)[] __param_0) pure @safeExamples
The format string can be checked at compile-time:
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
// This line doesn't compile, because 3.14 cannot be formatted with %d:
// s = format!"%s is %d"("Pi", 3.14);
format!"=%s"((local variable) const(images_wired_isobmff.Property) propprop.(field) ubyte[] images_wired_isobmff.Property.bitsPerChannelpixi
bitsPerChannel);
}
const (local variable) const(images_wired_isobmff.Extent) ee = (local variable) const(images_wired_isobmff.Item) itemitem.(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents[0];
const (local variable) const(bool) inMdatinMdat = (local variable) const(images_wired_isobmff.Extent) ee.(field) ulong images_wired_isobmff.Extent.offsetoffset >= (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Box images_wired_isobmff.Heif.mdatmdat.ulong images_wired_isobmff.Box.payload() const pure nothrow @nogc @safepayload && (local variable) const(images_wired_isobmff.Extent) ee.(field) ulong images_wired_isobmff.Extent.offsetoffset + (local variable) const(images_wired_isobmff.Extent) ee.(field) ulong images_wired_isobmff.Extent.lengthlength <= (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Box images_wired_isobmff.Heif.mdatmdat.(field) ulong images_wired_isobmff.Box.endend;
void std.stdio.writefln!(char, const(uint), string, const(char[4]), string, const(ulong), const(ulong), const(bool), string)(in char[] fmt, const(uint) __param_1, string __param_2, const(char[4]) __param_3, string __param_4, const(ulong) __param_5, const(ulong) __param_6, const(bool) __param_7, string __param_8) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: item %s%s %s \"%s\": %s bytes at %s, inside mdat %s, properties:%s",
(local variable) const(images_wired_isobmff.Item) itemitem.(field) uint images_wired_isobmff.Item.idid, (local variable) const(images_wired_isobmff.Item) itemitem.(field) uint images_wired_isobmff.Item.idid == (local variable) const(images_wired_isobmff.Heif) heifheif.(field) uint images_wired_isobmff.Heif.primaryprimary ? " (primary)" : "", (local variable) const(images_wired_isobmff.Item) itemitem.(field) char[4] images_wired_isobmff.Item.typetype, (local variable) const(images_wired_isobmff.Item) itemitem.(field) string images_wired_isobmff.Item.namename,
(local variable) const(images_wired_isobmff.Extent) ee.(field) ulong images_wired_isobmff.Extent.lengthlength, (local variable) const(images_wired_isobmff.Extent) ee.(field) ulong images_wired_isobmff.Extent.offsetoffset, (local variable) const(bool) inMdatinMdat, (local variable) string propsprops.(field) ulong string.lengthlength ? (local variable) string propsprops : " none");
}
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: primary item bytes: \"%s\"",
cast((alias) object.string = stringstring) (local variable) const(ubyte[]) bytesbytes[(local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems[0].(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents[0].(field) ulong images_wired_isobmff.Extent.offsetoffset .. (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems[0].(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents[0].(field) ulong images_wired_isobmff.Extent.offsetoffset + (local variable) const(images_wired_isobmff.Heif) heifheif.(field) images_wired_isobmff.Item[] images_wired_isobmff.Heif.itemsitems[0].(field) images_wired_isobmff.Extent[] images_wired_isobmff.Item.extentsextents[0].(field) ulong images_wired_isobmff.Extent.lengthlength]);
ubyte[] (local variable) ubyte[] againagain;
string images_wired_isobmff.encodeFixed!(images_wired_isobmff.BoxHeader)(in images_wired_isobmff.BoxHeader value, ref ubyte[] output) pure nothrow @safeEncodes a fixed record after its checks pass, as expressiveness §6.4
requires of encode. Returns the first failure's reason, or null.
encodeFixed(sparkles.base.expected.Expected!(BoxHeader, BinError, Abort) images_wired_isobmff.decodeFixed!(images_wired_isobmff.BoxHeader)(in ubyte[] bytes, ulong at) pure nothrow @safeDecodes a fixed record at at: one bounds check, the schema walk with
field checks, then the type-level @WireChecks.
decodeFixed!(struct) images_wired_isobmff.BoxHeader§4.2.2: "unsigned int(32) size; unsigned int(32) type = boxtype;"
BoxHeader((local variable) const(ubyte[]) bytesbytes, 0).inout(images_wired_isobmff.BoxHeader) sparkles.base.expected.Expected!(images_wired_isobmff.BoxHeader, images_wired_isobmff.BinError, sparkles.base.expected.Abort).value!()() inout pure nothrow @nogc @property ref @safeReturns the expected value if there is one.
With default Abort hook, it asserts when there is no value.
It calls hook's onAccessEmptyValue otherwise.
It returns T.init when hook doesn't provide onAccessEmptyValue.
Note
Value is returned by reference only when hook provides onAccessEmptyValue.
Otherwise the T.init fallback forces it to be returned by value (a copy).
value, (local variable) ubyte[] againagain);
void std.stdio.writefln!(char, ulong, bool)(in char[] fmt, ulong __param_1, bool __param_2) @safeEquivalent to writef(fmt, args, '\n').
writefln("isobmff: round trip: ftyp header re-encoded to %s bytes, identical: %s", (local variable) ubyte[] againagain.(field) ulong ubyte[].lengthlength, (local variable) ubyte[] againagain == (local variable) const(ubyte[]) bytesbytes[0 .. 8]);
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("ispe overruns ipco", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.childOverrun = 1childOverrun));
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("size 0 inside ipco", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.sizeZeroNested = 2sizeZeroNested));
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("iloc offset_size 3", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.ilocFieldSize3 = 3ilocFieldSize3));
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("Exif extent past the file", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.extentOutside = 4extentOutside));
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("ipma names property 3 of 2", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.propertyMissing = 5propertyMissing));
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("pitm names item 7", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.primaryMissing = 6primaryMissing));
void images_wired_isobmff.report(string label, in ubyte[] bytes)report("ftyp size 4", ubyte[] images_wired_isobmff.buildHeif(images_wired_isobmff.Variant variant)buildHeif((enum) images_wired_isobmff.VariantVariant.(enum value) images_wired_isobmff.Variant.sizeBelowHeader = 7sizeBelowHeader));
}