dxml
dxml copied to clipboard
need a shorter way to reach attributes of Entities.
It would be nice if we could access the attributes like:
string id = entity.attributes!"id"; or entity.attributes["id"];
please forgive me for my ignorance in advance, if I missed an existing feature. Only way I can do is looping over entire attributes.
attributes
returns a range, so you can use std.alorgithm
's find
- e.g. something like
auto id = entity.attributes.find!(a => a.name == "id")();