| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 |
<html> |
| 3 |
|
| 4 |
<head> |
| 5 |
<meta name="Author" content="Richard Joseph Wagner"> |
| 6 |
<meta name="Description" content="C++ class for configuration file reader"> |
| 7 |
<meta name="Keywords" content="configuration,file,reader,input,text,C++,class,ConfigFile,data,type,datatype"> |
| 8 |
<link href="main.css" rel="stylesheet" type="text/css"> |
| 9 |
<style type="text/css"> |
| 10 |
body { background: url("AntBlueMaize.jpg"); } |
| 11 |
tr { text-indent: 2em } |
| 12 |
</style> |
| 13 |
<title>Configuration File Reader for C++</title> |
| 14 |
</head> |
| 15 |
|
| 16 |
<body> |
| 17 |
|
| 18 |
<h1>Configuration File Reader for C++</h1> |
| 19 |
|
| 20 |
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. |
| 21 |
|
| 22 |
<p>With this purpose in mind, ConfigFile is designed to be convenient, portable, and free. Take a look at the |
| 23 |
<a href="ConfigFile.h">class header</a>, |
| 24 |
<a href="ConfigFile.cpp">class definition</a>, |
| 25 |
<a href="example.cpp">example program<a>, and |
| 26 |
<a href="example.inp">sample input<a>. |
| 27 |
Or, download the complete package in |
| 28 |
<a href="ConfigFile-2.1.zip">zip</a> |
| 29 |
or |
| 30 |
<a href="ConfigFile-2.1.tar.gz">tarball</a> |
| 31 |
format. |
| 32 |
|
| 33 |
<p>Features: |
| 34 |
<ul> |
| 35 |
<li>Human-readable configuration files: |
| 36 |
<ul> |
| 37 |
<li><code>atoms = 250</code> |
| 38 |
<li><code>length = 8.0 # nanometers</code> |
| 39 |
<li><code>name = Reece Surcher</code> |
| 40 |
</ul> |
| 41 |
<li>Simple file opening with <code>ConfigFile config( "config.inp" );</code> |
| 42 |
<li>Convenient reading of any data type: |
| 43 |
<ul> |
| 44 |
<li><code>int atoms = config.read<int>( "atoms" );</code> |
| 45 |
<li><code>double length = config.read( "length", 10.0 );</code> |
| 46 |
<li><code>string author = config.read<string>( "name", "none" );</code> |
| 47 |
</ul> |
| 48 |
<li>Ability to modify and save configuration files |
| 49 |
<li>Thorough example program |
| 50 |
<li>Validation tests |
| 51 |
<li>Open source code under MIT License |
| 52 |
</ul> |
| 53 |
|
| 54 |
<p>If you like this software, also try my version of the |
| 55 |
<a href="http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html">Mersenne Twister</a> |
| 56 |
random number generator. |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
<p><table align=center><tr> |
| 61 |
<td><a href="http://www-personal.engin.umich.edu/~wagnerr/index.html"> |
| 62 |
<img class="nav" src="ArrowHome.gif" alt="^ home" height=16 width=16 border=0> |
| 63 |
</a></td> |
| 64 |
<td><span class="center"><address> |
| 65 |
Rick Wagner ( |
| 66 |
<a href="mailto:[email protected]">[email protected]</a> |
| 67 |
) 26 May 04 |
| 68 |
</address></span></td> |
| 69 |
</table> |
| 70 |
|
| 71 |
</body> |
| 72 |
</html> |