- Timestamp:
- 04/16/09 12:58:14 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Bool2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Bool2XmlFormatter : SimpleNumber2XmlFormatterBase<bool> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Byte2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Byte2XmlFormatter : SimpleNumber2XmlFormatterBase<byte> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlFormatter.cs
r1564 r1566 6 6 7 7 [EmptyStorableClass] 8 public class DateTime2XmlFormatter : FormatterBase<DateTime, XmlString> { 9 8 public class DateTime2XmlFormatter : FormatterBase<DateTime, XmlString> { 9 10 10 public override XmlString Format(DateTime dt) { 11 return new XmlString(dt.Ticks.ToString()); 11 return new XmlString(dt.Ticks.ToString()); 12 12 } 13 13 … … 18 18 } 19 19 20 20 21 21 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Decimal2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Decimal2XmlFormatter : DecimalNumber2XmlFormatterBase<decimal> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DecimalNumber2XmlFormatterBase.cs
r1564 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 public abstract class DecimalNumber2XmlFormatterBase<T> : FormatterBase<T, XmlString> { 10 10 11 11 private static MethodInfo ToStringMethod = typeof(T) 12 12 .GetMethod( … … 30 30 return new XmlString((string)ToStringMethod.Invoke(t, new object[] { "r", CultureInfo.InvariantCulture })); 31 31 } 32 public override T Parse(XmlString x) { 32 public override T Parse(XmlString x) { 33 33 return (T)ParseMethod.Invoke(null, new object[] { x.Data, CultureInfo.InvariantCulture }); 34 34 } 35 } 35 } 36 36 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Double2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Double2XmlFormatter : DecimalNumber2XmlFormatterBase<double> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Float2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Float2XmlFormatter : DecimalNumber2XmlFormatterBase<float> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Int2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 9 [EmptyStorableClass] 10 10 public class Int2XmlFormatter : SimpleNumber2XmlFormatterBase<int> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Long2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 9 [EmptyStorableClass] 10 10 public class Long2XmlFormatter : SimpleNumber2XmlFormatterBase<long> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SByte2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Sbyte2XmlFormatter : SimpleNumber2XmlFormatterBase<sbyte> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Short2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class Short2XmlFormatter : SimpleNumber2XmlFormatterBase<short> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlFormatterBase.cs
r1564 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 9 public abstract class SimpleNumber2XmlFormatterBase<T> : FormatterBase<T, XmlString> { … … 22 22 } 23 23 public override T Parse(XmlString x) { 24 return (T)ParseMethod.Invoke(null, new[] { x.Data }); 24 return (T)ParseMethod.Invoke(null, new[] { x.Data }); 25 25 } 26 } 26 } 27 27 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlFormatter.cs
r1564 r1566 9 9 [EmptyStorableClass] 10 10 public class String2XmlFormatter : FormatterBase<string, XmlString> { 11 11 12 12 public override XmlString Format(string s) { 13 13 StringBuilder sb = new StringBuilder(); … … 15 15 sb.Append(s.Replace("]]>", "]]]]><![CDATA[>")); 16 16 sb.Append("]]>"); 17 return new XmlString(sb.ToString()); 17 return new XmlString(sb.ToString()); 18 18 } 19 19 … … 22 22 public override string Parse(XmlString x) { 23 23 StringBuilder sb = new StringBuilder(); 24 foreach (string s in x.Data.Split(separators, 24 foreach (string s in x.Data.Split(separators, 25 25 StringSplitOptions.RemoveEmptyEntries)) { 26 26 sb.Append(s); … … 28 28 return sb.ToString(); 29 29 } 30 } 30 } 31 31 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UInt2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class UInt2XmlFormatter : SimpleNumber2XmlFormatterBase<uint> { } 11 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/ULong2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 public class ULong2XmlFormatter : SimpleNumber2XmlFormatterBase<ulong> { } 11 10 public class ULong2XmlFormatter : SimpleNumber2XmlFormatterBase<ulong> { } 11 12 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UShort2XmlFormatter.cs
r1554 r1566 5 5 using System.Globalization; 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 9 9 [EmptyStorableClass] 10 10 public class UShort2XmlFormatter : SimpleNumber2XmlFormatterBase<ushort> { } 11 11 12 12 }
Note: See TracChangeset
for help on using the changeset viewer.