SharpYaml is a .NET library for YAML
Перейти к файлу
Virgile Bello 5872854131 Added test for YamlMember.Mask 2015-09-18 10:19:41 +09:00
.nuget Update nuget 2015-05-13 23:21:40 +09:00
Dumper Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml Fix issue when serializing float/double with exponents 2015-09-18 10:15:35 +09:00
SharpYaml.Samples Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml.Tests Added test for YamlMember.Mask 2015-09-18 10:19:41 +09:00
SharpYamlEditor Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
doc/html
support
.gitignore Utilize NuGet to handle the xUnit.net dependency. 2013-08-20 16:39:01 +02:00
CommonAssemblyInfo.cs Bump version to 1.5.0 2015-07-28 12:20:36 +09:00
LICENSE.txt Update license and nuget 2013-11-03 17:01:49 +09:00
README.md Fix nuget package to allow .NET 4.0+ 2013-11-03 17:09:30 +09:00
SharpYaml.build Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml.sln Update to VS2013 2015-05-13 21:07:37 +09:00
SharpYaml.sln.DotSettings Update license and nuget 2013-11-03 17:01:49 +09:00
SharpYaml.snk Update license and nuget 2013-11-03 17:01:49 +09:00
VERSION
build.bat Update build.bat to use local .nuget\NuGet.exe 2015-07-28 12:23:00 +09:00

README.md

SharpYaml

SharpYaml is a .NET library that provides a YAML parser and serialization engine for .NET objects.

Usage

var serializer = new Serializer();
var text = serializer.Serialize(new { List = new List<int>() { 1, 2, 3 }, Name = "Hello", Value = "World!" });
Console.WriteLine(text);

Output:

List:
  - 1
  - 2
  - 3
Name: Hello
Value: World!

Features

SharpYaml is a fork of YamlDotNet and is adding the following features:

  • Supports for 4.0+ .NET Portable Class Library compatible with Windows desktop, Windows Phone 8 and Windows RT
  • Completely rewritten serialization/deserialization engine
  • A single interface IYamlSerializable for implementing custom serializers, along IYamlSerializableFactory to allow dynamic creation of serializers. Registration can be done through SerializerSettings.RegisterSerializer and SerializerSettings.RegisterSerializerFactory
    • Can inherit from ScalarSerializerBase to provide custom serialization to/from a Yaml scalar
  • Supports for custom collection that contains user properties to serialize along the collection.
  • Supports for Yaml 1.2 schemas
  • A centralized type system through ITypeDescriptor and IMemberDescriptor
  • Highly configurable serialization using SerializerSettings (see usage)
    • Add supports to register custom attributes on external objects (objects that you can't modify) by using SerializerSettings.Register(memberInfo, attribute)
    • Several options and settings: EmitAlias, IndentLess, SortKeyForMapping, EmitJsonComptible, EmitCapacityForList, LimitPrimitiveFlowSequence, EmitDefaultValues
    • Add supports for overriding the Yaml style of serialization (block or flow) with SerializerSettings.DefaultStyle and SerializerSettings.DynamicStyleFormat
  • Supports for registering an assembly when discovering types to deserialize through SerializerSettings.RegisterAssembly
  • Memory allocation and GC pressure improved

Available from Nuget

You can download SharpYaml binaries directly from nuget.

License

MIT