uda-metadata.dhover×190all
#!/usr/bin/env dub
/+ dub.sdl:
    name "property_tree_uda_metadata"
    targetPath "build"
    dflags "-preview=in" "-preview=dip1000"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
/**
 * What a UDA metadata channel can and cannot answer before the frame.
 *
 * Backs [../comparison.md](../comparison.md) § _metadata_ and § _conditional
 * visibility_. Every surveyed library carries per-field metadata beside the
 * type — [.NET attributes](../winforms-propertygrid.md) (`[Category]`,
 * `[Browsable]`, `[Editor]`), [Godot's](../godot-inspector.md) `PropertyInfo`
 * hint/hint_string/usage triple,
 * [Unreal's](../unreal-details-panel.md) `UPROPERTY(meta=…)` string map, and
 * [`InspectorOptions`](../bevy-inspector-egui.md) in a type registry. Three of
 * those four are **runtime** tables, so a condition can be an arbitrary
 * expression evaluated per frame; Godot's `_validate_property` rewrites the
 * usage flags on every rebuild.
 *
 * D's UDAs are the compile-time member of that family, and this program shows
 * the resulting split:
 *
 *   * **Static metadata** (label, group, range, hidden) is a compile-time
 *     constant, so the row's shape can be a manifest constant like the descent
 *     in [`reflect-descent.d`](./reflect-descent.d).
 *   * **A condition over the value** ("show `stops` only for a gradient") cannot
 *     be, so it must be carried _as data_ — here a function pointer in the UDA
 *     evaluated against the live subject. That is the whole seam: a UDA can hold
 *     a predicate, but somebody must run it per frame, and the answer changes the
 *     row set, not just a row's style.
 *
 * Run: `dub run --single uda-metadata.d`
 */
module 
(module) property_tree_uda_metadata

What a UDA metadata channel can and cannot answer before the frame.

Backs ../comparison.md § metadata_ and § conditional visibility_. Every surveyed library carries per-field metadata beside the type — .NET attributes ([Category], [Browsable], [Editor]), Godot's PropertyInfo hint/hint_string/usage triple, Unreal's UPROPERTY(meta=…) string map, and InspectorOptions in a type registry. Three of those four are runtime tables, so a condition can be an arbitrary expression evaluated per frame; Godot's _validate_property rewrites the usage flags on every rebuild.

D's UDAs are the compile-time member of that family, and this program shows the resulting split:

  • Static metadata (label, group, range, hidden) is a compile-time constant, so the row's shape can be a manifest constant like the descent in reflect-descent.d.

  • A condition over the value ("show stops only for a gradient") cannot be, so it must be carried as data_ — here a function pointer in the UDA evaluated against the live subject. That is the whole seam: a UDA can hold a predicate, but somebody must run it per frame, and the answer changes the row set, not just a row's style.

Run

dub run --single uda-metadata.d

property_tree_uda_metadata
;
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) property_tree_uda_metadata.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

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

writefln
,
(alias template) property_tree_uda_metadata.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.

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
;
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_uda_metadata.FieldNameTuple = std.traits.FieldNameTuple(T)

Get as an expression tuple the names of the fields of a struct, class, or union. This consists of the fields that take up memory space, excluding the hidden fields like the virtual function table pointer or a context pointer for nested types. Inherited fields (for classes) are not included. If T isn't a struct, class, interface or union, an expression tuple with an empty string is returned.

@history
  • Returned AliasSeq!"" for interfaces prior to 2.097

FieldNameTuple
,
(alias template) property_tree_uda_metadata.Fields = std.traits.Fields(T)

Get as a tuple the types of the fields of a struct, class, or union. This consists of the fields that take up memory space, excluding the hidden fields like the virtual function table pointer or a context pointer for nested types. If T isn't a struct, class, interface or union returns a tuple with one element T.

@history
  • Returned AliasSeq!(Interface) for interfaces prior to 2.097

Fields
,
(alias template) property_tree_uda_metadata.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_uda_metadata.hasUDA = std.traits.hasUDA(alias symbol, alias attribute)

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

