using System.IO; using System.Threading.Tasks; namespace VersOne.Epub { /// /// Provides methods for loading content files. /// public interface IEpubContentLoader { /// /// Loads the whole content of the file and returns it as a byte array. /// /// Metadata of the content file reference to load. /// Content of the file. byte[] LoadContentAsBytes(EpubContentFileRefMetadata contentFileRefMetadata); /// /// Asynchronously loads the whole content of the file and returns it as a byte array. /// /// Metadata of the content file reference to load. /// A task that represents the asynchronous load operation. The value of the TResult parameter contains the content of the file. Task LoadContentAsBytesAsync(EpubContentFileRefMetadata contentFileRefMetadata); /// /// Loads the whole content of the file and returns it as a string. /// /// Metadata of the content file reference to load. /// Content of the file. string LoadContentAsText(EpubContentFileRefMetadata contentFileRefMetadata); /// /// Asynchronously loads the whole content of the file and returns it as a string. /// /// Metadata of the content file reference to load. /// A task that represents the asynchronous load operation. The value of the TResult parameter contains the content of the file. Task LoadContentAsTextAsync(EpubContentFileRefMetadata contentFileRefMetadata); /// /// Opens the file and returns a to access its content. /// /// Metadata of the content file reference to load. /// A to access the file's content. Stream GetContentStream(EpubContentFileRefMetadata contentFileRefMetadata); /// /// Asynchronously opens the file and returns a to access its content. /// /// Metadata of the content file reference to load. /// /// A task that represents the asynchronous open operation. The value of the TResult parameter contains the to access the file's content. /// Task GetContentStreamAsync(EpubContentFileRefMetadata contentFileRefMetadata); } }