wabbajack/Wabbajack.Compression.BSA/Interfaces/IFile.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2021-09-27 12:42:46 +00:00
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Wabbajack.DTOs.BSA.FileStates;
using Wabbajack.DTOs.Streams;
using Wabbajack.Paths;
2021-10-23 16:51:17 +00:00
namespace Wabbajack.Compression.BSA.Interfaces;
public interface IFile
2021-09-27 12:42:46 +00:00
{
2021-10-23 16:51:17 +00:00
/// <summary>
/// The path of the file inside the archive
/// </summary>
RelativePath Path { get; }
2021-09-27 12:42:46 +00:00
2021-10-23 16:51:17 +00:00
/// <summary>
/// The uncompressed file size
/// </summary>
uint Size { get; }
2021-09-27 12:42:46 +00:00
2021-10-23 16:51:17 +00:00
/// <summary>
/// Get the metadata for the file.
/// </summary>
AFile State { get; }
2021-09-27 12:42:46 +00:00
2021-10-23 16:51:17 +00:00
/// <summary>
/// Copies this entry to the given stream. 100% thread safe, the .bsa will be opened multiple times
/// in order to maintain thread-safe access.
/// </summary>
/// <param name="output"></param>
ValueTask CopyDataTo(Stream output, CancellationToken token);
2021-09-27 12:42:46 +00:00
2021-10-23 16:51:17 +00:00
/// <summary>
/// Stream factory for this file
/// </summary>
/// <returns></returns>
ValueTask<IStreamFactory> GetStreamFactory(CancellationToken token);
2021-09-27 12:42:46 +00:00
}