Example #1
0
        /// <summary>
        /// Returns the <see cref="ZipArchiveEntry"/> from the archive.
        /// </summary>
        /// <param name="entryFileType"></param>
        /// <returns></returns>
        /// <exception cref="OMODEntryNotFoundException"></exception>
        public ZipArchiveEntry GetArchiveEntry(OMODEntryFileType entryFileType)
        {
            var entry = _zipArchive.GetEntry(entryFileType.ToFileString());

            if (entry == null)
            {
                throw new OMODEntryNotFoundException(entryFileType);
            }

            return(entry);
        }
Example #2
0
 internal OMODEntryNotFoundException(OMODEntryFileType entryFileType) : base($"OMOD does not contain a {entryFileType.ToFileString()} file")
 {
 }
Example #3
0
        /// <summary>
        /// Determines if the <see cref="OMODEntryFileType"/> is present in the archive.
        /// </summary>
        /// <param name="entryFileType"></param>
        /// <returns></returns>
        public bool HasEntryFile(OMODEntryFileType entryFileType)
        {
            var entry = _zipArchive.GetEntry(entryFileType.ToFileString());

            return(entry != null);
        }
Example #4
0
 /// <summary>
 /// Tries to return the <see cref="ZipArchiveEntry"/> from the archive.
 /// </summary>
 /// <param name="entryFileType"></param>
 /// <param name="archiveEntry"></param>
 /// <returns></returns>
 public bool TryGetArchiveEntry(OMODEntryFileType entryFileType,
                                [MaybeNullWhen(false)] out ZipArchiveEntry archiveEntry)
 {
     archiveEntry = _zipArchive.GetEntry(entryFileType.ToFileString());
     return(archiveEntry != null);
 }