Changeset 1615 for trunk/sources
- Timestamp:
- 04/21/09 15:27:35 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/Tokens/SerializationTokenBase.cs
r1556 r1615 1 1 using HeuristicLab.Persistence.Interfaces; 2 using System.Reflection; 3 using System.Text; 2 4 3 5 namespace HeuristicLab.Persistence.Core.Tokens { … … 8 10 Name = name; 9 11 } 12 public override string ToString() { 13 StringBuilder sb = new StringBuilder(); 14 sb.Append(this.GetType().Name).Append('('); 15 foreach (FieldInfo fi in this.GetType().GetFields()) { 16 sb.Append(fi.Name).Append('=').Append(fi.GetValue(this)).Append(", "); 17 } 18 sb.Append(')'); 19 return sb.ToString(); 20 } 10 21 } 11 22 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlFormatter.cs
r1570 r1615 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using System.Text; 5 using System.Text.RegularExpressions; 5 6 6 7 … … 10 11 public class String2XmlFormatter : FormatterBase<string, XmlString> { 11 12 12 public override XmlString Format(string s) { 13 public override XmlString Format(string s) { 13 14 StringBuilder sb = new StringBuilder(); 14 15 sb.Append("<![CDATA["); … … 18 19 } 19 20 20 private static readonly string[] separators = new string[] { "<![CDATA[", "]]>" }; 21 22 public override string Parse(XmlString x) { 21 public override string Parse(XmlString x) { 23 22 StringBuilder sb = new StringBuilder(); 24 foreach (string s in x.Data.Split(separators,25 StringSplitOptions.RemoveEmptyEntries)) {26 sb.Append( s);23 Regex re = new Regex(@"<!\[CDATA\[((?:[^]]|\](?!\]>))*)\]\]>", RegexOptions.Singleline); 24 foreach (Match m in re.Matches(x.Data)) { 25 sb.Append(m.Groups[1]); 27 26 } 28 27 return sb.ToString(); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
r1612 r1615 10 10 using HeuristicLab.Persistence.Core.Tokens; 11 11 12 namespace HeuristicLab.Persistence.Default.Xml { 12 namespace HeuristicLab.Persistence.Default.Xml { 13 13 14 14 public class XmlGenerator : GeneratorBase<string> { … … 177 177 writer = new StreamWriter(zipStream); 178 178 foreach (string line in generator.Format(serializer.TypeCache)) { 179 writer.Write Line(line);179 writer.Write(line); 180 180 logger.Debug(line.TrimEnd()); 181 181 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs
r1566 r1615 1 1 using HeuristicLab.Persistence.Interfaces; 2 2 using HeuristicLab.Persistence.Core; 3 using System.Text; 3 4 4 5 namespace HeuristicLab.Persistence.Default.Xml { … … 12 13 Data = data; 13 14 } 15 16 public override string ToString() { 17 StringBuilder sb = new StringBuilder(); 18 sb.Append("XmlString(").Append(Data).Append(')'); 19 return sb.ToString(); 20 } 14 21 } 15 22 }
Note: See TracChangeset
for help on using the changeset viewer.