@seegetUDAs
hasUDA
;
@safe: // --- the metadata vocabulary, as UDAs --------------------------------------- struct
(struct) property_tree_uda_metadata.Label
Label
{
(alias) object.string = string
string
(field) string property_tree_uda_metadata.Label.text
text
; }
struct
(struct) property_tree_uda_metadata.Group
Group
{
(alias) object.string = string
string
(field) string property_tree_uda_metadata.Group.name
name
; }
struct
(struct) property_tree_uda_metadata.Range
Range
{ double
(field) double property_tree_uda_metadata.Range.min
min
,
(field) double property_tree_uda_metadata.Range.max
max
; }
struct
(struct) property_tree_uda_metadata.Hidden
Hidden
{}
/// A condition over the whole subject, carried as data because it cannot be a /// compile-time constant. struct
(struct) property_tree_uda_metadata.ShowIf

A condition over the whole subject, carried as data because it cannot be a compile-time constant.

ShowIf
{ bool function(const scope void*) @safe pure nothrow
(field) bool function(scope const(void*)) pure nothrow @safe property_tree_uda_metadata.ShowIf.test
test
; }
// --- the subject ------------------------------------------------------------ enum
(enum) property_tree_uda_metadata.FillKind
FillKind
{
(enum value) property_tree_uda_metadata.FillKind.solid = 0
solid
,
(enum value) property_tree_uda_metadata.FillKind.gradient = 1
gradient
}
struct
(struct) property_tree_uda_metadata.FillSettings
FillSettings
{ @
(struct) property_tree_uda_metadata.Label
Label
("Fill kind") @
(struct) property_tree_uda_metadata.Group
Group
("Appearance")
(enum) property_tree_uda_metadata.FillKind
FillKind
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
kind
;
@
(struct) property_tree_uda_metadata.Label
Label
("Colour") @
(struct) property_tree_uda_metadata.Group
Group
("Appearance")
(alias) object.string = string
string
(field) string property_tree_uda_metadata.FillSettings.color
color
= "#808080";
@
(struct) property_tree_uda_metadata.Label
Label
("Stops") @
(struct) property_tree_uda_metadata.Group
Group
("Appearance") @
(struct) property_tree_uda_metadata.Range
Range
(2, 16)
@
(struct) property_tree_uda_metadata.ShowIf

A condition over the whole subject, carried as data because it cannot be a compile-time constant.

ShowIf
(&
bool property_tree_uda_metadata.isGradient(scope const(void*) subject) pure nothrow @safe
isGradient
)
int
(field) int property_tree_uda_metadata.FillSettings.stops
stops
= 2;
@
(struct) property_tree_uda_metadata.Hidden
Hidden
ulong
(field) ulong property_tree_uda_metadata.FillSettings.revision
revision
;
} private bool
bool property_tree_uda_metadata.isGradient(scope const(void*) subject) pure nothrow @safe
isGradient
(const scope void*
(parameter) const(void*) subject
subject
) @safe pure nothrow
{ // The predicate is written against the subject type it belongs to; the // component only ever sees `bool function(...)`. return (() @trusted => (cast(const
(struct) property_tree_uda_metadata.FillSettings
FillSettings
*)
(parameter) const(void*) subject
subject
).
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
kind
)()
==
(enum) property_tree_uda_metadata.FillKind
FillKind
.
(enum value) property_tree_uda_metadata.FillKind.gradient = 1
gradient
;
} // --- what the component can compute, and when ------------------------------- struct
(struct) property_tree_uda_metadata.RowPlan
RowPlan
{
(alias) object.string = string
string
(field) string property_tree_uda_metadata.RowPlan.field
field
;
(alias) object.string = string
string
(field) string property_tree_uda_metadata.RowPlan.label
label
;
(alias) object.string = string
string
(field) string property_tree_uda_metadata.RowPlan.group
group
;
(alias) object.string = string
string
(field) string property_tree_uda_metadata.RowPlan.range

empty when unconstrained

range
; /// empty when unconstrained
bool
(field) bool property_tree_uda_metadata.RowPlan.conditional

visibility depends on the live value

conditional
; /// visibility depends on the live value
} /// Everything derivable from the type alone. Runs in CTFE.
(struct) property_tree_uda_metadata.RowPlan
RowPlan
[]
property_tree_uda_metadata.RowPlan[] property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings)() pure nothrow @safe

