Skip to content

mydatamodels/configcraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

configcraft

configcraft takes an example configuration file, and it generates a working parsing code with default values taken from the input file.

For example to generate the parsing C++ code for a JSON file simply run:

./configcraft -jc config.json

This will generate 3 files:

Config.hpp
ConfigJSON.hpp
ConfigJSON.cpp

If the configuration file content is in a string named cfg, you simply add the following to your code:

#include "ConfigJSON.hpp"

[...]

ConfigJSON cfg;

cfg.parse(cfg);

Your configuration can be retrieved with cfg.getRoot(), which returns a type ROOT defined in Config.hpp.

Currently only C++ and JSON are supported: contributions are welcome

About

Configuration file parsing code generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published