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.QAPLIB/3.3/HeuristicLab.Problems.Instances.QAPLIB-3.3.csproj

    r8909 r11677  
    1111    <RootNamespace>HeuristicLab.Problems.Instances.QAPLIB</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Problems.Instances.QAPLIB-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|x64'">
     
    6872    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    6973    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     74    <Prefer32Bit>false</Prefer32Bit>
    7075  </PropertyGroup>
    7176  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     
    8489    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    8590    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     91    <Prefer32Bit>false</Prefer32Bit>
    8692  </PropertyGroup>
    8793  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     
    100106    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    101107    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     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>
  • branches/ALPS/HeuristicLab.Problems.Instances.QAPLIB/3.3/QAPLIBInstanceProvider.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.QAPLIB {
     
    3434    protected virtual HashSet<string> ReversedSolutions {
    3535      get {
    36             return new HashSet<string>(new string[] {
     36        return new HashSet<string>(new string[] {
    3737              "bur26a",
    3838              "bur26b",
     
    177177      var solutionsArchiveName = GetResourceName(FileName + @"\.sln\.zip");
    178178      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
    179         using (var solutionsZipFile = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
    180           foreach (var entry in GetZipContents(solutionsZipFile))
    181             solutions.Add(Path.GetFileNameWithoutExtension(entry) + ".dat", entry);
     179        using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) {
     180          foreach (var entry in solutionsZipFile.Entries)
     181            solutions.Add(Path.GetFileNameWithoutExtension(entry.Name) + ".dat", entry.Name);
    182182        }
    183183      }
     
    185185      if (String.IsNullOrEmpty(instanceArchiveName)) yield break;
    186186
    187       using (var instanceStream = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
    188         foreach (var entry in GetZipContents(instanceStream).OrderBy(x => x)) {
     187      using (var instanceStream = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
     188        foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x)) {
    189189          yield return new QAPLIBDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetDescription(), entry, solutions.ContainsKey(entry) ? solutions[entry] : String.Empty);
    190190        }
     
    195195      var descriptor = (QAPLIBDataDescriptor)id;
    196196      var instanceArchiveName = GetResourceName(FileName + @"\.dat\.zip");
    197       using (var instancesZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
     197      using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
    198198        var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier);
    199199
    200         using (var stream = instancesZipFile.GetInputStream(entry)) {
     200        using (var stream = entry.Open()) {
    201201          var parser = new QAPLIBParser();
    202202          parser.Parse(stream);
     
    207207          if (!String.IsNullOrEmpty(descriptor.SolutionIdentifier)) {
    208208            var solutionsArchiveName = GetResourceName(FileName + @"\.sln\.zip");
    209             using (var solutionsZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
     209            using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) {
    210210              entry = solutionsZipFile.GetEntry(descriptor.SolutionIdentifier);
    211               using (var solStream = solutionsZipFile.GetInputStream(entry)) {
     211              using (var solStream = entry.Open()) {
    212212                var slnParser = new QAPLIBSolutionParser();
    213213                slnParser.Parse(solStream, true);
     
    258258              .Where(x => Regex.Match(x, @".*\.Data\." + fileName).Success).SingleOrDefault();
    259259    }
    260 
    261     protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {
    262       ZipEntry entry;
    263       while ((entry = zipFile.GetNextEntry()) != null) {
    264         yield return entry.Name;
    265       }
    266     }
    267260  }
    268261}
Note: See TracChangeset for help on using the changeset viewer.