This commit is contained in:
Lani Aung
2024-09-25 20:01:32 -06:00
parent d39e73a6fa
commit 94ab274246
10 changed files with 146 additions and 59 deletions
@@ -1,4 +1,3 @@
using fxl.codes.kisekae.data.Archives.LhHeaders;
using fxl.codes.kisekae.data.Entities;
using Microsoft.Extensions.Logging;
@@ -8,29 +7,13 @@ public class LhCodecService(ILogger<LhCodecService> logger)
{
public async Task<Kisekae?> ReadArchive(Stream stream)
{
try
{
var header = new LhHeader(in stream);
switch (header.MethodId)
{
case "-lh0-": break;
case "-lzs-": break;
case "-lz4-": break;
case "-lh1-": break;
case "-lh2-": break;
case "-lh3-": break;
case "-lh4-": break;
case "-lh5-": break;
case "-lh6-": break;
case "-lh7-": break;
default: throw new Exception("Unknown method");
}
}
catch (Exception e)
{
logger.LogError(e, "Unable to open archive");
}
throw new NotImplementedException();
}
return null;
internal static IEnumerable<LhContainer> GetFiles(ref readonly Stream stream)
{
var files = new List<LhContainer>();
while (stream.Position + 21 < stream.Length) files.Add(new LhContainer(in stream));
return files;
}
}