TagStorage.opIndex

Hash-like access to tags. Time complexity is O(number of tags).
If tag with such key is not found, returned value 'is nothing'.
If key length is different from 2, exception is thrown.
Special case when value represents nothing is used for removing tag (assuming that no more than one with this key is presented in the record).

  1. bio.std.hts.bam.tagvalue.Value opIndex(string key)
    mixintemplate TagStorage()
    const
    opIndex
    (
    string key
    )
  2. void opIndexAssign(T value, string key)

Examples

auto v = read["NM"];
assert(v.is_integer);

auto v = read["MN"];
assert(v.is_nothing); // no such tag

read["NM"] = 3; // converted to bio.std.hts.bam.tagvalue.Value implicitly

read["NM"] = null; // removes tag
assert(read["NM"].is_nothing);

Meta