ConfigLib

A C++ library designed to write/read configuration files.
Download

ConfigLib Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Warren vonRoeschlaub
  • Publisher web site:

ConfigLib Tags


ConfigLib Description

A C++ library designed to write/read configuration files. ConfigLib is a C++ library designed to write/read configuration files. The three main goals of the project are1. To allow reading and writing of a configuration file with minimal disruption of the data and any comments.2. To ensure that developers adopt an all or nothing stance: adding a variable allows it to do everything needed right away, discouraging a half completed addition that is never actually finished.3. To make adding a new configuration setting as simple as declaring a variable, even if it is a complex object.These goals were created when I watched project after project where configuration settings were read but not written, were read and written to two different spots, didn't have a default value, or even never actually read. People just starting on the projects wouldn't know all the ins-and-outs of where configuration settings needed to be placed, and advanced programmers would half-implement the issues with the intention of finishing everything once they had got the code working, often long after they forgot what needed to be completed.How easy is it to use? Consider the following simple example:configfile g_MainConfig("filename.conf");configitem font_size(g_MainConfig, "fonts", "font size", "f=", 10);What does this do?The first line declares a configuration file with the name "filename.conf". Any configuration settings using this file object will read from the configuration file with that name.The second line uses the configitem template to add an int variable. If you have ever used the STL you are probably familiar with creating variables like this. If not just remember that the variable will look just like whatever type is enclosed in the , in this case an int. The object constructor takes five variables. The first is the configuration file object to read from, the second is the section name, the third is the setting name, the fourth is the command line parameter and the last is the default value.In this case, the configuration file may look likefont size=4in which case the variable font_size would contain 10 when initially created and 4 after the configuration file was read. What's New in This Release: · This update provides some minor performance improvements, and adds better const support including const iterators.


ConfigLib Related Software