using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Wabbajack.Common;
namespace Compression.BSA
{
public interface IBSAReader : IAsyncDisposable
{
///
/// The files defined by the archive
///
IEnumerable Files { get; }
ArchiveStateObject State { get; }
void Dump(Action print);
}
public interface IBSABuilder : IAsyncDisposable
{
Task AddFile(FileStateObject state, Stream src);
Task Build(AbsolutePath filename);
}
public class ArchiveStateObject
{
public virtual IBSABuilder MakeBuilder(long size)
{
throw new NotImplementedException();
}
}
public class FileStateObject
{
public int Index { get; set; }
public RelativePath Path { get; set; }
}
public interface IFile
{
///
/// The path of the file inside the archive
///
RelativePath Path { get; }
///
/// The uncompressed file size
///
uint Size { get; }
///
/// Get the metadata for the file.
///
FileStateObject State { get; }
///
/// Copies this entry to the given stream. 100% thread safe, the .bsa will be opened multiple times
/// in order to maintain thread-safe access.
///
///
void CopyDataTo(Stream output);
void Dump(Action print);
}
}