#!/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_metadataWhat 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) 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) 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);
}
}
writeln;
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) 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.
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.
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.
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.
hasUDA;
@safe:
// --- the metadata vocabulary, as UDAs ---------------------------------------
struct (struct) property_tree_uda_metadata.LabelLabel { (alias) object.string = stringstring (field) string property_tree_uda_metadata.Label.texttext; }
struct (struct) property_tree_uda_metadata.GroupGroup { (alias) object.string = stringstring (field) string property_tree_uda_metadata.Group.namename; }
struct (struct) property_tree_uda_metadata.RangeRange { double (field) double property_tree_uda_metadata.Range.minmin, (field) double property_tree_uda_metadata.Range.maxmax; }
struct (struct) property_tree_uda_metadata.HiddenHidden {}
/// A condition over the whole subject, carried as data because it cannot be a
/// compile-time constant.
struct (struct) property_tree_uda_metadata.ShowIfA 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.testtest; }
// --- the subject ------------------------------------------------------------
enum (enum) property_tree_uda_metadata.FillKindFillKind { (enum value) property_tree_uda_metadata.FillKind.solid = 0solid, (enum value) property_tree_uda_metadata.FillKind.gradient = 1gradient }
struct (struct) property_tree_uda_metadata.FillSettingsFillSettings
{
@(struct) property_tree_uda_metadata.LabelLabel("Fill kind") @(struct) property_tree_uda_metadata.GroupGroup("Appearance")
(enum) property_tree_uda_metadata.FillKindFillKind (field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindkind;
@(struct) property_tree_uda_metadata.LabelLabel("Colour") @(struct) property_tree_uda_metadata.GroupGroup("Appearance")
(alias) object.string = stringstring (field) string property_tree_uda_metadata.FillSettings.colorcolor = "#808080";
@(struct) property_tree_uda_metadata.LabelLabel("Stops") @(struct) property_tree_uda_metadata.GroupGroup("Appearance") @(struct) property_tree_uda_metadata.RangeRange(2, 16)
@(struct) property_tree_uda_metadata.ShowIfA 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 @safeisGradient)
int (field) int property_tree_uda_metadata.FillSettings.stopsstops = 2;
@(struct) property_tree_uda_metadata.HiddenHidden
ulong (field) ulong property_tree_uda_metadata.FillSettings.revisionrevision;
}
private bool bool property_tree_uda_metadata.isGradient(scope const(void*) subject) pure nothrow @safeisGradient(const scope void* (parameter) const(void*) subjectsubject) @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.FillSettingsFillSettings*) (parameter) const(void*) subjectsubject).(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindkind)()
== (enum) property_tree_uda_metadata.FillKindFillKind.(enum value) property_tree_uda_metadata.FillKind.gradient = 1gradient;
}
// --- what the component can compute, and when -------------------------------
struct (struct) property_tree_uda_metadata.RowPlanRowPlan
{
(alias) object.string = stringstring (field) string property_tree_uda_metadata.RowPlan.fieldfield;
(alias) object.string = stringstring (field) string property_tree_uda_metadata.RowPlan.labellabel;
(alias) object.string = stringstring (field) string property_tree_uda_metadata.RowPlan.groupgroup;
(alias) object.string = stringstring (field) string property_tree_uda_metadata.RowPlan.rangeempty when unconstrained
range; /// empty when unconstrained
bool (field) bool property_tree_uda_metadata.RowPlan.conditionalvisibility 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.RowPlanRowPlan[] property_tree_uda_metadata.RowPlan[] property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings)() pure nothrow @safeEverything derivable from the type alone. Runs in CTFE.
planRows(T)() pure nothrow
{
(struct) property_tree_uda_metadata.RowPlanRowPlan[] (local variable) property_tree_uda_metadata.RowPlan[] planplan;
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.kindmember = __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.kindmember, (struct) property_tree_uda_metadata.HiddenHidden))
{
alias (alias) property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).labels = Filterlabels = FiltergetUDAs!((field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindmember, (struct) property_tree_uda_metadata.LabelLabel);
alias (alias) property_tree_uda_metadata.planRows!(property_tree_uda_metadata.FillSettings).groups = Filtergroups = FiltergetUDAs!((field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindmember, (struct) property_tree_uda_metadata.GroupGroup);
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);
getUDAs!((field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindmember, (struct) property_tree_uda_metadata.RangeRange);
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.texttext; 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.namename; 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 @saferangeText((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[] planplan ~= (struct) property_tree_uda_metadata.RowPlanRowPlan((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.kindmember, (struct) property_tree_uda_metadata.ShowIfA 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[] planplan;
}
private (alias) object.string = stringstring string property_tree_uda_metadata.rangeText(property_tree_uda_metadata.Range r) pure @saferangeText((struct) property_tree_uda_metadata.RangeRange (parameter) property_tree_uda_metadata.Range rr) pure
{
import (package) stdstd.(module) std.convA 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
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 @safeConvenience functions for converting one or more arguments
of any type into text (the three character widths).
text("[", (parameter) property_tree_uda_metadata.Range rr.(field) double property_tree_uda_metadata.Range.minmin, " … ", (parameter) property_tree_uda_metadata.Range rr.(field) double property_tree_uda_metadata.Range.maxmax, "]");
}
/// The rows actually visible for a given value. Needs the subject; runs per frame.
(alias) object.string = stringstring[] string[] property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings)(ref const(property_tree_uda_metadata.FillSettings) subject) pure nothrow @trustedThe rows actually visible for a given value. Needs the subject; runs per frame.
visibleRows(T)(ref const (alias) T = property_tree_uda_metadata.FillSettingsT (parameter) const(property_tree_uda_metadata.FillSettings) subjectsubject) @trusted
{
(alias) object.string = stringstring[] (local variable) string[] visiblevisible;
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.kindmember = __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.kindmember, (struct) property_tree_uda_metadata.HiddenHidden))
{
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.kindmember, (struct) property_tree_uda_metadata.ShowIfA 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.testtest(cast(const void*) &(parameter) const(property_tree_uda_metadata.FillSettings) subjectsubject))
(local variable) string[] visiblevisible ~= (constant) string property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings).name = "stops"name;
}
else
(local variable) string[] visiblevisible ~= (constant) string property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings).name = "kind"name;
}
}}
return (local variable) string[] visiblevisible;
}
void void D main() @safemain()
{
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 @safeEverything derivable from the type alone. Runs in CTFE.
planRows!(struct) property_tree_uda_metadata.FillSettingsFillSettings(); // a compile-time constant
void std.stdio.writeln!string(string __param_0) @safeEquivalent 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);
}
}
writeln("field label group range conditional");
foreach ((parameter) property_tree_uda_metadata.RowPlan rr; (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) @safeEquivalent to writef(fmt, args, '\n').
writefln("%-8s %-12s %-12s %-12s %s", (local variable) property_tree_uda_metadata.RowPlan rr.(field) string property_tree_uda_metadata.RowPlan.fieldfield, (local variable) property_tree_uda_metadata.RowPlan rr.(field) string property_tree_uda_metadata.RowPlan.labellabel, (local variable) property_tree_uda_metadata.RowPlan rr.(field) string property_tree_uda_metadata.RowPlan.groupgroup,
(local variable) property_tree_uda_metadata.RowPlan rr.(field) string property_tree_uda_metadata.RowPlan.rangeempty when unconstrained
range.(field) ulong string.lengthlength ? (local variable) property_tree_uda_metadata.RowPlan rr.(field) string property_tree_uda_metadata.RowPlan.rangeempty when unconstrained
range : "-", (local variable) property_tree_uda_metadata.RowPlan rr.(field) bool property_tree_uda_metadata.RowPlan.conditionalvisibility depends on the live value
conditional ? "yes" : "no");
void std.stdio.writeln!()() @safeEquivalent 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);
}
}
writeln();
void std.stdio.writefln!(char, bool)(in char[] fmt, bool __param_1) @safeEquivalent 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 @safehasField((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!()() @safeEquivalent 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);
}
}
writeln();
(struct) property_tree_uda_metadata.FillSettingsFillSettings (local variable) property_tree_uda_metadata.FillSettings ss;
void std.stdio.writefln!(char, property_tree_uda_metadata.FillKind, string[])(in char[] fmt, property_tree_uda_metadata.FillKind __param_1, string[] __param_2) @safeEquivalent to writef(fmt, args, '\n').
writefln("kind=%s visible=%s", (local variable) property_tree_uda_metadata.FillSettings ss.(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindkind, string[] property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings)(ref const(property_tree_uda_metadata.FillSettings) subject) pure nothrow @trustedThe rows actually visible for a given value. Needs the subject; runs per frame.
visibleRows((local variable) property_tree_uda_metadata.FillSettings ss));
(local variable) property_tree_uda_metadata.FillSettings ss.(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindkind = (enum) property_tree_uda_metadata.FillKindFillKind.(enum value) property_tree_uda_metadata.FillKind.gradient = 1gradient;
void std.stdio.writefln!(char, property_tree_uda_metadata.FillKind, string[])(in char[] fmt, property_tree_uda_metadata.FillKind __param_1, string[] __param_2) @safeEquivalent to writef(fmt, args, '\n').
writefln("kind=%s visible=%s", (local variable) property_tree_uda_metadata.FillSettings ss.(field) property_tree_uda_metadata.FillKind property_tree_uda_metadata.FillSettings.kindkind, string[] property_tree_uda_metadata.visibleRows!(property_tree_uda_metadata.FillSettings)(ref const(property_tree_uda_metadata.FillSettings) subject) pure nothrow @trustedThe rows actually visible for a given value. Needs the subject; runs per frame.
visibleRows((local variable) property_tree_uda_metadata.FillSettings ss));
}
private bool bool property_tree_uda_metadata.hasField(in property_tree_uda_metadata.RowPlan[] plan, string name) pure nothrow @nogc @safehasField(in (struct) property_tree_uda_metadata.RowPlanRowPlan[] (parameter) const(property_tree_uda_metadata.RowPlan[]) planplan, (alias) object.string = stringstring (parameter) string namename) pure nothrow @nogc
{
foreach ((parameter) const(property_tree_uda_metadata.RowPlan) rr; (parameter) const(property_tree_uda_metadata.RowPlan[]) planplan)
if ((local variable) const(property_tree_uda_metadata.RowPlan) rr.(field) string property_tree_uda_metadata.RowPlan.fieldfield == (parameter) string namename)
return true;
return false;
}