CfNode.opIndex

CfNodeRef opIndex(string key) @safe pure nothrow

Index operator for object member access.

Enables node["key"] syntax for accessing object members. Returns a CfNodeRef wrapper that supports further chaining.

Example:

auto doc = parseCFDocument(`server { port = 8080 }`);
auto port = doc.root["server"]["port"].as!long;
assert(port == 8080);

CfNodeRef opIndex(size_t index) @safe pure nothrow

Index operator for array element access.

Enables node[0] syntax for accessing array elements. Returns a CfNodeRef wrapper that supports further chaining.

Example:

auto doc = parseCFDocument(`ports = [80, 443, 8080]`);
auto first = doc.root["ports"][0].as!long;
assert(first == 80);