Archive.unarchiveAssociativeArrayKey

Unarchives an associative array key.

There are separate methods for unarchiving associative array keys and values because both the key and the value can be of arbitrary type and needs to be unarchived on its own.

interface Archive
void
unarchiveAssociativeArrayKey
(
string key
,
void delegate
()
dg
)

Parameters

key string

the key associated with the key

dg void delegate
()

a callback that performs the actual unarchiving of the key

Examples

auto archive = new XmlArchive!();
archive.beginUnarchiving(data);

for (size_t i = 0; i < length; i++)
{
    unarchiveAssociativeArrayKey(to!(string(i), {
        // unarchive the key
    }));
}

The for statement in the above example would most likely be executed in the callback passed to the unarchiveAssociativeArray method.

See Also

unarchiveAssociativeArrayValue unarchiveAssociativeArray

Meta