Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 10:08:54 (10 years ago)
Author:
ascheibe
Message:

#2247 merged r11650, r11651 into stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/CordeauGQAPInstanceProvider.cs

    r11170 r11932  
    2323using System.Collections.Generic;
    2424using System.IO;
     25using System.IO.Compression;
    2526using System.Linq;
    2627using System.Reflection;
    2728using System.Text.RegularExpressions;
    28 using ICSharpCode.SharpZipLib.Zip;
    2929
    3030namespace HeuristicLab.Problems.Instances.CordeauGQAP {
     
    5656      if (String.IsNullOrEmpty(instanceArchiveName)) yield break;
    5757
    58       using (var instanceStream = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
    59         foreach (var entry in GetZipContents(instanceStream).OrderBy(x => x)) {
     58      using (var instanceStream = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
     59        foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x)) {
    6060          yield return new CordeauGQAPDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetDescription(), entry);
    6161        }
     
    6666      var descriptor = (CordeauGQAPDataDescriptor)id;
    6767      var instanceArchiveName = GetResourceName(FileName + @"\.zip");
    68       using (var instancesZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
     68      using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
    6969        var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier);
    70         using (var stream = instancesZipFile.GetInputStream(entry)) {
     70        using (var stream = entry.Open()) {
    7171          var parser = new CordeauGQAPParser();
    7272          parser.Parse(stream);
     
    117117              .Where(x => Regex.Match(x, @".*\.Data\." + fileName).Success).SingleOrDefault();
    118118    }
    119 
    120     protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {
    121       ZipEntry entry;
    122       while ((entry = zipFile.GetNextEntry()) != null) {
    123         yield return entry.Name;
    124       }
    125     }
    126119  }
    127120}
  • stable/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/HeuristicLab.Problems.Instances.CordeauGQAP-3.3.csproj

    r11920 r11932  
    109109  </PropertyGroup>
    110110  <ItemGroup>
    111     <Reference Include="ICSharpCode.SharpZipLib">
    112       <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
    113       <Private>False</Private>
    114     </Reference>
    115111    <Reference Include="System" />
    116112    <Reference Include="System.Core" />
    117113    <Reference Include="System.Data" />
     114    <Reference Include="System.IO.Compression" />
    118115  </ItemGroup>
    119116  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.