Everything derivable from the type alone. Runs in CTFE.

planRows
(T)() pure nothrow
{
(struct) property_tree_uda_metadata.RowPlan
RowPlan
[]
(local variable) property_tree_uda_metadata.RowPlan[] plan
plan
;
static foreach (i, name;
(constant) string property_tree_uda_metadata.FillSettings.fun!(kind).NameOf = "kind"
FieldNameTuple
!T)
{{ alias
(alias field) property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).member = property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
= __traits(getMember, T, name);
static if (!
(template instance) property_tree_uda_metadata.FillSettings.hasUDA!(kind, property_tree_uda_metadata.Hidden)
hasUDA
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.Hidden
Hidden
))
{ alias
(alias) property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).labels = Filter
labels
=
Filter
getUDAs
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.Label
Label
);
alias
(alias) property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).groups = Filter
groups
=
Filter
getUDAs
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.Group
Group
);
alias
(alias) property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).ranges = ()
ranges
=
(alias) property_tree_uda_metadata.FillSettings.getUDAs!(kind, property_tree_uda_metadata.Range) = ()

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.

Examples

struct Attr
{
    string name;
    int value;
}

@Attr("Answer", 42) int a;
static assert(getUDAs!(a, Attr).length == 1);
static assert(getUDAs!(a, Attr)[0].name == "Answer");
static assert(getUDAs!(a, Attr)[0].value == 42);

@(Attr("Answer", 42), "string", 9999) int b;
static assert(getUDAs!(b, Attr).length == 1);
static assert(getUDAs!(b, Attr)[0].name == "Answer");
static assert(getUDAs!(b, Attr)[0].value == 42);

@Attr("Answer", 42) @Attr("Pi", 3) int c;
static assert(getUDAs!(c, Attr).length == 2);
static assert(getUDAs!(c, Attr)[0].name == "Answer");
static assert(getUDAs!(c, Attr)[0].value == 42);
static assert(getUDAs!(c, Attr)[1].name == "Pi");
static assert(getUDAs!(c, Attr)[1].value == 3);

static assert(getUDAs!(c, Attr("Answer", 42)).length == 1);
static assert(getUDAs!(c, Attr("Answer", 42))[0].name == "Answer");
static assert(getUDAs!(c, Attr("Answer", 42))[0].value == 42);

static assert(getUDAs!(c, Attr("Answer", 99)).length == 0);

struct AttrT(T)
{
    string name;
    T value;
}

@AttrT!uint("Answer", 42) @AttrT!int("Pi", 3) @AttrT int d;
static assert(getUDAs!(d, AttrT).length == 2);
static assert(getUDAs!(d, AttrT)[0].name == "Answer");
static assert(getUDAs!(d, AttrT)[0].value == 42);
static assert(getUDAs!(d, AttrT)[1].name == "Pi");
static assert(getUDAs!(d, AttrT)[1].value == 3);

static assert(getUDAs!(d, AttrT!uint).length == 1);
static assert(getUDAs!(d, AttrT!uint)[0].name == "Answer");
static assert(getUDAs!(d, AttrT!uint)[0].value == 42);

static assert(getUDAs!(d, AttrT!int).length == 1);
static assert(getUDAs!(d, AttrT!int)[0].name == "Pi");
static assert(getUDAs!(d, AttrT!int)[0].value == 3);

struct SimpleAttr {}

@SimpleAttr int e;
static assert(getUDAs!(e, SimpleAttr).length == 1);
static assert(is(getUDAs!(e, SimpleAttr)[0] == SimpleAttr));

@SimpleAttr() int f;
static assert(getUDAs!(f, SimpleAttr).length == 1);
static assert(is(typeof(getUDAs!(f, SimpleAttr)[0]) == SimpleAttr));

struct FuncAttr(alias f) { alias func = f; }
static int add42(int v) { return v + 42; }
static string concat(string l, string r) { return l ~ r; }

