stringAsCharArray<R extends RTypeIntLike> method

StructStringValueField<R> stringAsCharArray<R extends RTypeIntLike>(
  1. F f
)

Creates a fixed-size character array field for f.

The array is interpreted as a null-terminated string using the character type represented by the field's element type.

Implementation

StructStringValueField<R> stringAsCharArray<R extends RTypeIntLike>(F f) {
  _checkField(f);
  final type = _getFieldAs<RArray<R>>(f);
  final element = type.element;
  _checkStringType(f, element, 'char array field');
  return .new(offset(f), StringCodec(element));
}