mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 11:09:06 +00:00
23 lines
979 B
C#
23 lines
979 B
C#
using System.IO.Compression;
|
|
using System.Threading.Tasks;
|
|
using VersOne.Epub.Schema;
|
|
|
|
namespace VersOne.Epub.Internal
|
|
{
|
|
internal static class SchemaReader
|
|
{
|
|
public static async Task<EpubSchema> ReadSchemaAsync(ZipArchive epubArchive)
|
|
{
|
|
EpubSchema result = new EpubSchema();
|
|
string rootFilePath = await RootFilePathReader.GetRootFilePathAsync(epubArchive).ConfigureAwait(false);
|
|
string contentDirectoryPath = ZipPathUtils.GetDirectoryPath(rootFilePath);
|
|
result.ContentDirectoryPath = contentDirectoryPath;
|
|
EpubPackage package = await PackageReader.ReadPackageAsync(epubArchive, rootFilePath).ConfigureAwait(false);
|
|
result.Package = package;
|
|
EpubNavigation navigation = await NavigationReader.ReadNavigationAsync(epubArchive, contentDirectoryPath, package).ConfigureAwait(false);
|
|
result.Navigation = navigation;
|
|
return result;
|
|
}
|
|
}
|
|
}
|