setColumnName method

void setColumnName(
  1. int index,
  2. String columnName
)

Sets the name of the column at zero-based index index to columnName. The first column is at index 0.

Calling this method automatically sets HasColumnNames to true. It can therefore be used on an empty object to create the column-name row. index must not be negative.

For reliable name-based access, use unique column names without surrounding whitespace.

Throws a ChilkatException if the call fails; the details are in ChilkatException.lastErrorText. Throws an ArgumentError if a string argument contains a NUL character.

Implementation

void setColumnName(int index, String columnName) {
  final h = _handle;
  using((arena) {
    final r = _CkCsv_SetColumnName(
      h,
      index,
      _toNative(arena, columnName, 'columnName'),
    );
    if (r == 0) {
      throw _fail('setColumnName');
    }
  });
}