Skip to content

mircodz/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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages