[AMG] Implement GetCompressedSize and GetUncompressedSize.

This commit is contained in:
2025-09-05 03:12:14 +01:00
parent 3fd9066ac0
commit a341288813
2 changed files with 28 additions and 6 deletions

View File

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

View File

@@ -11,12 +11,6 @@ public sealed partial class Amg
{
#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();