leaf-dispatch.dhover×414all
#!/usr/bin/env dub
/+ dub.sdl:
    name "property_tree_leaf_dispatch"
    targetPath "build"
    dflags "-preview=in" "-preview=dip1000"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
/**
 * Leaf dispatch and the metadata channel (forks D2 + D4).
 *
 * Under test:
 *   C4. A closed `static if` ladder over D's type space classifies every leaf
 *       into a small `LeafKind` the view can dispatch on, at compile time,
 *       with no registry and no dynamic dispatch surface.
 *   C5. A UDA vocabulary carries the rest — label, group, range, read-only,
 *       hidden — and a per-field OVERRIDE of the chosen editor is just a
 *       symbol resolved at compile time (the derive-crates' `custom_func_mut`).
 *   C6. What a UDA canNOT carry is a condition over the VALUE: `@ShowIf` has
 *       to be a function pointer evaluated per frame.
 *   C7. The escape hatch: a type the ladder cannot classify is `opaque`, and
 *       an opaque row is presented via its own `toString` — VS Code's
 *       `Complex` posture, which is also what read-only targets need.
 *   C27. Invalid metadata is a BUILD error, not a frame-time surprise: an
 *        `@Editor` whose symbol does not accept and emit the field's concrete
 *        leaf type, an `@Editor` on an `@opaqueValue` leaf, and a `@ShowIf`
 *        naming a missing member each fail compilation, shown by negative
 *        probes. (Added with the spec review: the earlier revision carried
 *        `@Editor` as a string name — a registry key — which the spec forbids.)
 *
 * Run: `dub run --single leaf-dispatch.d`
 */
module 
(module) property_tree_leaf_dispatch

Leaf dispatch and the metadata channel (forks D2 + D4).

Under test: C4. A closed static if ladder over D's type space classifies every leaf into a small LeafKind the view can dispatch on, at compile time, with no registry and no dynamic dispatch surface. C5. A UDA vocabulary carries the rest — label, group, range, read-only, hidden — and a per-field OVERRIDE of the chosen editor is just a symbol resolved at compile time (the derive-crates' custom_func_mut). C6. What a UDA canNOT carry is a condition over the VALUE: @ShowIf has to be a function pointer evaluated per frame. C7. The escape hatch: a type the ladder cannot classify is opaque, and an opaque row is presented via its own toString — VS Code's Complex posture, which is also what read-only targets need. C27. Invalid metadata is a BUILD error, not a frame-time surprise: an @Editor whose symbol does not accept and emit the field's concrete leaf type, an @Editor on an @opaqueValue leaf, and a @ShowIf naming a missing member each fail compilation, shown by negative probes. (Added with the spec review: the earlier revision carried @Editor as a string name — a registry key — which the spec forbids.)

Run

dub run --single leaf-dispatch.d

property_tree_leaf_dispatch
;
import
(package) std
std
.
(module) std.conv

A one-stop shop for converting values from one type to another.

Category Functions
Generic asOriginalType castFrom parse to toChars bitCast
Strings text wtext dtext writeText writeWText writeDText hexString
Numeric octal roundTo signed unsigned
Exceptions ConvException ConvOverflowException

Source

std/conv.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Shin Fujishiro, Adam D. Ruppe, Kenji Hara
conv
:
(alias template) property_tree_leaf_dispatch.text = std.conv.text(T...)(T args) if (T.length > 0)

Convenience functions for converting one or more arguments of any type into text (the three character widths).

text
;
import
(package) std
std
.
(module) std.traits

Templates 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

@copyrightCopyright The D Language Foundation 2005 - 2009.@licenseBoost License 1.0.@authorsWalter Bright, Tomasz Stachowiak (isExpressions), Andrei Alexandrescu, Shin Fujishiro, Robert Clipsham, David Nadlinger, Kenji Hara, Shoichi Kato
traits
:
(alias template) property_tree_leaf_dispatch.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.

@paramE An enumerated type. E may have duplicated values.@returnsStatic tuple composed of the members of the enumerated type E. The members are arranged in the same order as declared in E. The name of the enum can be found by querying the compiler for the name of the identifier, i.e. __traits(identifier, EnumMembers!MyEnum[i]). For enumerations with unique values, to can also be used.
EnumMembers
,
(alias template) property_tree_leaf_dispatch.hasUDA = std.traits.hasUDA(alias symbol, alias attribute)

Determine if a symbol has a given user-defined attribute.

@seegetUDAs
hasUDA
,
(alias template) property_tree_leaf_dispatch.getUDAs = std.traits.getUDAs(alias symbol, alias attribute)

Gets the matching user-defined attributes from the given symbol.

If the UDA is a type, then any UDAs of the same type on the symbol will match. If the UDA is a template for a type, then any UDA which is an instantiation of that template will match. And if the UDA is a value, then any UDAs on the symbol which are equal to that value will match.

@seehasUDA
getUDAs
,
(alias template) property_tree_leaf_dispatch.isAggregateType = std.traits.isAggregateType(T)

Detect whether type T is an aggregate type.

isAggregateType
,
(alias template) property_tree_leaf_dispatch.isArray = std.traits.isArray(T)

Detect whether type T is an array (static or dynamic; for associative arrays see isAssociativeArray).

