as

fnT as(T)(CfNode * self) @safe pure nothrow

Type-safe value extraction for CfNode pointers (UFCS).

Converts the node's value to the requested type. For incompatible types or null pointers, returns the type's .init value.

Supported types:

  • string - for STRING, DATE, TIME, DATETIME nodes
  • long, int, short, byte - for INTEGER nodes
  • ulong, uint, ushort, ubyte - for INTEGER nodes
  • double, float - for FLOAT and INTEGER nodes
  • bool - for BOOLEAN nodes

Example:

auto doc = parseCFDocument(`name = "test", count = 42`);
string name = doc["name"].as!string;  // "test"
long count = doc["count"].as!long;    // 42

fnT as(T)(const(CfNode) * self) @safe pure nothrow

Type-safe value extraction for const CfNode pointers (UFCS).

Parameters

selfThe const node pointer to extract value from

Returns

The value converted to type T, or T.init if incompatible or null.
fnT as(T)(ref const CfNode self) @safe pure nothrow

Type-safe value extraction for CfNode references (UFCS).

Parameters

selfThe node reference to extract value from

Returns

The value converted to type T, or T.init if incompatible.