intValue property

int? get intValue

Returns an int, if the underlying value can be represented as an int.

Otherwise returns null.

Implementation

int? get intValue {
  if (_valueType == ValueType.Int) {
    return _readInt(_offset, _parentWidth);
  }
  if (_valueType == ValueType.UInt) {
    return _readUInt(_offset, _parentWidth);
  }
  if (_valueType == ValueType.IndirectInt) {
    return _readInt(_indirect, BitWidthUtil.fromByteWidth(_byteWidth));
  }
  if (_valueType == ValueType.IndirectUInt) {
    return _readUInt(_indirect, BitWidthUtil.fromByteWidth(_byteWidth));
  }
  return null;
}