writeFile method

FileIndex writeFile({
  1. required String name,
  2. required Uint8List hashValue,
  3. FileAttributes flags = const FileAttributes(0),
})

Writes a File row, returning the corresponding index.

Implementation

FileIndex writeFile({
  required String name,
  required Uint8List hashValue,
  FileAttributes flags = const FileAttributes(0),
}) {
  final table = _tableStream[MetadataTableId.file];
  final index = FileIndex(table.length);
  table.add(
    File(
      flags: flags,
      name: _stringHeap.insert(name),
      hashValue: _blobHeap.insert(hashValue),
    ),
  );
  return index;
}