/// <summary>
 /// Gets the available implementations of the given compressed archive format.
 /// </summary>
 /// <param name="format">The compressed archive format whose available implementations are desired.</param>
 /// <returns>The available implementations. If unsupported, an empty enumerable is returned.</returns>
 public static IEnumerable <CompressedArchiveAccessImplementation> GetAvailableCompressedArchiveImplementations(this CompressedArchiveFormat format)
 {
     lock (Lock)
     {
         var implementations = Enumerable.Empty <CompressedArchiveAccessImplementation>();
         IList <CompressedArchiveAccessImplementation> registeredImplementations;
         if (format.IsCompressedArchiveFormatSupported() && CompressedArchiveAccessImplementations.Value.TryGetValue(format, out registeredImplementations))
         {
             implementations = registeredImplementations;
         }
         return(implementations);
     }
 }
 /// <summary>
 /// Gets the file extension(s) commonly used for the given compressed archive format.
 /// </summary>
 /// <param name="format">The compressed archive format whose file extensions are desired.</param>
 /// <returns>The file extensions. If an unexpected value for <paramref name="format"/> is provided, an empty enumerable is returned.</returns>
 public static IEnumerable <string> FileExtensions(this CompressedArchiveFormat format)
 {
     lock (Lock)
     {
         var           fileExtensions = Enumerable.Empty <string>();
         List <string> registeredFileExtensions;
         if (format.IsCompressedArchiveFormatSupported() && CompressedArchiveFormatFileExtensions.Value.TryGetValue(format, out registeredFileExtensions))
         {
             fileExtensions = registeredFileExtensions;
         }
         return(fileExtensions);
     }
 }
Example #3
0
 public void CompressedArchiveFormat_IsCompressedArchiveFormatSupported_ReturnsCorrectValue(CompressedArchiveFormat format, bool expectedIsSupported)
 {
     Assert.Equal(expectedIsSupported, format.IsCompressedArchiveFormatSupported());
 }