SharpYaml is a .NET library for YAML
Перейти к файлу
Nicolas Musset caf01328e5 Fix GetShortAssemblyQualifiedName to work properly with generic types. (#1) 2016-09-29 18:13:08 +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 GetShortAssemblyQualifiedName to work properly with generic types. (#1) 2016-09-29 18:13:08 +09:00
SharpYaml.Samples Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml.Tests Add tests for NaN and Infinity float/double. 2016-05-16 15:27:54 +09:00
SharpYamlEditor Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
doc/html Added: Version file. 2010-05-31 22:07:42 +00:00
support Add Serialize() method to YamlSerializer for backwards compatibility. 2012-12-10 16:28:12 +00:00
.gitignore Utilize NuGet to handle the xUnit.net dependency. 2013-08-20 16:39:01 +02:00
CommonAssemblyInfo.cs Bump to version 1.5.3 2015-12-23 11:28:32 +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 Created version 1.1 2010-05-31 22:09:11 +00:00
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