isArray
,
(alias template) property_tree_leaf_dispatch.isAssociativeArray = std.traits.isAssociativeArray(T)

Detect whether T is an associative array type

See also: __traits(isAssociativeArray, T)

isAssociativeArray
,
(alias template) property_tree_leaf_dispatch.isBoolean = std.traits.isBoolean(T)

Detect whether T is a built-in boolean type or enum of boolean base type.

isBoolean
,
(alias template) property_tree_leaf_dispatch.isFloatingPoint = std.traits.isFloatingPoint(T)

Detect whether T is a built-in floating point type.

See also: __traits(isFloating, T)

isFloatingPoint
,
(alias template) property_tree_leaf_dispatch.isIntegral = std.traits.isIntegral(T)

Detect whether T is a built-in integral type. Integral types are byte, ubyte, short, ushort, int, uint, long, ulong, cent, ucent, and enums with an integral type as its base type.

Note

this is not the same as __traits(isIntegral)

@paramT type to test@returnstrue if T is an integral type
isIntegral
,
(alias template) property_tree_leaf_dispatch.isPointer = std.traits.isPointer(T)

Detect whether type T is a pointer.

isPointer
,
(alias template) property_tree_leaf_dispatch.isSomeString = std.traits.isSomeString(T)

Detect whether T is one of the built-in string types.

The built-in string types are Char[], where Char is any of char, wchar or dchar, with or without qualifiers.

Static arrays of characters (like char[80]) are not considered built-in string types.

isSomeString
,
(alias template) property_tree_leaf_dispatch.OriginalType = std.traits.OriginalType(T)

Strips off all enums from type T.

OriginalType
;
@safe: // ── the metadata vocabulary (C5) ───────────────────────────────────────────── struct
(struct) property_tree_leaf_dispatch.Label

display name override

Label
{
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.Label.text
text
; } /// display name override
struct
(struct) property_tree_leaf_dispatch.Group

category

Group
{
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.Group.name
name
; } /// category
struct
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
{ double
(field) double property_tree_leaf_dispatch.Range.lo
lo
,
(field) double property_tree_leaf_dispatch.Range.hi
hi
,
(field) double property_tree_leaf_dispatch.Range.step
step
= 0; } /// numeric bounds → slider/stepper
struct
(struct) property_tree_leaf_dispatch.Doc

tooltip / details row

Doc
{
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.Doc.text
text
; } /// tooltip / details row
enum
(enum) property_tree_leaf_dispatch.hidden

never presented

hidden
; /// never presented
enum
(enum) property_tree_leaf_dispatch.readOnly

presented, never editable

readOnly
; /// presented, never editable
struct
(struct) property_tree_leaf_dispatch.Editor!(colorSwatch)

force a leaf editor: a SYMBOL (C27)

Editor
(alias fn) {} /// force a leaf editor: a SYMBOL (C27)
struct
(struct) property_tree_leaf_dispatch.ShowIf

a condition over the VALUE (C6)

ShowIf
{
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.ShowIf.cond
cond
; } /// a condition over the VALUE (C6)
// ── the leaf classification (C4) ───────────────────────────────────────────── enum
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
: ubyte
{
(enum value) property_tree_leaf_dispatch.LeafKind.boolean = cast(ubyte)0u
boolean
,
(enum value) property_tree_leaf_dispatch.LeafKind.integral = 1
integral
,
(enum value) property_tree_leaf_dispatch.LeafKind.floating = 2
floating
,
(enum value) property_tree_leaf_dispatch.LeafKind.text = 3
text
,
(enum value) property_tree_leaf_dispatch.LeafKind.enumeration = 4
enumeration
,
(enum value) property_tree_leaf_dispatch.LeafKind.opaque = 5
opaque
} template
(template) property_tree_leaf_dispatch.leafKindOf(T)
leafKindOf
(T)
{ static if (is(
(alias) T = int
T
== enum)) enum
(constant) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.leafKindOf!(property_tree_leaf_dispatch.FillKind) = LeafKind.enumeration
leafKindOf
=
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.enumeration = 4
enumeration
;
else static if (
(template instance) std.traits.isBoolean!int
isBoolean
!
(alias) T = int
T
) enum leafKindOf = LeafKind.boolean;
else static if (
(template instance) std.traits.isIntegral!int
isIntegral
!
(alias) T = int
T
) enum
(constant) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.leafKindOf!int = LeafKind.integral
leafKindOf
=
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.integral = 1
integral
;
else static if (
(template instance) std.traits.isFloatingPoint!(property_tree_leaf_dispatch.Handle)
isFloatingPoint
!
(alias) T = property_tree_leaf_dispatch.Handle
T
) enum
(constant) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.leafKindOf!double = LeafKind.floating
leafKindOf
=
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.floating = 2
floating
;
else static if (
(template instance) std.traits.isSomeString!(property_tree_leaf_dispatch.Handle)
isSomeString
!
(alias) T = property_tree_leaf_dispatch.Handle
T
) enum
(constant) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.leafKindOf!string = LeafKind.text
leafKindOf
=
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.text = 3
text
;
else enum
(constant) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.leafKindOf!(property_tree_leaf_dispatch.Handle) = LeafKind.opaque
leafKindOf
=
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.opaque = 5
opaque
;
} /// Is `T` a leaf at all? Aggregates descend; everything else is a leaf — and /// an aggregate that answers `toString` but has no presentable fields is an /// opaque leaf, not a subtree (C7). enum bool
(constant) bool property_tree_leaf_dispatch.isLeaf!(property_tree_leaf_dispatch.Style) = false

