Author: Richard Joseph Wagner
Description: C++ class for configuration file reader
Keywords: configuration,file,reader,input,text,C++,class,ConfigFile,data,type,datatype

# Configuration File Reader for C++

ConfigFile is a C++ class for reading configuration files. Such files are handy, for example, in running computer simulations. The simulation program can be set to read its input parameters and settings from a configuration file. Then, changing the simulation conditions is as easy as editing text in the configuration file rather than editing and recompiling the source code.

With this purpose in mind, ConfigFile is designed to be convenient, portable, and free. Take a look at the class header, class definition, example program, and sample input. Or, download the complete package in zip or tarball format.

Features:

- Human-readable configuration files:
  - `atoms = 250`
  - `length = 8.0 # nanometers`
  - `name = Reece Surcher`
- Simple file opening with `ConfigFile config( "config.inp" );`
- Convenient reading of any data type:
  - `int atoms = config.read<int>( "atoms" );`
  - `double length = config.read( "length", 10.0 );`
  - `string author = config.read<string>( "name", "none" );`
- Ability to modify and save configuration files
- Thorough example program
- Validation tests
- Open source code under MIT License

If you like this software, also try my version of the Mersenne Twister random number generator.