sdlAttribute

Forces a value to be serialized as an SDL attribute.

This can be applied to plain values in aggregate members and will cause the vaule to be seriailzed as an attribute of the parent tag instead of as a child tag.

@property
SDLAttributeAttribute
sdlAttribute
()

Examples

struct S {
	int foo;
	@sdlAttribute int bar;
}

struct T {
	S s;
}

assert(
	serializeSDLang(T(S(1, 2))).toSDLDocument() ==
	"s bar=2 {\n" ~
	"\tfoo 1\n" ~
	"}\n"
);

Meta