'Reads magic database data. Maps the list fields into class attributes.
:param offset: Offset from start of the file.
:param t: Type of the magic data.
:param op: Operation to be performed when comparing the data.
:param value: Expected value of the magic data for a given data type.
:param msg: String representing the file mimetype.'

def __init__(self, offset, t, op, value, msg, mask=None):

    if (t.count('&') > 0):
        mask = _str_to_num(t[(t.index('&') + 1):])
        t = t[:t.index('&')]
    if isinstance(offset, str):
        self.offset = _str_to_num(offset)
    else:
        self.offset = offset
    self.type = t
    self.msg = msg
    self.subTests = []
    self.op = op
    self.mask = mask
    self.value = value