@FuncAttr!add42 int g;
static assert(getUDAs!(g, FuncAttr).length == 1);
static assert(getUDAs!(g, FuncAttr)[0].func(5) == 47);

static assert(getUDAs!(g, FuncAttr!add42).length == 1);
static assert(getUDAs!(g, FuncAttr!add42)[0].func(5) == 47);

static assert(getUDAs!(g, FuncAttr!add42()).length == 0);

static assert(getUDAs!(g, FuncAttr!concat).length == 0);
static assert(getUDAs!(g, FuncAttr!concat()).length == 0);

@FuncAttr!add42() int h;
static assert(getUDAs!(h, FuncAttr).length == 1);
static assert(getUDAs!(h, FuncAttr)[0].func(5) == 47);

static assert(getUDAs!(h, FuncAttr!add42).length == 1);
static assert(getUDAs!(h, FuncAttr!add42)[0].func(5) == 47);

static assert(getUDAs!(h, FuncAttr!add42()).length == 1);
static assert(getUDAs!(h, FuncAttr!add42())[0].func(5) == 47);

static assert(getUDAs!(h, FuncAttr!concat).length == 0);
static assert(getUDAs!(h, FuncAttr!concat()).length == 0);

@("alpha") @(42) int i;
static assert(getUDAs!(i, "alpha").length == 1);
static assert(getUDAs!(i, "alpha")[0] == "alpha");

static assert(getUDAs!(i, 42).length == 1);
static assert(getUDAs!(i, 42)[0] == 42);

static assert(getUDAs!(i, 'c').length == 0);
@seehasUDA
getUDAs
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.Range
Range
);
static if (
(constant) property_tree_uda_metadata.Label std.meta.Filter!(isDesiredUDA, Label("Fill kind"), Group("Appearance")).arg = Label("Fill kind")
labels
.length) enum
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).label = "Fill kind"
label
=
(constant) property_tree_uda_metadata.Label std.meta.Filter!(isDesiredUDA, Label("Fill kind"), Group("Appearance")).arg = Label("Fill kind")
labels
[0].
(field) string property_tree_uda_metadata.Label.text
text
; else enum label = name;
static if (
(constant) property_tree_uda_metadata.Group std.meta.Filter!(isDesiredUDA, Label("Fill kind"), Group("Appearance")).arg = Group("Appearance")
groups
.length) enum
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).group = "Appearance"
group
=
(constant) property_tree_uda_metadata.Group std.meta.Filter!(isDesiredUDA, Label("Fill kind"), Group("Appearance")).arg = Group("Appearance")
groups
[0].
(field) string property_tree_uda_metadata.Group.name
name
; else enum group = "";
static if (
(constant) property_tree_uda_metadata.Range std.meta.Filter!(isDesiredUDA, Label("Stops"), Group("Appearance"), Range(2.0, 16.0), ShowIf(& isGradient)).arg = Range(2.0, 16.0)
ranges
.length) enum
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).range = ['[', '2', ' ', '\xe2', '\x80', '\xa6', ' ', '1', '6', ']']
range
=
string property_tree_uda_metadata.rangeText(property_tree_uda_metadata.Range r) pure @safe
rangeText
(
(constant) property_tree_uda_metadata.Range std.meta.Filter!(isDesiredUDA, Label("Stops"), Group("Appearance"), Range(2.0, 16.0), ShowIf(& isGradient)).arg = Range(2.0, 16.0)
ranges
[0]); else enum
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).range = ""
range
= "";
(local variable) property_tree_uda_metadata.RowPlan[] plan
plan
~=
(struct) property_tree_uda_metadata.RowPlan
RowPlan
(
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).name = "kind"
name
,
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).label = "Fill kind"
label
,
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).group = "Appearance"
group
,
(constant) string property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).range = ""
range
,
(template instance) property_tree_uda_metadata.FillSettings.hasUDA!(kind, property_tree_uda_metadata.ShowIf)
hasUDA
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.ShowIf

A condition over the whole subject, carried as data because it cannot be a compile-time constant.