Is T a leaf at all? Aggregates descend; everything else is a leaf — and an aggregate that answers toString but has no presentable fields is an opaque leaf, not a subtree (C7).

isLeaf
(T) = !
(template instance) std.traits.isAggregateType!(property_tree_leaf_dispatch.Style)
isAggregateType
!
(alias) T = property_tree_leaf_dispatch.Style
T
||
(template instance) std.traits.isSomeString!(property_tree_leaf_dispatch.Style)
isSomeString
!
(alias) T = property_tree_leaf_dispatch.Style
T
|| (
(template instance) std.traits.hasUDA!(property_tree_leaf_dispatch.Style, property_tree_leaf_dispatch.opaqueValue)
hasUDA
!(
(alias) T = property_tree_leaf_dispatch.Style
T
,
(enum) property_tree_leaf_dispatch.opaqueValue

a type marks ITSELF as never-descended

opaqueValue
) && true);
enum
(enum) property_tree_leaf_dispatch.opaqueValue

a type marks ITSELF as never-descended

opaqueValue
; /// a type marks ITSELF as never-descended
// ── what a row tells the view ──────────────────────────────────────────────── struct
(struct) property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf)
LeafPlan
(T)
{
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).path
path
,
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).label
label
,
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).group
group
,
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).doc
doc
,
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).typeName
typeName
;
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
(field) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).kind
kind
;
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).editor

"" = the kind's default editor

editor
; /// "" = the kind's default editor
bool
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).editable
editable
;
bool
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).hasRange
hasRange
;
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
(field) property_tree_leaf_dispatch.Range property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).range
range
;
(alias) object.string = string
string
[]
(field) string[] property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).choices

enumeration members

choices
; /// enumeration members
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).why

the @ShowIf source text, "" = unconditional

why
; /// the @ShowIf source text, "" = unconditional
bool function(ref const
(alias) T = property_tree_leaf_dispatch.BadShowIf
T
) @safe
(field) bool function(ref const(property_tree_leaf_dispatch.BadShowIf)) @safe property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.BadShowIf).visible

null = unconditional

visible
; /// null = unconditional
} /// The compile-time plan for one aggregate's leaves. Type-only template /// parameter, per [`open-set-descent.d`](./open-set-descent.d).
(struct) property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style)
LeafPlan
!
(alias) T = property_tree_leaf_dispatch.Style
T
[]
property_tree_leaf_dispatch.LeafPlan!(Style)[] property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style)(string prefix = "") pure nothrow @safe

The compile-time plan for one aggregate's leaves. Type-only template parameter, per open-set-descent.d.

planOf
(T)(
(alias) object.string = string
string
(parameter) string prefix
prefix
= "") pure nothrow
{
(struct) property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style)
LeafPlan
!
(alias) T = property_tree_leaf_dispatch.Style
T
[]
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style)[] rows
rows
;
static foreach (name; __traits(allMembers, T)) {{ static if (__traits(compiles, typeof(__traits(getMember, T, name))) && !is(typeof(__traits(getMember, T, name)) == function)) { alias
(alias) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).F = string
F
= typeof(__traits(getMember, T, name));
alias
(alias field) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).M = string property_tree_leaf_dispatch.Style.name
M
= __traits(getMember, T, name);
static if (!
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.hidden)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(enum) property_tree_leaf_dispatch.hidden

never presented

hidden
))
{{
(struct) property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style)
LeafPlan
!
(alias) T = property_tree_leaf_dispatch.Style
T
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).path
path
=
(parameter) string prefix
prefix
.
(field) ulong string.length
length
?
(parameter) string prefix
prefix
~ "." ~ name :
(constant) string property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).name = "name"
name
;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).typeName
typeName
=
(enum) property_tree_leaf_dispatch.FillKind
F
.
(constant) string string.stringof = "string"
stringof
;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).kind
kind
=
(template instance) property_tree_leaf_dispatch.leafKindOf!string
leafKindOf
!
(alias) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).F = string
F
;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).editable
editable
= !
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.readOnly)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(enum) property_tree_leaf_dispatch.readOnly

presented, never editable

readOnly
);
static if (
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.Label)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.Label

display name override

Label
))
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).label
label
=
(constant) property_tree_leaf_dispatch.Label std.meta.Filter!(isDesiredUDA, Group("layout"), Label("H"), Range(0.0, 4096.0, 0.0)).arg = Label("H")
getUDAs
!(
(field) int property_tree_leaf_dispatch.Style.height
M
,
(struct) property_tree_leaf_dispatch.Label

display name override

Label
)[0].
(field) string property_tree_leaf_dispatch.Label.text
text
;
else
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).label
label
=
(constant) string property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).name = "name"
name
;
static if (
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.Group)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.Group

category

Group
))
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).group
group
=
(constant) property_tree_leaf_dispatch.Group std.meta.Filter!(isDesiredUDA, Group("identity"), Doc("shown in the layer list")).arg = Group("identity")
getUDAs
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.Group

category

