Included epub library in plugin project

This commit is contained in:
Marco Gavelli
2018-07-16 10:06:17 +02:00
parent a78428c698
commit a82cacd126
57 changed files with 57 additions and 61 deletions

View File

@@ -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;
}
}
}