ShowIf
));
} }} return
(local variable) property_tree_uda_metadata.RowPlan[] plan
plan
;
} private
(alias) object.string = string
string
string property_tree_uda_metadata.rangeText(property_tree_uda_metadata.Range r) pure @safe
rangeText
(
(struct) property_tree_uda_metadata.Range
Range
(parameter) property_tree_uda_metadata.Range r
r
) pure
{ 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) 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
;
return
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
("[",
(parameter) property_tree_uda_metadata.Range r
r
.
(field) double property_tree_uda_metadata.Range.min
min
, " … ",
(parameter) property_tree_uda_metadata.Range r
r
.
(field) double property_tree_uda_metadata.Range.max
max
, "]");
} /// The rows actually visible for a given value. Needs the subject; runs per frame.
(alias) object.string = string
string
[]
string[] property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings)(ref const(property_tree_uda_metadata.FillSettings) subject) pure nothrow @trusted

The rows actually visible for a given value. Needs the subject; runs per frame.

visibleRows
(T)(ref const
(alias) T = property_tree_uda_metadata.FillSettings
T
(parameter) const(property_tree_uda_metadata.FillSettings) subject
subject
) @trusted
{
(alias) object.string = string
string
[]
(local variable) string[] visible
visible
;
static foreach (name;
(constant) string property_tree_uda_metadata.FillSettings.fun!(kind).NameOf = "kind"
FieldNameTuple
!T)
{{ alias
(alias field) property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings).member = property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
= __traits(getMember, T, name);
static if (!
(template instance) property_tree_uda_metadata.FillSettings.hasUDA!(kind, property_tree_uda_metadata.Hidden)
hasUDA
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.Hidden
Hidden
))
{ enum
(constant) () property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings).conds = ()
conds
=
(constant) property_tree_uda_metadata.ShowIf std.meta.Filter!(isDesiredUDA, Label("Stops"), Group("Appearance"), Range(2.0, 16.0), ShowIf(& isGradient)).arg = ShowIf(& isGradient)
getUDAs
!(
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
member
,
(struct) property_tree_uda_metadata.ShowIf

A condition over the whole subject, carried as data because it cannot be a compile-time constant.

ShowIf
);
static if (conds.length) { if (conds[0].
(field) bool function(scope const(void*)) pure nothrow @safe property_tree_uda_metadata.ShowIf.test
test
(cast(const void*) &
(parameter) const(property_tree_uda_metadata.FillSettings) subject
subject
))
(local variable) string[] visible
visible
~=
(constant) string property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings).name = "stops"
name
;
} else
(local variable) string[] visible
visible
~=
(constant) string property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings).name = "kind"
name
;
} }} return
(local variable) string[] visible
visible
;
} void
void D main() @safe
main
()
{ enum
(constant) property_tree_uda_metadata.RowPlan[] property_tree_uda_metadata.main.plan = [RowPlan("kind", "Fill kind", "Appearance", "", false), RowPlan("color", "Colour", "Appearance", "", false), RowPlan("stops", "Stops", "Appearance", ['[', '2', ' ', '\xe2', '\x80', '\xa6', ' ', '1', '6', ']'], true)]
plan
=
property_tree_uda_metadata.RowPlan[] property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings)() pure nothrow @safe

Everything derivable from the type alone. Runs in CTFE.

planRows
!
(struct) property_tree_uda_metadata.FillSettings
FillSettings
(); // a compile-time constant
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
("field label group range conditional");
foreach (
(parameter) property_tree_uda_metadata.RowPlan r
r
;
(constant) property_tree_uda_metadata.RowPlan[] property_tree_uda_metadata.main.plan = [RowPlan("kind", "Fill kind", "Appearance", "", false), RowPlan("color", "Colour", "Appearance", "", false), RowPlan("stops", "Stops", "Appearance", ['[', '2', ' ', '\xe2', '\x80', '\xa6', ' ', '1', '6', ']'], true)]
plan
)
void std.stdio.writefln!(char, string, string, string, string, string)(in char[] fmt, string __param_1, string __param_2, string __param_3, string __param_4, string __param_5) @safe

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