Group
)[0].
(field) string property_tree_leaf_dispatch.Group.name
name
;
static if (
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.Doc)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.Doc

tooltip / details row

Doc
))
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).doc
doc
=
(constant) property_tree_leaf_dispatch.Doc std.meta.Filter!(isDesiredUDA, Group("identity"), Doc("shown in the layer list")).arg = Doc("shown in the layer list")
getUDAs
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.Doc

tooltip / details row

Doc
)[0].
(field) string property_tree_leaf_dispatch.Doc.text
text
;
static if (
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.Range)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
))
{
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).hasRange
hasRange
= true;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) property_tree_leaf_dispatch.Range property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).range
range
=
(constant) property_tree_leaf_dispatch.Range std.meta.Filter!(isDesiredUDA, Group("fill"), Range(0.0, 1.0, 0.01)).arg = Range(0.0, 1.0, 0.01)
getUDAs
!(
(field) double property_tree_leaf_dispatch.Style.opacity
M
,
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
)[0];
} static foreach (uda; __traits(getAttributes, M)) {{ static if (is(
(constant) property_tree_leaf_dispatch.Group property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).uda = Group("identity")
uda
== Editor!fn, alias fn))
{ // The override is a symbol, validated HERE at the walk // (C27): it must accept and emit the field's concrete // leaf type, and it cannot make an opaque leaf // assignable — so no presentation can route around // the dispatch through a loosely-typed editor. static assert(
(template instance) property_tree_leaf_dispatch.leafKindOf!uint
leafKindOf
!
(alias) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).F = uint
F
!=
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.opaque = 5
opaque
,
name ~ ": @Editor cannot make an opaque leaf assignable"); static assert(is(typeof(fn(
uint property_tree_leaf_dispatch.colorSwatch(uint v) pure nothrow @safe

The custom editor under test: accepts and emits the field's type. (The spike cares about the typing seam, not the painting.)

F
.
uint property_tree_leaf_dispatch.colorSwatch(uint v) pure nothrow @safe

The custom editor under test: accepts and emits the field's type. (The spike cares about the typing seam, not the painting.)

init
)) : F),
name ~ ": @Editor symbol must accept and emit " ~ F.
F.stringof
stringof
);
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).editor

"" = the kind's default editor

editor
= __traits(identifier, fn);
} }} static if (
(template instance) property_tree_leaf_dispatch.Style.hasUDA!(name, property_tree_leaf_dispatch.ShowIf)
hasUDA
!(
(field) string property_tree_leaf_dispatch.Style.name
M
,
(struct) property_tree_leaf_dispatch.ShowIf

a condition over the VALUE (C6)

ShowIf
))
{ // The condition is a compile-time-checked EXPRESSION over // the subject, not an untyped callback: it becomes a typed // `@safe` predicate with no cast anywhere (C6). enum
(constant) string property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).src = "kind == FillKind.gradient"
src
=
(constant) property_tree_leaf_dispatch.ShowIf std.meta.Filter!(isDesiredUDA, Group("fill"), ShowIf("kind == FillKind.gradient")).arg = ShowIf("kind == FillKind.gradient")
getUDAs
!(
(field) int property_tree_leaf_dispatch.Style.stops
M
,
(struct) property_tree_leaf_dispatch.ShowIf

a condition over the VALUE (C6)

ShowIf
)[0].
(field) string property_tree_leaf_dispatch.ShowIf.cond
cond
;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).why

the @ShowIf source text, "" = unconditional

why
=
(constant) string property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).src = "kind == FillKind.gradient"
src
;
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool function(ref const(property_tree_leaf_dispatch.Style)) @safe property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).visible

null = unconditional

visible
= (ref const
(alias) T = property_tree_leaf_dispatch.Style
T
(parameter) const(property_tree_leaf_dispatch.Style) v
v
) @safe => mixin("v." ~ src);
} static if (is(
(alias) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style).F = string
F
== enum))
static foreach (e; EnumMembers!F)
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string[] property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).choices

enumeration members

choices
~= __traits(identifier, e);
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style)[] rows
rows
~=
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
;
}} } }} return
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style)[] rows
rows
;
} /// The default editor for a kind — a closed set, chosen at compile time.
(alias) object.string = string
string
string property_tree_leaf_dispatch.defaultEditor(property_tree_leaf_dispatch.LeafKind k, bool hasRange, bool editable) pure nothrow @safe

The default editor for a kind — a closed set, chosen at compile time.

defaultEditor
(
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
(parameter) property_tree_leaf_dispatch.LeafKind k
k
, bool
(parameter) bool hasRange
hasRange
, bool
(parameter) bool editable
editable
) pure nothrow
{ if (!
(parameter) bool editable
editable
) return "readout";
final switch (
(parameter) property_tree_leaf_dispatch.LeafKind k
k
)
{ case
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.boolean = cast(ubyte)0u
boolean
: return "checkbox";
case
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.integral = 1
integral
: return
(parameter) bool hasRange
hasRange
? "slider-int" : "stepper";
case
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.floating = 2
floating
: return
(parameter) bool hasRange
hasRange
? "slider" : "number";
case
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.text = 3
text
: return "line-edit";
case
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.enumeration = 4
enumeration
: return "picker";
case
(enum) property_tree_leaf_dispatch.LeafKind
LeafKind
.
(enum value) property_tree_leaf_dispatch.LeafKind.opaque = 5
opaque
: return "readout+escape"; // C7
} } // ── the subject ────────────────────────────────────────────────────────────── enum
(enum) property_tree_leaf_dispatch.FillKind
FillKind
{
(enum value) property_tree_leaf_dispatch.FillKind.solid = 0
solid
,
(enum value) property_tree_leaf_dispatch.FillKind.gradient = 1
gradient
,
(enum value) property_tree_leaf_dispatch.FillKind.texture = 2
texture
}
/// A type that refuses to be descended into: presented by `toString` (C7). @
(enum) property_tree_leaf_dispatch.opaqueValue

