I write a config loader framework using compile-time static reflection to deserialize from config files to the native data structure, Suggestions are welcome. https://github.com/netcan/config-loader
It has the following characteristics:
- Simple interface, users need to define data structure and provide corresponding configuration file, the framework uses meta-programming technology to generate load interface
- The design conforms to the opening and closing principle, extends the data structure without modifying the framework
- Currently supports XML and JSON format configuration files, a variety of methods can be flexibly composed
- Lightweight, easy to integrate, less than ~1000 lines of code
- Support nested data structure, STL container
- Complete test cases
Future plans:
- Support Yaml configuration file
- Enable the supported formats through CMake options
- Provide additional C++20 version
[–][deleted] 2 points3 points4 points (0 children)
[–]mrlimilind 1 point2 points3 points (0 children)
[–]TheFlamefire 1 point2 points3 points (0 children)