[HA] Implement GetCompressedSize and GetUncompressedSize

This commit is contained in:
2025-09-08 01:23:08 +01:00
parent c387aee8fe
commit 8c3a757c1e
2 changed files with 28 additions and 6 deletions

View File

@@ -46,5 +46,33 @@ public sealed partial class Ha
return ErrorNumber.NoSuchFile;
}
/// <inheritdoc />
public ErrorNumber GetCompressedSize(int entryNumber, out long length)
{
length = -1;
if(!Opened) return ErrorNumber.NotOpened;
if(entryNumber < 0 || entryNumber >= _entries.Count) return ErrorNumber.OutOfRange;
length = _entries[entryNumber].Compressed;
return ErrorNumber.NoError;
}
/// <inheritdoc />
public ErrorNumber GetUncompressedSize(int entryNumber, out long length)
{
length = -1;
if(!Opened) return ErrorNumber.NotOpened;
if(entryNumber < 0 || entryNumber >= _entries.Count) return ErrorNumber.OutOfRange;
length = _entries[entryNumber].Uncompressed;
return ErrorNumber.NoError;
}
#endregion
}

View File

@@ -11,12 +11,6 @@ public sealed partial class Ha
{
#region IArchive Members
/// <inheritdoc />
public ErrorNumber GetCompressedSize(int entryNumber, out long length) => throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber GetUncompressedSize(int entryNumber, out long length) => throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes) =>
throw new NotImplementedException();