writefln
("%-8s %-12s %-12s %-12s %s",
(local variable) property_tree_uda_metadata.RowPlan r
r
.
(field) string property_tree_uda_metadata.RowPlan.field
field
,
(local variable) property_tree_uda_metadata.RowPlan r
r
.
(field) string property_tree_uda_metadata.RowPlan.label
label
,
(local variable) property_tree_uda_metadata.RowPlan r
r
.
(field) string property_tree_uda_metadata.RowPlan.group
group
,
(local variable) property_tree_uda_metadata.RowPlan r
r
.
(field) string property_tree_uda_metadata.RowPlan.range

empty when unconstrained

range
.
(field) ulong string.length
length
?
(local variable) property_tree_uda_metadata.RowPlan r
r
.
(field) string property_tree_uda_metadata.RowPlan.range

empty when unconstrained

range
: "-",
(local variable) property_tree_uda_metadata.RowPlan r
r
.
(field) bool property_tree_uda_metadata.RowPlan.conditional

visibility depends on the live value

conditional
? "yes" : "no");
void std.stdio.writeln!()() @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
();
void std.stdio.writefln!(char, bool)(in char[] fmt, bool __param_1) @safe

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

writefln
("`revision` is absent from the plan: %s",
!
bool property_tree_uda_metadata.hasField(in property_tree_uda_metadata.RowPlan[] plan, string name) pure nothrow @nogc @safe
hasField
(
(constant) property_tree_uda_metadata.RowPlan[] property_tree_uda_metadata.main.plan = [RowPlan("kind", "Fill kind", "Appearance", "", false), RowPlan("color", "Colour", "Appearance", "", false), RowPlan("stops", "Stops", "Appearance", ['[', '2', ' ', '\xe2', '\x80', '\xa6', ' ', '1', '6', ']'], true)]
plan
, "revision"));
void std.stdio.writeln!()() @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
();
(struct) property_tree_uda_metadata.FillSettings
FillSettings
(local variable) property_tree_uda_metadata.FillSettings s
s
;
void std.stdio.writefln!(char, property_tree_uda_metadata.FillKind, string[])(in char[] fmt, property_tree_uda_metadata.FillKind __param_1, string[] __param_2) @safe

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

writefln
("kind=%s visible=%s",
(local variable) property_tree_uda_metadata.FillSettings s
s
.
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
kind
,
string[] property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings)(ref const(property_tree_uda_metadata.FillSettings) subject) pure nothrow @trusted

The rows actually visible for a given value. Needs the subject; runs per frame.

visibleRows
(
(local variable) property_tree_uda_metadata.FillSettings s
s
));
(local variable) property_tree_uda_metadata.FillSettings s
s
.
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
kind
=
(enum) property_tree_uda_metadata.FillKind
FillKind
.
(enum value) property_tree_uda_metadata.FillKind.gradient = 1
gradient
;
void std.stdio.writefln!(char, property_tree_uda_metadata.FillKind, string[])(in char[] fmt, property_tree_uda_metadata.FillKind __param_1, string[] __param_2) @safe

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

writefln
("kind=%s visible=%s",
(local variable) property_tree_uda_metadata.FillSettings s
s
.
(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kind
kind
,
string[] property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings)(ref const(property_tree_uda_metadata.FillSettings) subject) pure nothrow @trusted

The rows actually visible for a given value. Needs the subject; runs per frame.

visibleRows
(
(local variable) property_tree_uda_metadata.FillSettings s
s
));
} private bool
bool property_tree_uda_metadata.hasField(in property_tree_uda_metadata.RowPlan[] plan, string name) pure nothrow @nogc @safe
hasField
(in
(struct) property_tree_uda_metadata.RowPlan
RowPlan
[]
(parameter) const(property_tree_uda_metadata.RowPlan[]) plan
plan
,
(alias) object.string = string
string
(parameter) string name
name
) pure nothrow @nogc
{ foreach (
(parameter) const(property_tree_uda_metadata.RowPlan) r
r
;
(parameter) const(property_tree_uda_metadata.RowPlan[]) plan
plan
)
if (
(local variable) const(property_tree_uda_metadata.RowPlan) r
r
.
(field) string property_tree_uda_metadata.RowPlan.field
field
==
(parameter) string name
name
)
return true; return false; }