Skip to content
forked from mircodz/tojson

header only library to convert yaml and xml files to nlohmann::json

License

Notifications You must be signed in to change notification settings

MarcoFilimon/tojson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tojson is a tiny (127 sloc), header only library to convert xml and yaml documents into nlohmann::json objects.

minimal functioning example

#include <iostream>

#include "tojson.hpp"

int main() {
	using namespace tojson;
	using namespace tojson::emitters;

	nlohmann::json a = loadxml("./example.xml");
	nlohmann::json b = loadyaml("./example.yml");

	std::cout << a.dump() << std::endl;
	std::cout << b.dump() << std::endl;

	std::cout << toyaml(a) << std::endl;
	std::cout << toxml(b) << std::endl;
}

dependencies

  • rapidxml
  • yaml-cpp
  • nlohmann::json

About

header only library to convert yaml and xml files to nlohmann::json

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%