using System;
using VersOne.Epub.Schema;
namespace VersOne.Epub
{
///
/// Metadata for a content file reference.
///
public class EpubContentFileRefMetadata
{
///
/// Initializes a new instance of the class with a specified content file key, a content type of the file reference,
/// and a MIME type of the file's content.
///
/// The key of the content file as it is declared in the EPUB manifest (in the property).
/// The type of the content of the file.
/// The MIME type of the content of the file.
/// The parameter is null.
/// The parameter is an empty string.
/// The parameter is null.
public EpubContentFileRefMetadata(string key, EpubContentType contentType, string contentMimeType)
{
Key = key ?? throw new ArgumentNullException(nameof(key));
if (key == String.Empty)
{
throw new ArgumentException("Content file name cannot be empty.", nameof(key));
}
ContentType = contentType;
ContentMimeType = contentMimeType ?? throw new ArgumentNullException(nameof(contentMimeType));
}
///
/// Gets the content file key as it is declared in the EPUB manifest (in the property).
/// This is either a relative path of the content file within the EPUB archive (for local content files)
/// or an absolute URI of the content file outside of the EPUB archive (for remote content files).
///
public string Key { get; }
///
/// Gets the type of the content of the file (e.g. or ).
///
public EpubContentType ContentType { get; }
///
/// Gets the MIME type of the content of the file.
///
public string ContentMimeType { get; }
}
}