ArchiveObject.opIndex

An operator version of ArchiveObject.expectChild that takes multiple child names.

  1. ArchiveObject opIndex(string childName)
  2. ArchiveObject opIndex(Names childNames)
    class ArchiveObject
    final
    opIndex
    (
    Names...
    )
    ()
    if (
    Names.length > 0 &&
    is(Names[0] : const(char)[])
    &&
    allSameType!Names
    )

Examples

auto obj = new ArchiveObject();
obj.addChild(new ArchiveObject("Foo"));
obj["Foo"].addChild(new ArchiveObject("Bar"));
obj["Foo", "Bar"].addChild(new ArchiveObject("Baz"));
obj["Foo", "Bar", "Baz"].addValueAs!int(69);

assert(obj["Foo", "Bar", "Baz"].getValueAs!int(0) == 69);

Meta