Addition of configuration file support

Cleanup a few warnings
This commit is contained in:
Mark Riddoch
2013-06-21 17:14:39 +02:00
parent dcc6071ddd
commit 3956abe604
63 changed files with 1189 additions and 70 deletions

20
inih/cpp/INIReaderTest.cpp Executable file
View File

@ -0,0 +1,20 @@
// Example that shows simple usage of the INIReader class
#include <iostream>
#include "INIReader.h"
int main()
{
INIReader reader("../examples/test.ini");
if (reader.ParseError() < 0) {
std::cout << "Can't load 'test.ini'\n";
return 1;
}
std::cout << "Config loaded from 'test.ini': version="
<< reader.GetInteger("protocol", "version", -1) << ", name="
<< reader.Get("user", "name", "UNKNOWN") << ", email="
<< reader.Get("user", "email", "UNKNOWN") << ", active="
<< reader.GetBoolean("user", "active", true) << "\n";
return 0;
}