a type marks ITSELF as never-descended

opaqueValue
struct
(struct) property_tree_leaf_dispatch.Handle

A type that refuses to be descended into: presented by toString (C7).

Handle
{ ulong
(field) ulong property_tree_leaf_dispatch.Handle.bits
bits
;
(alias) object.string = string
string
string property_tree_leaf_dispatch.Handle.toString() const pure @safe
toString
() const pure =>
string std.conv.text!(string, const(ulong), string)(string __param_0, const(ulong) __param_1, string __param_2) pure nothrow @safe

Convenience functions for converting one or more arguments of any type into text (the three character widths).

text
("Handle(",
(field) ulong property_tree_leaf_dispatch.Handle.bits
bits
, ")");
} struct
(struct) property_tree_leaf_dispatch.Style
Style
{ @
(struct) property_tree_leaf_dispatch.Group

category

Group
("identity") @
(struct) property_tree_leaf_dispatch.Doc

tooltip / details row

Doc
("shown in the layer list")
(alias) object.string = string
string
(field) string property_tree_leaf_dispatch.Style.name
name
= "unnamed";
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("fill")
(enum) property_tree_leaf_dispatch.FillKind
FillKind
(field) property_tree_leaf_dispatch.FillKind property_tree_leaf_dispatch.Style.kind
kind
;
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("fill") @
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
(0, 1, 0.01)
double
(field) double property_tree_leaf_dispatch.Style.opacity
opacity
= 1;
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("fill") @
(struct) property_tree_leaf_dispatch.ShowIf

a condition over the VALUE (C6)

ShowIf
("kind == FillKind.gradient")
int
(field) int property_tree_leaf_dispatch.Style.stops
stops
= 2;
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("layout") @
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
(0, 4096)
int
(field) int property_tree_leaf_dispatch.Style.width
width
= 100;
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("layout") @
(struct) property_tree_leaf_dispatch.Label

display name override

Label
("H") @
(struct) property_tree_leaf_dispatch.Range

numeric bounds → slider/stepper

Range
(0, 4096)
int
(field) int property_tree_leaf_dispatch.Style.height
height
= 100;
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("advanced") @
(enum) property_tree_leaf_dispatch.readOnly

presented, never editable

readOnly
(struct) property_tree_leaf_dispatch.Handle

A type that refuses to be descended into: presented by toString (C7).

Handle
(field) property_tree_leaf_dispatch.Handle property_tree_leaf_dispatch.Style.handle
handle
;
@
(enum) property_tree_leaf_dispatch.hidden

never presented

hidden
uint
(field) uint property_tree_leaf_dispatch.Style.revision
revision
;
@
(struct) property_tree_leaf_dispatch.Group

category

Group
("advanced") @
(template instance) property_tree_leaf_dispatch.Editor!(colorSwatch)
Editor
!
uint property_tree_leaf_dispatch.colorSwatch(uint v) pure nothrow @safe

The custom editor under test: accepts and emits the field's type. (The spike cares about the typing seam, not the painting.)

colorSwatch
uint
(field) uint property_tree_leaf_dispatch.Style.tint
tint
= 0xff00ff;
} /// The custom editor under test: accepts and emits the field's type. (The /// spike cares about the typing seam, not the painting.) uint
uint property_tree_leaf_dispatch.colorSwatch(uint v) pure nothrow @safe

The custom editor under test: accepts and emits the field's type. (The spike cares about the typing seam, not the painting.)

colorSwatch
(uint
(parameter) uint v
v
) pure nothrow =>
(parameter) uint v
v
;
// ── C27: invalid metadata fails the build — negative probes ──────────────────
(alias) object.string = string
string
string property_tree_leaf_dispatch.wrongType(string s) pure nothrow @safe
wrongType
(
(alias) object.string = string
string
(parameter) string s
s
) pure nothrow =>
(parameter) string s
s
;
(struct) property_tree_leaf_dispatch.Handle

A type that refuses to be descended into: presented by toString (C7).

