Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/10/14 10:31:41 (10 years ago)
Author:
pfleck
Message:

#2269 Merged trunk. Updated .net version of ALPS plugin.

Location:
branches/ALPS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS

  • branches/ALPS/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/CordeauGQAPInstanceProvider.cs

    r11171 r11677  
    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}
  • branches/ALPS/HeuristicLab.Problems.Instances.CordeauGQAP/3.3/HeuristicLab.Problems.Instances.CordeauGQAP-3.3.csproj

    r8624 r11677  
    1111    <RootNamespace>HeuristicLab.Problems.Instances.CordeauGQAP</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Problems.Instances.CordeauGQAP-3.3</AssemblyName>
    13     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
     15    <TargetFrameworkProfile />
    1516  </PropertyGroup>
    1617  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    2223    <ErrorReport>prompt</ErrorReport>
    2324    <WarningLevel>4</WarningLevel>
     25    <Prefer32Bit>false</Prefer32Bit>
    2426  </PropertyGroup>
    2527  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    3032    <ErrorReport>prompt</ErrorReport>
    3133    <WarningLevel>4</WarningLevel>
     34    <Prefer32Bit>false</Prefer32Bit>
    3235  </PropertyGroup>
    3336  <PropertyGroup>
     
    5255    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    5356    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     57    <Prefer32Bit>false</Prefer32Bit>
    5458  </PropertyGroup>
    5559  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     
    6771    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    6872    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
     73    <Prefer32Bit>false</Prefer32Bit>
    6974  </PropertyGroup>
    7075  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     
    8388    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    8489    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     90    <Prefer32Bit>false</Prefer32Bit>
    8591  </PropertyGroup>
    8692  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     
    100106    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
    101107    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
     108    <Prefer32Bit>false</Prefer32Bit>
    102109  </PropertyGroup>
    103110  <ItemGroup>
    104     <Reference Include="ICSharpCode.SharpZipLib">
    105     <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
    106     <Private>False</Private>
    107   </Reference>
    108111    <Reference Include="System" />
    109112    <Reference Include="System.Core" />
    110113    <Reference Include="System.Data" />
     114    <Reference Include="System.IO.Compression" />
    111115  </ItemGroup>
    112116  <ItemGroup>
     
    142146  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    143147  <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)
    145149set ProjectDir=$(ProjectDir)
    146150set SolutionDir=$(SolutionDir)
     
    148152
    149153call PreBuildEvent.cmd</PreBuildEvent>
    150 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     154    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    151155export ProjectDir=$(ProjectDir)
    152156export SolutionDir=$(SolutionDir)
Note: See TracChangeset for help on using the changeset viewer.