Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1476


Ignore:
Timestamp:
04/01/09 15:10:14 (16 years ago)
Author:
epitzer
Message:

Decomposers for all primitive types except string. (#563)

Location:
trunk/sources/HeuristicLab.Persistence
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/Default/ViewOnly/ViewOnlyFormat.cs

    r1454 r1476  
    4545    public override Type Type { get { return typeof(Type); } }
    4646  }
    47 
    48   //public class ToStringDecomposer : IDecomposer {
    49   // should not be used by default
    50   public class ToStringDecomposer {
    51     public bool CanDecompose(Type type) { return true; }
    52     public IEnumerable<Tag> DeCompose(object obj) {
    53       yield return new Tag(obj.ToString());
    54     }
    55 
    56     public object CreateInstance(Type type) {
    57       throw new NotImplementedException();
    58     }
    59 
    60     public object Populate(object instance, IEnumerable<Tag> tags, Type type) {
    61       throw new NotImplementedException();
    62     }
    63 
    64   }
    65 
    6647
    6748  public class ViewOnlyGenerator : Generator<string> {
  • trunk/sources/HeuristicLab.Persistence/Default/Xml/XmlGenerator.cs

    r1466 r1476  
    66using System.IO;
    77using ICSharpCode.SharpZipLib.Zip;
     8using HeuristicLab.Tracing;
     9using log4net;
    810
    911namespace HeuristicLab.Persistence.Default.Xml {
     
    145147      zipStream.PutNextEntry(new ZipEntry("data.xml"));     
    146148      StreamWriter writer = new StreamWriter(zipStream);
    147       foreach ( ISerializationToken token in serializer )
    148         writer.Write(generator.Format(token));
     149      ILog logger = Logger.GetDefaultLogger();     
     150      foreach (ISerializationToken token in serializer) {
     151        string line = generator.Format(token);
     152        writer.Write(line);
     153        logger.Debug(line);
     154      }
    149155      writer.Flush();
    150156      zipStream.PutNextEntry(new ZipEntry("typecache.xml"));
    151157      writer = new StreamWriter(zipStream);
    152       foreach ( string line in generator.Format(serializer.TypeCache))
     158      foreach (string line in generator.Format(serializer.TypeCache)) {
    153159        writer.WriteLine(line);
     160        logger.Debug(line);
     161      }
    154162      writer.Flush();           
    155163      zipStream.Close();     
  • trunk/sources/HeuristicLab.Persistence/HeuristicLab.Persistence.csproj

    r1474 r1476  
    8080      <HintPath>..\HeuristicLab.PluginInfrastructure.GUI\ICSharpCode.SharpZipLib.dll</HintPath>
    8181    </Reference>
     82    <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
     83      <SpecificVersion>False</SpecificVersion>
     84      <HintPath>..\HeuristicLab.Tracing\libs\debug\log4net.dll</HintPath>
     85    </Reference>
    8286    <Reference Include="System" />
    8387    <Reference Include="System.configuration" />
     
    99103    <Compile Include="Default\Decomposers\StorableDecomposer.cs" />
    100104    <Compile Include="Default\Decomposers\TypeDecomposer.cs" />
     105    <Compile Include="Default\Decomposers\X2StringDecomposer.cs" />
    101106    <Compile Include="Default\ViewOnly\ViewOnlyFormat.cs" />
    102107    <Compile Include="Default\Xml\Compact\IntArray2XmlFormatters.cs" />
     
    107112    <Compile Include="Core\DataMemberAccessor.cs" />
    108113    <Compile Include="Default\Xml\Compact\IntList2XmlFormatter.cs" />
    109     <Compile Include="Default\Xml\Primitive\Sting2XmlFormatter.cs" />
     114    <Compile Include="Default\Xml\Primitive\String2XmlFormatter.cs" />
    110115    <Compile Include="Default\Xml\Primitive\Int2XmlFormatter.cs" />
    111116    <Compile Include="Default\Xml\Primitive\Double2XmlFormatter.cs" />
Note: See TracChangeset for help on using the changeset viewer.