Handle
property_tree_leaf_dispatch.Handle property_tree_leaf_dispatch.handleEditor(property_tree_leaf_dispatch.Handle h) pure nothrow @safe
handleEditor
(
(struct) property_tree_leaf_dispatch.Handle

A type that refuses to be descended into: presented by toString (C7).

Handle
(parameter) property_tree_leaf_dispatch.Handle h
h
) pure nothrow =>
(parameter) property_tree_leaf_dispatch.Handle h
h
;
struct
(struct) property_tree_leaf_dispatch.BadEditorType
BadEditorType
{ @
(template instance) property_tree_leaf_dispatch.Editor!(wrongType)
Editor
!
string property_tree_leaf_dispatch.wrongType(string s) pure nothrow @safe
wrongType
uint
(field) uint property_tree_leaf_dispatch.BadEditorType.tint
tint
; } // type mismatch
struct
(struct) property_tree_leaf_dispatch.BadEditorOpaque
BadEditorOpaque
{ @
(template instance) property_tree_leaf_dispatch.Editor!(handleEditor)
Editor
!
property_tree_leaf_dispatch.Handle property_tree_leaf_dispatch.handleEditor(property_tree_leaf_dispatch.Handle h) pure nothrow @safe
handleEditor
(struct) property_tree_leaf_dispatch.Handle

A type that refuses to be descended into: presented by toString (C7).

Handle
(field) property_tree_leaf_dispatch.Handle property_tree_leaf_dispatch.BadEditorOpaque.handle
handle
; } // opaque leaf
struct
(struct) property_tree_leaf_dispatch.BadShowIf
BadShowIf
{ int
(field) int property_tree_leaf_dispatch.BadShowIf.kind
kind
; @
(struct) property_tree_leaf_dispatch.ShowIf

a condition over the VALUE (C6)

ShowIf
("knid == 1") int
(field) int property_tree_leaf_dispatch.BadShowIf.stops
stops
; }
static assert(!__traits(compiles,
(template instance) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.BadEditorType)
planOf
!
(struct) property_tree_leaf_dispatch.BadEditorType
BadEditorType
()));
static assert(!__traits(compiles,
(template instance) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.BadEditorOpaque)
planOf
!
(struct) property_tree_leaf_dispatch.BadEditorOpaque
BadEditorOpaque
()));
static assert(!__traits(compiles,
(template instance) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.BadShowIf)
planOf
!
(struct) property_tree_leaf_dispatch.BadShowIf
BadShowIf
()));
// ── driving ────────────────────────────────────────────────────────────────── enum
(constant) property_tree_leaf_dispatch.LeafPlan!(Style)[] property_tree_leaf_dispatch.plan = [LeafPlan("name", "name", "identity", "shown in the layer list", "string", LeafKind.text, null, true, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("kind", "kind", "fill", null, "FillKind", LeafKind.enumeration, null, true, false, Range(nan, nan, 0.0), ["solid", "gradient", "texture"], null, null), LeafPlan("opacity", "opacity", "fill", null, "double", LeafKind.floating, null, true, true, Range(0.0, 1.0, 0.01), null, null, null), LeafPlan("stops", "stops", "fill", null, "int", LeafKind.integral, null, true, false, Range(nan, nan, 0.0), null, "kind == FillKind.gradient", function (ref const(Style) v) pure nothrow @nogc @safe => v.kind == FillKind.gradient), LeafPlan("width", "width", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("height", "H", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("handle", "handle", "advanced", null, "Handle", LeafKind.opaque, null, false, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("tint", "tint", "advanced", null, "uint", LeafKind.integral, "colorSwatch", true, false, Range(nan, nan, 0.0), null, null, null)]
plan
=
property_tree_leaf_dispatch.LeafPlan!(Style)[] property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.Style)(string prefix = "") pure nothrow @safe

The compile-time plan for one aggregate's leaves. Type-only template parameter, per open-set-descent.d.

planOf
!
(struct) property_tree_leaf_dispatch.Style
Style
(); // ← the whole plan is a compile-time constant
void
void D main() @safe
main
()
{ import
(package) std
std
.
(module) std.stdio
Category 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:

  1. The lowest layer is the operating system layer. The two main schemes are Windows and Posix.

  2. C's stdio.h which unifies the two operating system schemes.

  3. std.stdio, this module, unifies the various stdio.h implementations into a high level package for D programs.

Source

std/stdio.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Alex Rønne Petersen
stdio
:
(alias template) writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

Equivalent to $(D writef(fmt, args, '\n')).

writefln
,
(alias template) writeln = std.stdio.writeln(T...)(T args)

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Params: args = the items to write to stdout

Throws: In case of an I/O error, throws an $(LREF StdioException). Example: Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main() { string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }

} ---

writeln
;
void std.stdio.writefln!(char, ulong)(in char[] fmt, ulong __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("C4/C5 — %s presented leaves, planned at compile time"
~ " (`revision` is @hidden and absent)\n",
(constant) property_tree_leaf_dispatch.LeafPlan!(Style)[] property_tree_leaf_dispatch.plan = [LeafPlan("name", "name", "identity", "shown in the layer list", "string", LeafKind.text, null, true, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("kind", "kind", "fill", null, "FillKind", LeafKind.enumeration, null, true, false, Range(nan, nan, 0.0), ["solid", "gradient", "texture"], null, null), LeafPlan("opacity", "opacity", "fill", null, "double", LeafKind.floating, null, true, true, Range(0.0, 1.0, 0.01), null, null, null), LeafPlan("stops", "stops", "fill", null, "int", LeafKind.integral, null, true, false, Range(nan, nan, 0.0), null, "kind == FillKind.gradient", function (ref const(Style) v) pure nothrow @nogc @safe => v.kind == FillKind.gradient), LeafPlan("width", "width", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("height", "H", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("handle", "handle", "advanced", null, "Handle", LeafKind.opaque, null, false, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("tint", "tint", "advanced", null, "uint", LeafKind.integral, "colorSwatch", true, false, Range(nan, nan, 0.0), null, null, null)]
plan
.
(field) ulong [LeafPlan("name", "name", "identity", "shown in the layer list", "string", LeafKind.text, null, true, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("kind", "kind", "fill", null, "FillKind", LeafKind.enumeration, null, true, false, Range(nan, nan, 0.0), ["solid", "gradient", "texture"], null, null), LeafPlan("opacity", "opacity", "fill", null, "double", LeafKind.floating, null, true, true, Range(0.0, 1.0, 0.01), null, null, null), LeafPlan("stops", "stops", "fill", null, "int", LeafKind.integral, null, true, false, Range(nan, nan, 0.0), null, "kind == FillKind.gradient", function (ref const(Style) v) pure nothrow @nogc @safe => v.kind == FillKind.gradient), LeafPlan("width", "width", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("height", "H", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("handle", "handle", "advanced", null, "Handle", LeafKind.opaque, null, false, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("tint", "tint", "advanced", null, "uint", LeafKind.integral, "colorSwatch", true, false, Range(nan, nan, 0.0), null, null, null)].length
length
);
void std.stdio.writefln!(char, string, string, string, string, string, string)(in char[] fmt, string __param_1, string __param_2, string __param_3, string __param_4, string __param_5, string __param_6) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("%-10s %-9s %-13s %-9s %-16s %s",
"label", "group", "type", "kind", "editor", "extra"); foreach (
(parameter) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
;
(constant) property_tree_leaf_dispatch.LeafPlan!(Style)[] property_tree_leaf_dispatch.plan = [LeafPlan("name", "name", "identity", "shown in the layer list", "string", LeafKind.text, null, true, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("kind", "kind", "fill", null, "FillKind", LeafKind.enumeration, null, true, false, Range(nan, nan, 0.0), ["solid", "gradient", "texture"], null, null), LeafPlan("opacity", "opacity", "fill", null, "double", LeafKind.floating, null, true, true, Range(0.0, 1.0, 0.01), null, null, null), LeafPlan("stops", "stops", "fill", null, "int", LeafKind.integral, null, true, false, Range(nan, nan, 0.0), null, "kind == FillKind.gradient", function (ref const(Style) v) pure nothrow @nogc @safe => v.kind == FillKind.gradient), LeafPlan("width", "width", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("height", "H", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("handle", "handle", "advanced", null, "Handle", LeafKind.opaque, null, false, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("tint", "tint", "advanced", null, "uint", LeafKind.integral, "colorSwatch", true, false, Range(nan, nan, 0.0), null, null, null)]
plan
)
{
(alias) object.string = string
string
(local variable) string extra
extra
;
if (
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).hasRange
hasRange
)
(local variable) string extra
extra
~=
string std.conv.text!(string, double, string, double, string)(string __param_0, double __param_1, string __param_2, double __param_3, string __param_4) pure @safe

Convenience functions for converting one or more arguments of any type into text (the three character widths).

text
("[",
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) property_tree_leaf_dispatch.Range property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).range
range
.
(field) double property_tree_leaf_dispatch.Range.lo
lo
, "..",
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) property_tree_leaf_dispatch.Range property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).range
range
.
(field) double property_tree_leaf_dispatch.Range.hi
hi
, "] ");
if (
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string[] property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).choices

enumeration members

choices
.
(field) ulong string[].length
length
)
(local variable) string extra
extra
~=
string std.conv.text!(string[], string)(string[] __param_0, string __param_1) pure @safe

Convenience functions for converting one or more arguments of any type into text (the three character widths).

text
(
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string[] property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).choices

enumeration members

choices
, " ");
if (!
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).editable
editable
)
(local variable) string extra
extra
~= "read-only ";
if (
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool function(ref const(property_tree_leaf_dispatch.Style)) @safe property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).visible

null = unconditional

visible
!is null)
(local variable) string extra
extra
~= "if(" ~
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).why

the @ShowIf source text, "" = unconditional

why
~ ") ";
if (
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).doc
doc
.
(field) ulong string.length
length
)
(local variable) string extra
extra
~= "“" ~
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).doc
doc
~ "” ";
void std.stdio.writefln!(char, string, string, string, property_tree_leaf_dispatch.LeafKind, string, string)(in char[] fmt, string __param_1, string __param_2, string __param_3, property_tree_leaf_dispatch.LeafKind __param_4, string __param_5, string __param_6) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("%-10s %-9s %-13s %-9s %-16s %s",
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).label
label
,
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).group
group
,
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).typeName
typeName
,
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).kind
kind
,
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).editor

"" = the kind's default editor

editor
.
(field) ulong string.length
length
?
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).editor

