- Timestamp:
- 12/10/14 10:31:41 (10 years ago)
- Location:
- branches/ALPS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS
-
branches/ALPS/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/CordeauGQAPInstanceProvider.cs
r11171 r11677 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 } -
branches/ALPS/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/HeuristicLab.Problems.Instances.CordeauGQAP-3.3.csproj
r8624 r11677 11 11 <RootNamespace>HeuristicLab.Problems.Instances.CordeauGQAP</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Problems.Instances.CordeauGQAP-3.3</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> 15 <TargetFrameworkProfile /> 15 16 </PropertyGroup> 16 17 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 22 23 <ErrorReport>prompt</ErrorReport> 23 24 <WarningLevel>4</WarningLevel> 25 <Prefer32Bit>false</Prefer32Bit> 24 26 </PropertyGroup> 25 27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 30 32 <ErrorReport>prompt</ErrorReport> 31 33 <WarningLevel>4</WarningLevel> 34 <Prefer32Bit>false</Prefer32Bit> 32 35 </PropertyGroup> 33 36 <PropertyGroup> … … 52 55 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 53 56 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 57 <Prefer32Bit>false</Prefer32Bit> 54 58 </PropertyGroup> 55 59 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> … … 67 71 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 68 72 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 73 <Prefer32Bit>false</Prefer32Bit> 69 74 </PropertyGroup> 70 75 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> … … 83 88 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 84 89 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 90 <Prefer32Bit>false</Prefer32Bit> 85 91 </PropertyGroup> 86 92 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> … … 100 106 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 101 107 <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> 108 <Prefer32Bit>false</Prefer32Bit> 102 109 </PropertyGroup> 103 110 <ItemGroup> 104 <Reference Include="ICSharpCode.SharpZipLib">105 <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>106 <Private>False</Private>107 </Reference>108 111 <Reference Include="System" /> 109 112 <Reference Include="System.Core" /> 110 113 <Reference Include="System.Data" /> 114 <Reference Include="System.IO.Compression" /> 111 115 </ItemGroup> 112 116 <ItemGroup> … … 142 146 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 143 147 <PropertyGroup> 144 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)148 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 145 149 set ProjectDir=$(ProjectDir) 146 150 set SolutionDir=$(SolutionDir) … … 148 152 149 153 call PreBuildEvent.cmd</PreBuildEvent> 150 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">154 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 151 155 export ProjectDir=$(ProjectDir) 152 156 export SolutionDir=$(SolutionDir)
Note: See TracChangeset
for help on using the changeset viewer.