Changeset 11932 for stable/HeuristicLab.Problems.Instances.CordeauGQAP
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11650-11651
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/CordeauGQAPInstanceProvider.cs
r11170 r11932 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 27 using System.Reflection; 27 28 using System.Text.RegularExpressions; 28 using ICSharpCode.SharpZipLib.Zip;29 29 30 30 namespace HeuristicLab.Problems.Instances.CordeauGQAP { … … 56 56 if (String.IsNullOrEmpty(instanceArchiveName)) yield break; 57 57 58 using (var instanceStream = new Zip InputStream(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)) { 60 60 yield return new CordeauGQAPDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetDescription(), entry); 61 61 } … … 66 66 var descriptor = (CordeauGQAPDataDescriptor)id; 67 67 var instanceArchiveName = GetResourceName(FileName + @"\.zip"); 68 using (var instancesZipFile = new Zip File(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {68 using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 69 69 var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier); 70 using (var stream = instancesZipFile.GetInputStream(entry)) {70 using (var stream = entry.Open()) { 71 71 var parser = new CordeauGQAPParser(); 72 72 parser.Parse(stream); … … 117 117 .Where(x => Regex.Match(x, @".*\.Data\." + fileName).Success).SingleOrDefault(); 118 118 } 119 120 protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {121 ZipEntry entry;122 while ((entry = zipFile.GetNextEntry()) != null) {123 yield return entry.Name;124 }125 }126 119 } 127 120 } -
stable/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/HeuristicLab.Problems.Instances.CordeauGQAP-3.3.csproj
r11920 r11932 109 109 </PropertyGroup> 110 110 <ItemGroup> 111 <Reference Include="ICSharpCode.SharpZipLib">112 <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>113 <Private>False</Private>114 </Reference>115 111 <Reference Include="System" /> 116 112 <Reference Include="System.Core" /> 117 113 <Reference Include="System.Data" /> 114 <Reference Include="System.IO.Compression" /> 118 115 </ItemGroup> 119 116 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.