"" = the kind's default editor

editor
~ "*"
:
string property_tree_leaf_dispatch.defaultEditor(property_tree_leaf_dispatch.LeafKind k, bool hasRange, bool editable) pure nothrow @safe

The default editor for a kind — a closed set, chosen at compile time.

defaultEditor
(
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) property_tree_leaf_dispatch.LeafKind property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).kind
kind
,
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).hasRange
hasRange
,
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).editable
editable
),
(local variable) string extra
extra
);
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\nC6 — the same plan, filtered per frame against a live value:");
(struct) property_tree_leaf_dispatch.Style
Style
(local variable) property_tree_leaf_dispatch.Style s
s
;
foreach (
(local variable) int twice
twice
; 0 .. 2)
{ if (
(local variable) int twice
twice
)
(local variable) property_tree_leaf_dispatch.Style s
s
.
(field) property_tree_leaf_dispatch.FillKind property_tree_leaf_dispatch.Style.kind
kind
=
(enum) property_tree_leaf_dispatch.FillKind
FillKind
.
(enum value) property_tree_leaf_dispatch.FillKind.gradient = 1
gradient
;
(alias) object.string = string
string
[]
(local variable) string[] visible
visible
;
foreach (
(parameter) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
;
(constant) property_tree_leaf_dispatch.LeafPlan!(Style)[] property_tree_leaf_dispatch.plan = [LeafPlan("name", "name", "identity", "shown in the layer list", "string", LeafKind.text, null, true, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("kind", "kind", "fill", null, "FillKind", LeafKind.enumeration, null, true, false, Range(nan, nan, 0.0), ["solid", "gradient", "texture"], null, null), LeafPlan("opacity", "opacity", "fill", null, "double", LeafKind.floating, null, true, true, Range(0.0, 1.0, 0.01), null, null, null), LeafPlan("stops", "stops", "fill", null, "int", LeafKind.integral, null, true, false, Range(nan, nan, 0.0), null, "kind == FillKind.gradient", function (ref const(Style) v) pure nothrow @nogc @safe => v.kind == FillKind.gradient), LeafPlan("width", "width", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("height", "H", "layout", null, "int", LeafKind.integral, null, true, true, Range(0.0, 4096.0, 0.0), null, null, null), LeafPlan("handle", "handle", "advanced", null, "Handle", LeafKind.opaque, null, false, false, Range(nan, nan, 0.0), null, null, null), LeafPlan("tint", "tint", "advanced", null, "uint", LeafKind.integral, "colorSwatch", true, false, Range(nan, nan, 0.0), null, null, null)]
plan
)
if (
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool function(ref const(property_tree_leaf_dispatch.Style)) @safe property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).visible

null = unconditional

visible
is null ||
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) bool function(ref const(property_tree_leaf_dispatch.Style)) @safe property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).visible

null = unconditional

visible
(
(local variable) property_tree_leaf_dispatch.Style s
s
))
(local variable) string[] visible
visible
~=
(local variable) property_tree_leaf_dispatch.LeafPlan!(Style) p
p
.
(field) string property_tree_leaf_dispatch.LeafPlan!(property_tree_leaf_dispatch.Style).label
label
;
void std.stdio.writefln!(char, property_tree_leaf_dispatch.FillKind, string[])(in char[] fmt, property_tree_leaf_dispatch.FillKind __param_1, string[] __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" kind=%-9s → %s",
(local variable) property_tree_leaf_dispatch.Style s
s
.
(field) property_tree_leaf_dispatch.FillKind property_tree_leaf_dispatch.Style.kind
kind
,
(local variable) string[] visible
visible
);
}
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\nC7 — the opaque escape: a @opaqueValue type is a LEAF,");
void std.stdio.writefln!(char, property_tree_leaf_dispatch.Handle)(in char[] fmt, property_tree_leaf_dispatch.Handle __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" presented by its own toString: %s",
(local variable) property_tree_leaf_dispatch.Style s
s
.
(field) property_tree_leaf_dispatch.Handle property_tree_leaf_dispatch.Style.handle
handle
);
void std.stdio.writefln!(char, bool, bool)(in char[] fmt, bool __param_1, bool __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" isLeaf!Handle = %s, isLeaf!Style = %s",
(template instance) property_tree_leaf_dispatch.isLeaf!(property_tree_leaf_dispatch.Handle)
isLeaf
!
(struct) property_tree_leaf_dispatch.Handle

A type that refuses to be descended into: presented by toString (C7).

Handle
,
(template instance) property_tree_leaf_dispatch.isLeaf!(property_tree_leaf_dispatch.Style)
isLeaf
!
(struct) property_tree_leaf_dispatch.Style
Style
);
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("\nC27 — invalid metadata fails the BUILD, probed negatively:");
void std.stdio.writefln!(char, bool)(in char[] fmt, bool __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" @Editor symbol of the wrong type → compiles: %s",
__traits(compiles,
(template instance) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.BadEditorType)
planOf
!
(struct) property_tree_leaf_dispatch.BadEditorType
BadEditorType
()));
void std.stdio.writefln!(char, bool)(in char[] fmt, bool __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" @Editor on an @opaqueValue leaf → compiles: %s",
__traits(compiles,
(template instance) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.BadEditorOpaque)
planOf
!
(struct) property_tree_leaf_dispatch.BadEditorOpaque
BadEditorOpaque
()));
void std.stdio.writefln!(char, bool)(in char[] fmt, bool __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" @ShowIf naming a missing member → compiles: %s",
__traits(compiles,
(template instance) property_tree_leaf_dispatch.planOf!(property_tree_leaf_dispatch.BadShowIf)
planOf
!
(struct) property_tree_leaf_dispatch.BadShowIf
BadShowIf
()));
}