nixconfig Code
Status: Beta
Brought to you by:
mshindo
File | Date | Author | Commit |
---|---|---|---|
Makefile | 2009-06-08 | mshindo | [r2] renamed files to go with the project properly |
NixConfig.cpp | 2009-06-08 | mshindo | [r2] renamed files to go with the project properly |
NixConfig.h | 2009-06-08 | mshindo | [r2] renamed files to go with the project properly |
README.txt | 2009-06-08 | mshindo | [r1] Initial Import |
/* Original Author: mshindo - Michael Lawson-Searle This file is part of NixConf. NixConf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. NixConf is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NixConf. If not, see <http://www.gnu.org/licenses/>. */ NixConf: Author: Michael Lawson-Searle, michael@sphinix.com To compile: > make To Use: add the compiled library to your program: g++ main.cpp -lNixConf NixConf is a very simple c++ library for working with configuration files that are in the standard group format used by Linux and Unix applications. This library was made for the Sphirewall project but is so useful I wanted to share. Example Code: #include <iostream> #include <map> #include <vector> #include "UnixConf.h" using namespace std; using namespace UnixConfig; int main(){ ConfigFile config("test.conf", '.', ' '); config.load(); config.print(); config.add(".alias", "test key", "323223.23232.32"); config.print(); return 0; } It is very limited as the moment but I intend on expanding it further in then near future. See the header file for more details regarding use.