cfgfile 0.2.11
|
cfgfile - is a header-only library for reading/saving configuration files. The main approach of cfgfile that you define root tag of configuration with all neseccary child nested tags. Once you define hierarchy of tags that describes the schema of your configuration you can read and save configuration files from/to any supported stream. cfgfile supports std::istream, std::wistream and QTextStream for reading. Tag in the schema is a class derived from cfgfile::tag_t< Trait > or any ready to use derived classes. To simplify a life you can use generator to generate C++ classed of data and tags with DSL.
Let's say you have data structure representing configuration of your application.
And you want to save this structure in the following format.
Then you can define tag for cfgfile to read and save such configuration file.
Once you defined data structure and tag you can read and write configuration.
And
How can I add cfgfile to my project?
add_subdirectory()
, if you will do so you have to add include directory path to your project with include_directories
( ${cfgfile_INCLUDE_DIRECTORIES}
).Is it possible to disable STL strings/streams and use Qt only.
CFGFILE_DISABLE_STL
and CFGFILE_QT_SUPPORT
together. Additionally to CFGFILE_QT_SUPPORT
you can define CFGFILE_XML_SUPPORT
to enable XML format support.