Git Product home page Git Product logo

netyaml's Introduction

NetYaml

NetYaml is a .Net library providing managed bindings for the LibYAML native YAML library.

Usage

The API is intended to be unobtrusive and loosely-typed.

Example Yaml.Parse usage:

string yaml =
@"---
x: 
- a
- b
y:
  f: [g,h]
  i: jk";

var doc = Yaml.Parse(yaml).First();
Console.WriteLine(doc["y"]["f"][0]); // prints 'g'

Example Yaml.Dump usage:

var doc = new YDocument(
  new YMapping(new Dictionary<YScalar, YNode> {
    {"x", new YSequence(new YScalar("a"), new YScalar("b"))},
    {"y", new YMapping(new Dictionary<YScalar, YNode> {
      {"f", new YSequence(new YScalar("g"), new YScalar("h"))},
      {"i", new YScalar("jk")}
    })},
  })
);
string yaml = Yaml.Dump(doc);
Console.WriteLine(yaml); // prints the YAML from the above parse example

Copyright

Copyright (c) 2011 Harry Wilkinson. See LICENSE for details.

LibYAML is Copyright (c) 2006 Kirill Simonov.

netyaml's People

Stargazers

 avatar

Watchers

 avatar

netyaml's Issues

Build script

The project should have a proper build script rather than just a VS2008 solution. I'd quite like to use something generic and platform-independent, without too many dependencies, like make.

Serialization attributes

Add attributes that may be used to annotate a class/struct so that it can be automatically serialized to a YAML node with an appropriate tag.

64-bit support

The solution is currently producing 32-bit code. There should be a platform-agnostic NetYaml assembly, with NetYamlNative varying depending on the architecture. Just a matter of build setup.

YPath

YPath support would be nice. The spec isn't entirely clear yet, but it doesn't look too tough.

Unit test coverage

There should be proper unit test coverage. Need to either get the existing (MSTest) unit test project working nicely with the native DLL (Visual Studio's integrated testing isn't deploying it properly), or replace it with some other unit test framework (probably a better option anyway if building with Mono is going to work).

Memory usage testing

Come up with something that will test for memory leaks, either in LibYAML itself or in the managed interop code. Just to be confident it's not a problem.

Register types with the parser

Provide a mechanism to register a given type with a specified tag, providing a delegate to handle deserialization from the YAML node to the client type.

Serialization interface

Specify an interface (IYamlSerializable or similar) that, when available, is used to serialize an object to a YAML node.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.