mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 19:19:10 +00:00
Included epub library in plugin project
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user