unnonouno / yamlcast

Home Page:http://yamlcast.readthedocs.org/ja/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yamlcast

https://travis-ci.org/unnonouno/yamlcast.svg?branch=cppcheck https://coveralls.io/repos/unnonouno/yamlcast/badge.png?branch=master

yamlcast is a simple YAML serialization library for pficommon. You can serialize and deserialize arbitrary data with pficommon's serialization method.

Requirement

Install

$ ./waf configure
$ ./waf
$ ./waf install

Usage

This library works like pficommon's serialization library. It provide a thin wrapper for libyaml.

yamlcast::docuemnt::ptr doc = yamlcast::document::parse_file(path);

Or,

yamlcast::docuemnt::ptr doc = yamlcast::document::parse_string(str);

And, use serialize method and operator & for your own strcuts like pficommon.

struct User {
  int age;
  std::string name;

  template <typename Ar>
  void serialize(Ar& ar) {
    ar & MEMBER(age) & MEMBER(name);
  }
};

User user = yamlcast::yaml_cast<User>(*doc);

See the tests for more usage!

License

This library is distributed under MIT license.

About

http://yamlcast.readthedocs.org/ja/latest/

License:MIT License


Languages

Language:C++ 59.3%Language:Python 25.4%Language:Makefile 15.3%