mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-01-13 19:50:28 +00:00
52 lines
1.8 KiB
Dart
52 lines
1.8 KiB
Dart
// This file is automatically generated, so please do not edit it.
|
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
|
|
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
|
|
|
import '../frb_generated.dart';
|
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
|
|
part 'unp4k_api.freezed.dart';
|
|
|
|
// These functions are ignored because they are not marked as `pub`: `dos_datetime_to_millis`, `ensure_files_loaded`
|
|
|
|
/// 打开 P4K 文件(仅打开,不读取文件列表)
|
|
Future<void> p4KOpen({required String p4KPath}) =>
|
|
RustLib.instance.api.crateApiUnp4KApiP4KOpen(p4KPath: p4KPath);
|
|
|
|
/// 获取文件数量(会触发文件列表加载)
|
|
Future<BigInt> p4KGetFileCount() =>
|
|
RustLib.instance.api.crateApiUnp4KApiP4KGetFileCount();
|
|
|
|
/// 获取所有文件列表
|
|
Future<List<P4kFileItem>> p4KGetAllFiles() =>
|
|
RustLib.instance.api.crateApiUnp4KApiP4KGetAllFiles();
|
|
|
|
/// 提取文件到内存
|
|
Future<Uint8List> p4KExtractToMemory({required String filePath}) =>
|
|
RustLib.instance.api.crateApiUnp4KApiP4KExtractToMemory(filePath: filePath);
|
|
|
|
/// 提取文件到磁盘
|
|
Future<void> p4KExtractToDisk({
|
|
required String filePath,
|
|
required String outputPath,
|
|
}) => RustLib.instance.api.crateApiUnp4KApiP4KExtractToDisk(
|
|
filePath: filePath,
|
|
outputPath: outputPath,
|
|
);
|
|
|
|
/// 关闭 P4K 读取器
|
|
Future<void> p4KClose() => RustLib.instance.api.crateApiUnp4KApiP4KClose();
|
|
|
|
/// P4K 文件项信息
|
|
@freezed
|
|
sealed class P4kFileItem with _$P4kFileItem {
|
|
const factory P4kFileItem({
|
|
required String name,
|
|
required bool isDirectory,
|
|
required BigInt size,
|
|
required BigInt compressedSize,
|
|
required PlatformInt64 dateModified,
|
|
}) = _P4kFileItem;
|
|
}
|